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
0
votes
2 answers

value OK is not a member of String (using Dispatch and Scalatra)

I am trying a simple example where I am using a modification of the Dispatch example from the Scalatra site to make an async http request. The code is below. I get a compilation error that says value OK is not a member of String. I put together a…
VDev
  • 2,287
  • 5
  • 25
  • 27
0
votes
2 answers

How to specify a jetty.xml config file for xsbt-web-plugin

I have a project that uses the xsbt-web-plugin but I want to be able to customise the jetty settings. Is there a way I can specify my own jetty.xml file? I found the PluginKeys.configurationFiles setting and set that to the desired file but it…
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
1 answer

Spec2 :how to see failing test stacktrace and resolve "parseBody" keyword not found

I need to know two things here : 1. How to see the stacktrace of the failing test case? Right now I only see the line number it failed and the result. See the outcome of the test case below : x return status 200 [error] '404' is not equal to…
Amit Jain
  • 1,372
  • 8
  • 16
0
votes
1 answer

Defining resource base for scalatra with embedded Jetty

I have a scalatra based app with embedded jetty. My final output structure is /lib /bin /etc and webapp is located under etc. When launching the webapp there is the line which sets the resourceBase - what is this supposed to be set to in this…
LK__
  • 6,515
  • 5
  • 34
  • 53
0
votes
0 answers

Define main servlet for scalatra/jetty at build/runtime

I have a scalatra server with Jetty embedded and the initialization code for the two is listed below, where HelloServlet is the main servlet to be loaded. Is there a way I can set this servlet at build or runtime? I prefer not to use XMLs for…
LK__
  • 6,515
  • 5
  • 34
  • 53
0
votes
1 answer

Scalatra: Migrating Jersey Filters to Scalatra

I'm starting to dig into Scalatra but I have some extensive experience in Jersey. One of the things I'm struggling with is how to get multiple filters for a controller in Scalatra? For example, I have three unique filters: CSRF XSS…
John S
  • 1,695
  • 2
  • 14
  • 25
0
votes
1 answer

Distributable zip webserver

I have a webserver written in Scala using scalatra (embedded jetty) and building with Gradle. I am trying to create a distributable which will contain the structure bin/lib/etc. The code below creates what I want when run gradle distZip but I am…
LK__
  • 6,515
  • 5
  • 34
  • 53
0
votes
1 answer

Storing and sharing a cookie for service access in Scala

I have a Scalatra 2.3 application and it uses Dispatch to contact a legacy service for some data. Some of the API calls are using cookie based auth. I would like to avoid doing login separately for every request to those secure endpoints. My first…
Petteri H
  • 11,779
  • 12
  • 64
  • 94
0
votes
1 answer

Scalatra file organisation

How should I manage my files in Scalatra . After encountering the following error my fundamental understanding of "code separation" in Scala has been destroyed . Working in Scalatra I defined an class in one file and received an in an error after…
0
votes
1 answer

scalatra < squeryl < select ALL | Always

I want to read elements from the database and return them as JSON objects. Scalatra is set up to return JSON. Databaseschema is created. Players are added. The following code seems to be the main problem: get("/") { inTransaction { …
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
0
votes
1 answer

How to use a properties file with ScalatraBootStrap?

I'm trying to use a properties file not included in the app but specify it as a Java option during invocation. something like java -Dconfig.file=run.properties -jar app.jar I am looking for suggestions on how can I send that property to…
0
votes
0 answers

xsbt plugin 1.0.0-M7 and scalatra

I have tried upgrading the xsbt plugin to 1.0.0-M7 in my scalatra project but scalatra does not seem to be compatible with this version. When I try to reload my project I get the error below. I have tried with version 2.3.0 of…
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
1 answer

Can't compile Scalatra 2.2.2 with Scala 2.9.1

I'm getting bunch of warnings like these: [warn] module not found: org.scalatra#scalatra_2.9.1;2.2.2 [warn] ==== local: tried [warn] /Users/newuser/.ivy2/local/org.scalatra/scalatra_2.9.1/2.2.2/ivys/ivy.xml [warn] ==== public: tried And finally…
Tutankhamen
  • 3,532
  • 1
  • 30
  • 38
0
votes
2 answers

Why does Scalatra give me a FlashMap casting error sometimes?

When running Scalatra in code reload mode, if I load the page before the scalate engine has reinitialized I get a 500 error. If I watch the terminal until it looks like the engine has fully reloaded, it works fine, but I think this happens when I…
Matthew Rathbone
  • 8,144
  • 7
  • 49
  • 79
0
votes
1 answer

How to stop assembled Scalatra application?

I have an app that is assembled via sbt and launched like this: java -jar target/scala-2.10/evcat-assembly-0.0.1.jar I can stop the process by hitting Ctrl-C, but I don't know whether that initiates a normal shutdown process or not. I'm wondering…
tkroman
  • 4,811
  • 1
  • 26
  • 46