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
1
vote
0 answers

Custom asType[T] for a type T with Scalatra commands

Our database (which uses slick datamapper pattern, so our models are simple case classes which is ideal for commands) has many ADT's as fields (i.e. abstract sealed class with many case classes/case objects as children), and the idea is that our…
mdedetrich
  • 1,899
  • 1
  • 18
  • 29
1
vote
2 answers

Type issue with Scala when dealing with timestamps

Straight forward problem that I don't see what I'm doing wrong in - some type mismatch somewhere. Basically trying to set a default datatype of Long on parameters that are coming in from a web request. Here's the code: val startTs:Long =…
randombits
  • 47,058
  • 76
  • 251
  • 433
1
vote
2 answers

Creating a case class for an embedded MongoDB Array with Salat and Scala

I am trying to figure out how to properly serialize a document from MongoDB in my Scala project. The problem I have here is I'm not sure what to do when I have an Array field in my document and how to treat it in Scala. Here's what the document…
randombits
  • 47,058
  • 76
  • 251
  • 433
1
vote
2 answers

java.lang.NoSuchMethodError in Scalatra using Scalate with Markdown

So I have a Scalatra app (using Scalatra 2.2.1). I'm building views using Scalate; I've decided to go with the Jade/Markdown one-two. Only one problem: if I try to use markdown in a jade template (started with the :markdown tag), I get…
Gastove
  • 896
  • 2
  • 10
  • 21
1
vote
1 answer

Slick Scala not inserting any values

Sort of a slick n00b...I'm trying to build an insert statement, but find I am not inserting anything. def newUser(userName: String, email: Option[String], password: String = null, removed: Option[Int] = null) = SlickInit.dbMaster withSession { …
Alex Spangher
  • 977
  • 2
  • 13
  • 22
1
vote
2 answers

Slick: Difficulties working with Column[Int] values

I have a followup to another Slick question I recently asked (Slick table Query: Trouble with recognizing values) here. Please bear with me!! I'm new to databasing and Slick seems especially poor on documentation. Anyway, I have this table: object…
Alex Spangher
  • 977
  • 2
  • 13
  • 22
1
vote
2 answers

Why is it possible to write HTML inside Scalatra?

Take the following example : package com.example.app import org.scalatra._ import scalate.ScalateSupport class MyServlet extends ScalatraServlet with ScalateSupport { get("/") {

Hello, world!

Taleb Elem
  • 119
  • 1
  • 6
1
vote
1 answer

Scalatra Commands and Validating Nested objects

I'm new to both Scala and Scalatra. I'm just wondering, but how do you use Scalatra commands to validate a nested object, such as images below as part of the validation of the overall object? { "id" : 1, "name" : "First item", "images": [ {…
John Polling
  • 2,272
  • 2
  • 21
  • 21
1
vote
1 answer

Scala unary operator usage in this example

I am reading a tutorial via the following URL: http://www.smartjava.org/content/tutorial-getting-started-scala-and-scalatra-part-iii Here's a snippet of code: class BidRepository extends RepositoryBase { object BidMapping extends…
randombits
  • 47,058
  • 76
  • 251
  • 433
1
vote
1 answer

Deploy Scalatra on Heroku error

I followed the guide of deploying a Scalatra app on Heroku and I get the following error: [error] Not a valid command: stage (similar: last-grep, set, last) [error] Expected '/' [error] Expected ':' [error] Not a valid key:…
Radu Stoenescu
  • 3,187
  • 9
  • 28
  • 45
1
vote
1 answer

Is it possible to use scalatra's unquoted HTML literal string syntax in sinatra?

I would like to use this style in sinatra: get("/") {

Hello, world!

Say hello to Scalate. …
David Watson
  • 3,394
  • 2
  • 36
  • 51
1
vote
1 answer

Scalatra JSON guide code not compiling

I copied the instructions on the JSON formatting Guide found here: http://www.scalatra.org/2.2/guides/formats/json.html Below is MyScalatraServlet.scala file with all of the code I embedded to test out JSON formatting: package…
randombits
  • 47,058
  • 76
  • 251
  • 433
1
vote
2 answers

Scala: how to use google/facebook credentials to provide access control for my application via openID on Heroku

I'm writing a hobby project with Scala on Heroku. Currently I have my own authentication mechanism which uses http basic auth. I'd like to be able to use people's existing credentials from e.g. google or facebook instead. I know that for Ruby…
auramo
  • 13,167
  • 13
  • 66
  • 88
1
vote
2 answers

Value not set error in Scalate/Jade

I am new to Jade and Scalate. I have the following route defined: get("/") { jade("index", "pageTitle" -> "Welcome to Jade", "welcomeMessage" -> "Hello my pretties") } And the template: -@ val pageTitle: String -@ val welcomeMessage:…
Synesso
  • 37,610
  • 35
  • 136
  • 207
1
vote
2 answers

Scalatra Databinding

I'm playing with command model binding and I looked at the example github project and I have issues when using the dependency: "org.scalatra" % "scalatra-data-binding" % "2.2.0-RC1" Taking the example project code i.e. abstract class…
Owen
  • 6,992
  • 7
  • 44
  • 77