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
3
votes
1 answer

Scalatrasuite tests always failing in sbt, succeeds when running test in IDE

I've been having a bit of an issue with ScalatraSuite unit testing with ScalaTest in sbt. Versions that I am using: Scalatra: 2.2.1 ScalaTest: 1.9.1 ScalatraScalatest: 2.2.1 Jetty: 9.0.2.v20130417 Scala: 2.10.1 SBT: 0.12.3 I had to extend…
cudiaco
  • 432
  • 1
  • 6
  • 21
3
votes
1 answer

Most lightweight webservice framework to mock external Webservice in Scala

I am trying to test a component which relies on an external webservice, which I access through Play WS library. This components receive the url of the webservice. I would like to unit test the component by getting it connected to a fake webservice.…
Edmondo
  • 19,559
  • 13
  • 62
  • 115
3
votes
1 answer

Scala app exceeds Heroku memory quota

I am hosting the backend for my mobile application on Heroku. It's written in Scala using Scalatra to expose the REST API. In addition to that, I'm running a worker that fetches data and pushes it to the database at MongoHQ (using casbah). For both…
Marco Lamina
  • 3,326
  • 4
  • 22
  • 22
3
votes
3 answers

Scalatra app on Openshift - setting Jetty IP

I'm trying to deploy a minimal Scalatra application on Openshift with DIY cartridge. I've managed to get SBT working, but when it comes to container:start, I get the error: FAILED SelectChannelConnector@0.0.0.0:8080: java.net.SocketException:…
Oleg Kunov
  • 179
  • 2
  • 12
3
votes
2 answers

scalatra 2.2.0 upgrade encountered NoClassDefFoundError:GenTraversableLike

I am trying to upgrade Scala/Scalatra versions in our project to the following: scala 2.10.1 scalatra (and scalatra-scalate, scalatra-scalatest) 2.2.0 using sbt 0.11.3 The code compiles OK but, when running the unit tests which uses scalatra…
3
votes
1 answer

JADE/SCALATE template error - InvalidSyntaxException

I'm trying out Jade (via Scalate) and am running into an error that I'm not finding an answer to. (Or, at least not seeing.) I mocked up a form using BlueGriffon (it's been years since I've coded HTML...) and placed the resultant HTML into Aarron…
mjk
  • 659
  • 1
  • 9
  • 20
3
votes
1 answer

spec2 tests failing for scalatra app with swagger support

When calling a prototypical spec3 test case on a scalatra app with swagger support, the tests fail. Here's the test/spec code: ServletSpec.scala class ServletSpec extends ScalatraSpec { def is = "Calling the generated swagger client" ^ …
drsquidop
  • 428
  • 4
  • 12
3
votes
1 answer

From Play! to Scalatra, templating headaches, directory structures

I'm trying to convert a Play! 2.0 application into a Scalatra application. I've had some success, but there are 3 issues remaining, 1 of which has its own ticket. 1) I understand that src/main/webapp/WEB-INF/views and src/main/webapp/WEB-INF/layouts…
user375566
3
votes
1 answer

Scalatra Servlet init() during test (Jetty ServletTester)

I am testing a Scalatra servlet that does some important initialization in its init(context: ServletContext) method. During tests (with ScalatraSuite) that init is not executed. How should I do my important initialization when I am testing? That…
derabbink
  • 2,419
  • 1
  • 22
  • 47
3
votes
1 answer

Is there a good way to deal with form submission in Scalatra

Right now I'm just using params function to get the data that has been posted to an URL. Is there any other way to deal with forms in Scalatra like in Play Framework? Does Scalatra support an object that can both be used to create a form and fill…
Athiwat Chunlakhan
  • 7,589
  • 14
  • 44
  • 72
2
votes
1 answer

CRUD operations using Scalatra and Casbah

I'm learning Scala and MongoDB and such am using Scalatra and Casbah as the framework for a simple web app. It is a simple message board, the intention to learn CRUD operations in Casbah. Problems is I'm finding that when I list the messages I have…
Michael Allen
  • 5,712
  • 3
  • 38
  • 63
2
votes
1 answer

Managing state with scalatra

I understand that Scalatra is a lightweight framework. However, I'm wondering if there are any tricks for managing small amounts of state. I have a form with a textarea and a few checkboxes. For example, suppose the textarea contains a math…
schmmd
  • 18,650
  • 16
  • 58
  • 102
2
votes
2 answers

How do I specify an HTML5 Doctype format in Scalate for Scaml?

I'm using Scalatra's built-in Scalate support but I want my default.scaml layout to render an HTML5 Doctype. The Scalate documentation states When the format option is set to :html5, !!! is always but I can't find anyone saying…
Cole Stanfield
  • 2,437
  • 2
  • 19
  • 12
2
votes
2 answers

How can I send a file to the browser using Scalatra?

I'm using the scalatra-sbt-prototype. What would I have to modify, and where , to be able to serve files from a directory on my filesystem? Say for example , I would want to serve the file first.tar.gz from /home/downloads/first.tar.gz, and have it…
Geo
  • 93,257
  • 117
  • 344
  • 520
2
votes
1 answer

Scalatra will not run on Windows

I have been working on a Scalatra project on a Linux environment and would now like to switch to a Windows environment. I've transferred the project folder to my Windows directory. Using Cygwyn, I cd to the Scalatra project and type ./sbt >…
hayfreed
  • 525
  • 7
  • 21