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 with HTTPS?

I have a tiny project based on the template from official Scalatra tutorial. I read it's possible to setup jetty to support HTTPS, but I have no idea how to do that. Is it possible to enable HTTPS support in Scalatra (jetty) without other standalone…
menfon
  • 1,587
  • 1
  • 11
  • 28
0
votes
1 answer

File upload, declaration via apiOperation (Swagger and Scalatra 2.6)

There is an existing project that uses Scalatra (2.6) and Swagger: scalaMajorVersion = '2.12' scalaVersion = "${scalaMajorVersion}.8" scalatraVersion = "${scalaMajorVersion}:2.6.4" compile "org.scalatra:scalatra-swagger_${scalatraVersion}" I…
18446744073709551615
  • 16,368
  • 4
  • 94
  • 127
0
votes
1 answer

How to serve an image with Scalatra

Is any version of Scalatra capable of serving images with the correct Content-Type header? I can't seem to suppress the automatic addition of charset. Example of returning a File: class MyServlet extends org.scalatra.ScalatraServlet { get("/") { …
earldouglas
  • 13,265
  • 5
  • 41
  • 50
0
votes
1 answer

"org.fusesource.scalate.TemplateException: loader constraint violation" when using SBTs embedded Jetty and scalatra/scalate

I started getting this error yesterday when using the embedded 'jetty-run' task in SBT. I reverted my code to a previous version and it's still happening. Note that I packaged up the application and deployed it in an actual jetty instance and I…
codefly
  • 640
  • 1
  • 5
  • 8
0
votes
0 answers

Scalatra SwaggerSupport NPEs on simple case class?

I'm following the Scalatra Swagger Guide (http://scalatra.org//guides/2.6/swagger.html) but can't get the same results in my own code. Somehow the SwaggerSupport can't deal with my case class. import org.scalatra._ import…
Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
0
votes
0 answers

Add an example Json in the request body in Swagger dashboard using Scalatra

I need to add an example Json in the request body in my Swagger dashboard, so that user can just change the required attributes value and make a POST cal using "Try it out" button in Swagger dashboard. Everything else is working fine.Using…
Ani
  • 123
  • 1
  • 1
  • 14
0
votes
1 answer

Scalatra - change port for standalone server

I am developing a Scalatra application and require the port to be different than the default port 8080. I added the following to the end of my build.sbt: containerPort in Jetty := 8089 This works great when I am starting the Jetty server within the…
hayfreed
  • 525
  • 7
  • 21
0
votes
1 answer

What is the most succinct way to redirect HTTP requests to HTTPS in Scalatra?

I have a service written in Scala with Scalatra and running on AWS ECS listening through an AWS ELB. I have ELB configured as a TLS terminator: HTTPS traffic on port 443 and HTTP traffic on port 80 are routed to the service listening on port 8080 on…
Colin Dean
  • 1,429
  • 1
  • 15
  • 26
0
votes
0 answers

Scalatra responseStatus

I'm new in scalatra, so how does responseStatus(...) works? I mean, if I have a request get("/..."){ ... } and into this get I'll have: ... 100 -> "Continue", ... What will be with this "continue" status? If question is incorrect, please…
0
votes
0 answers

Cant get json4s data extraction to work

Im working on a project that has scala backend and scalatra as a servlet. For now, the backend is running inside a Vagrant box, and sbt is used to build the program. My problem is that I need to handle incoming Json-formatted data, but I cant…
0
votes
0 answers

How to overcome Scalatra initialization issue: NoSuchMethodError: javax.servlet.ServletContext.getFilterRegistration?

This is my first time using Scalatra, and I'm using it outside of SBT (building and running using mill). I get the following error which seems to be about a missing dependency. 2018.05.23 18:26:30 [main] INFO org.scalatra.servlet.ScalatraListener -…
bbarker
  • 11,636
  • 9
  • 38
  • 62
0
votes
1 answer

unable to run web-app developed using scalatra scala

I have developed a web app using scalatra 2.6.3 and scala 2.11.8 for the first time and it is not getting executed using jar. Below are my dependencies in build.sbt scalaVersion := "2.11.8" val scalatraVersion = "2.6.3" dependencyOverrides +=…
Monika
  • 143
  • 2
  • 3
  • 11
0
votes
1 answer

How can I supply a cookie in a Scalatra test request?

I have a Scalatra controller method that reads and sets some cookies. It looks something like this: get("/cookietest") { cookies.get("testcookie") match { case Some(value) => cookies.update("testcookie",s"pong:$value") …
Colin Dean
  • 1,429
  • 1
  • 15
  • 26
0
votes
1 answer

How can I log a warning when I "halt()" in Scalatra?

In my Scalatra routes, I often use halt() to fail fast: val user: User = userRepository.getUserById(params("userId")) .getOrElse { logger.warn(s"Unknown user: $userId") halt(404, s"Unknown user: $userId") } As shown in the…
Etienne Neveu
  • 12,604
  • 9
  • 36
  • 59
0
votes
1 answer

Scalatra livereload when changing static files such as *.js or *.css in the webapp dir

So after running the command recommended in Scalatras guides, at root dir: $ sbt > ~;jetty:stop;jetty:start I get jetty to reload changes when I make changes in scala files, but if I make changes in js or css I must end jetty and relaunch the same…
CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186