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

scalatra squeryl select where parameter type missing

I am a Scalatra beginner and I have the following route: get("/todos") { contentType = formats("json") val userid : Int = params.getOrElse("userid", halt(400)).toInt val limit : Int = params.getOrElse("limit", "0").toInt val…
viplezer
  • 5,519
  • 1
  • 18
  • 25
0
votes
1 answer

Scalatra, Atmosphere, and Receiving Multiple Messages

I am just playing with Scalatra and Akka like the guide suggests http://www.scalatra.org/guides/async/atmosphere.html. I've modified the guid so that I'm passing an actor system into the Atmosphere client. However, I would like to know how I can get…
user2668128
  • 39,482
  • 8
  • 27
  • 34
0
votes
1 answer

Scalatra shutting down system - "No Such Method Error"

I have some code in Scalatra using Atmosphere framework that keeps causing the system to crash after a web request is made. The console shows the data being sent from server to client, but straight after it the following error always…
user2668128
  • 39,482
  • 8
  • 27
  • 34
0
votes
1 answer

Scalatra cannot find view when deploying as stand-alone

I'm using the scalatra documentation and the sbt-assembly plugin to create a stand-alone jar. It works on my local machine (Debian Wheezy with OpenJdk 1.7.0), but fails on the remote EC2 machine (Ubuntu 12.04.2 LTS) running the same Jdk. The…
user2668128
  • 39,482
  • 8
  • 27
  • 34
0
votes
1 answer

Optimal way to read out JSON from MongoDB into a Scalatra API

I have a pre-formatted JSON blob stored as a string in MongoDB as a field in one of collections. Currently in my Scalatra based API, I have a before filter that renders all of my responses with a JSON content type. An example of how I return the…
randombits
  • 47,058
  • 76
  • 251
  • 433
0
votes
2 answers

Using Casbah in Scala/Scalatra to query for a document

I am slightly confused on how to retrieve an individual document from MongoDB using Casbah in my Scalatra project. Currently, I have some code that hypothetically looks like the following: get ("/dogs") { val collar_id =…
randombits
  • 47,058
  • 76
  • 251
  • 433
0
votes
1 answer

scalate scalatra NoValueSetException with jade

I'm using Scalatra with Scalate and Jade. When ever I try to apply a template that takes values the values are not being applied to the template and I'm getting a NoValueSetException... Here is the code I have: // --------- In PostsServlet…
tantalum
  • 2,354
  • 1
  • 15
  • 22
0
votes
1 answer

No params in route for ajax post

When I post data to a Scalatra route, no params are seen. On the client: $.ajax({ type: 'POST', url: window.location.origin + '/move', contentType: 'application/octet-stream; charset=utf-8', data: {gameId: 1, from:…
Synesso
  • 37,610
  • 35
  • 136
  • 207
0
votes
1 answer

ssp files (Scalatra) Auto Indentation not working in Intellij

I am writing scala and ssp files in Intellij, i want Intellij to auto-Indent my code. While it is working for scala files but it doesn't work for ssp files. Is there any way we can configure IntelliJ to auto-indent these files also. or is there any…
Amol Sharma
  • 1,521
  • 7
  • 20
  • 40
0
votes
2 answers

Scala and akka lifecycle.. again

So this question is related to an old one of mine: Do I need to re-use the same Akka ActorSystem or can I just create one every time I need one? I asked a question about the lifecycle of actors, and I knew something was wrong in my mind, but…
Owen
  • 6,992
  • 7
  • 44
  • 77
0
votes
1 answer

Slick table Query: Trouble with recognizing values

Can anyone tell me why in this case: Query(Users) foreach {case (userId, userName) => println(userId + ", " + userName) } Scala recognizes userId, but in this case: val l = List[(Int, String)]() Query(Users) foreach { case (userId,…
Alex Spangher
  • 977
  • 2
  • 13
  • 22
0
votes
2 answers

How to get None Option from salatDAO when mongodb gives error

import com.escalatesoft.subcut.inject._ import com.mongodb.casbah.Imports._ import com.novus.salat._ import com.novus.salat.global._ import com.novus.salat.dao._ case class User(_id: ObjectId = new ObjectId, email: String, password: String) class…
whitehead1415
  • 435
  • 4
  • 14
0
votes
0 answers

Scala eclipse IDE not recognizing package import statements

I'm trying to build a simple chat scalatra file as an exercise, and was having some frustrating packaging problems. (I'm using Eclipse Indigo's Scala IDE) This is my file hierarchy: ScalaChat (project…
Alex Spangher
  • 977
  • 2
  • 13
  • 22
0
votes
1 answer

Search Scala symbol documentation such as %% and %

Not entirely sure how to query for a search on %% and % which I see being used in Scalatra. Trying to understand what significance these symbols have in Scala. Is there a tool out there where I can put in the symbol and it'll pull up the appropriate…
randombits
  • 47,058
  • 76
  • 251
  • 433
0
votes
0 answers

Scalatra serializes object to JSON, but its relation is not serialized

I'm using Scalatra and Squeryl to make a Single Page Application example, so I need my Scalatra Servlet always returning JSON. It's working perfectly when serializing an object with no relations. I have a class Address that has a ManyToOne…
Juliano Alves
  • 2,006
  • 4
  • 35
  • 37
1 2 3
20
21