Questions tagged [scalatra]

Scalatra is a tiny Scala web framework, inspired by Sinatra.

Scalatra is a microframework written in Scala. It is a port of the Sinatra framework written in Ruby. Scalatra can be expanded into a minimal but full-featured model-view-controller web framework.

Website: http://scalatra.org/

Source: https://github.com/scalatra/scalatra

309 questions
2
votes
2 answers

Working with a Scalatra application in an Eclipse workspace? (i.e. build path)

I am experimenting with a small Scalatra web application, which I have imported as a project into Eclipse. I have used Eclipse to manage a few Lift applications before. With a Lift project, SBT copies all the dependency JAR's to a /lib_managed…
Steve Perkins
  • 11,520
  • 19
  • 63
  • 95
2
votes
1 answer

Scalatra -- byte array/image stream in request body

There's tons of documentation on Internet how to send a file stream in HTTP POST request in other languages, but not in Scalatra. To the topic: I'd like to send an image as byte array or as a file stream (sorry for sloppy terminology, I'm an…
2
votes
2 answers

Simple scalatra-test specs2 example throws Exception

I'm getting this exception when running the scalatra specs2 example from the scalatra docs: ThrowableException: org.eclipse.jetty.http.HttpGenerator.flushBuffer()I (FutureTask.java:138) Here is the test code (starting on line 5, skipping…
fayvor
  • 53
  • 4
1
vote
2 answers

Scalate sbt 0.11.0 plugin help

I'm developing a Scalatra web app with Scalate Jade and using sbt 0.11.0 I've been packaging the web app with "com.github.siasia" %% "xsbt-web-plugin" % "0.1.2". I've also been experimenting with "com.zentrope" %% "xsbt-scalate-precompile-plugin" %…
torrens
  • 163
  • 5
1
vote
1 answer

Cannot resolve errors for Scalatra project in Intellij IDEA IDE

Im using IntelliJ Idea IDE for working on a scalatra project i created using giter8.I use sbt to run the project.When i open the project in IntelliJ , i get the following errors in MyScalatraServlet.scala: Cannot resolve symbol scalate Cannot…
user897305
1
vote
1 answer

Value webSettings not found error in a Scalatra project

I have a Scalatra project with the following build.sbt organization := "com.example" name := "scalatra-project" version := "0.1.0-SNAPSHOT" scalaVersion := "2.9.1" seq(webSettings :_*) libraryDependencies ++= Seq( "org.scalatra" %% "scalatra"…
user897305
1
vote
1 answer

servlet/database: how to do fine-grained database connection and statement management (not bound to servlet lifetime)

Question/Environment The goal of my web application is to be a handy interface to the database at our company. I'm using: Scalatra (as minimal web framework) Jetty (as servlet container) SBT (Simple Build Tool) JDBC (to interface with the…
Aktau
  • 1,847
  • 21
  • 30
1
vote
1 answer

streaming page results in scalatra / unfiltered

when writing a CGI script or a basic servlet you can send part of the response to the client before the entire response has been generated. This is advantageous when, for example, performing a large SQL query and displaying the results in an HTML…
schmmd
  • 18,650
  • 16
  • 58
  • 102
1
vote
1 answer

Scalatra example fails to start

I decided to try Scalatra out. But the server does not seem to start, and the commands do not return any errors. I first got the scalatra project from GitHub: git clone http://github.com/scalatra/scalatra-sbt-prototype.git then ran sbt: java -jar…
Rogach
  • 26,050
  • 21
  • 93
  • 172
1
vote
1 answer

Accessing Scalatra's isDevelopmentMode from outside the ScalatraServlet

I there a way to access the isDevelopmentMode value from outside the ScalatraServlet? It seems to come from the ScalatraKernel trait, so would including that be a feasible option? What I'm trying to achieve is to make the DI configuration know…
hleinone
  • 4,470
  • 4
  • 35
  • 49
1
vote
1 answer

Scalatra - not found: object scalate

Context: I'm looking to pick up Scalatra for the first time. I'm following instructions from Scalatra In Action as well as the sample code repo provided. I'm able to get a template project created using g8. When I update the code in the…
emalcolmb
  • 1,585
  • 4
  • 18
  • 43
1
vote
0 answers

Create a API with content type text/event-stream by Scalatra

I am creating an SSE simple example, I create an API with Scalatra and get responses by the interval with the header text/event-stream. It looks like Scalatra doesn't support this type. This is my simple code, get("/hello") { val headers =…
Wilson Ho
  • 372
  • 5
  • 18
1
vote
0 answers

Scalatra application with spark dependency returns java.lang.NoSuchFieldError: INSTANCE due to multiple httpclient versions

I'm trying to build an Scalatra application that runs code with spark. I can actually build the fat jar with sbt-assembly and the endpoints work, but when running tests with org.scalatra.test.scalatest._ I get the following error: *** RUN ABORTED…
Edgar
  • 256
  • 2
  • 12
1
vote
1 answer

Scalatra multiple routes for single action

Currently i am trying to refactor a API without breaking changes. trying to migrate it from something like host:port/foo/bar to host:port/barand im wondering if in Scalatra multiple routes are supported on a single action. I am trying it…
scigs
  • 529
  • 1
  • 5
  • 12
1
vote
1 answer

Logging to a file with Scalatra and Logback

I'm trying to configure a standalone Scalatra app to log to a file. I'm following the official manual and added this to build.sbt: "ch.qos.logback" % "logback-classic" % "1.2.3" % "runtime" I also added /src/main/resources/logback.xml with the…
Vladimir Mikhaylovskiy
  • 1,955
  • 4
  • 19
  • 28