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 not displaying views that match routes correctly

I'm getting started with scalatra and jade, but my views which match a route come wrapped in
 tags.
My project is setup like so:  
//ScalatraServlet.scala
def get("/index") {
  jade("index")
}

//WEB-INF/templates/views/index.jade
h1…
0
votes
2 answers

How to handle multiple async requests for a Mustache template on Scalatra

I have a simple web app running on Scalatra with Mustache templates. In order to render the page, I need to make three separate requests to web services. Is the Akka approach shown in Scalatra guides the way to go? Do I need to introduce chaining or…
Petteri H
  • 11,779
  • 12
  • 64
  • 94
0
votes
2 answers

Is Scalatra autoreload when the code changed?

Is scalatra (Scala server side framework) auto-refresh when one of our source code changed (just like PHP)? or if they are not, is there any Scala server side framework that able to do that (edit code, then test on the browser, without needing to…
Kokizzu
  • 24,974
  • 37
  • 137
  • 233
0
votes
1 answer

How to know the version of the local scalatra install?

I am using scalatra on ubuntu 13. However I am not sure if it is still the most up to date version. How to know the version of the local scalatra install?
Martin Meeser
  • 2,784
  • 2
  • 28
  • 41
0
votes
1 answer

Unable to get HTTP POST parameters in `params` in scalatra

I am running scalatra 2.2 using sbt version 0.13.0 and using its in-built server(jetty). I am running on kubuntu 13.10 64 bit and my java version 1.7.0_51. I am using OpenJDK 64-Bit. In my sample app i can get GET parameters through params but i…
lovesh
  • 5,235
  • 9
  • 62
  • 93
0
votes
1 answer

FileUploadSupport with ScalatraFilter?

I'm in the midst of adding file upload support to my Scalatra application, and I followed the official docs, but the approach doesn't seem to work for ScalatraFilters--only ScalatraServlets. For example, if I just generate a new Scalatra project,…
Katherine
  • 47
  • 1
  • 4
0
votes
1 answer

Json4s producing weird Json

This is what I have: (("foo" -> ("bar" -> 5) ~ ("bar2" -> 5)) ~ ("something" -> "else")) This is what I get: [ { "foo": { "bar": 5, "bar2": "5" }, "something": "else", } ] But this is what I'd like to get back: { …
goo
  • 2,230
  • 4
  • 32
  • 53
0
votes
2 answers

how to make the connection between sclate,the servlet and classes

I'm new with the architecture of scalatra and devloppement scala .. i want to do a project with these new technilogies with templates but the problem that I can not understand how to realize the connection between the class or object, the servlet…
yotta
  • 35
  • 4
0
votes
1 answer

Checking attachments in the request

I am developing file upload web app in Scalatra. In my use case i want to check if the submitted request contains attachment or not. Below is my code : val (profilePicByteStream: Array[Byte], contentType:String, fileName) =…
Rajeev
  • 4,762
  • 8
  • 41
  • 63
0
votes
1 answer

How can I use params in a before filter in Scalatra?

I have a global filter that I would like to implement in my scalatra based API. For the sake of simplicity, I want ANY API call that has a variable foo with a value bar to throw a 403. I started this problem with an inheritance chain. class…
Victor 'Chris' Cabral
  • 2,135
  • 1
  • 16
  • 33
0
votes
1 answer

Losing type information due to erause, JSON serialization with Jackson/Scalatra

I am attempting to make a generalized serializer for my ADT datatypes which follow the following structured type /** * Our standard ADT representation, indexed by ID. ADT's also have a formattedString (formal name representing ADT) */ type…
mdedetrich
  • 1,899
  • 1
  • 18
  • 29
0
votes
2 answers

Scalate HTML minification via ScamlOptions.indent and ScamlOptions.nl

In Scalate manual for Scaml and Jade it's stated that there two options ScamlOptions.nl and ScamlOptions.indent that can be used to minify outputted HTML. What is also stated is "You will need to configure these before any of your scaml templates…
vania-pooh
  • 2,933
  • 4
  • 24
  • 42
0
votes
1 answer

scalatra issue when running ./sbt: sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;2.1.1: not found

I tried adding eclipse support to my project by running ./sbt eclipse after adding addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.1") to project/plugins.sbt. I get this error message [error] (*:update) sbt.ResolveException:…
Andre
  • 790
  • 2
  • 9
  • 23
0
votes
1 answer

Scalatra GZipSupport when using FutureSupport

I have a ScalatraServlet as follows: class MyServlet extends ScalatraServlet with FutureSupport with GZipSupport with JacksonJsonSupport { .. } When running, I get: java.lang.IllegalStateException: STREAM I've also tried adding a jetty filter as…
0
votes
0 answers

How can I configure Scalatra (sbt) to find the webapp folder in a different source folder than "main"

By default, Scalatra expects the "webapp" directory to be at src/main/webapp. How could that be changed to src/web/webapp? In my application, I would like to have the following folder structure: src web scala resource …