scalate

scaml “illegal nesting” error

隐身守侯 提交于 2019-12-24 00:30:04
问题 Hi I'm a total Noob at scalate/scaml (I tagged haml since scaml & haml are similar). I have some template that looks like this: -@ var customer : com.x.model.Customer !!! %html %body %p Contact: %a{:href => 'mailto:#{customer.email}'}=customer.contact The %p line is flagged with this error: org.fusesource.scalate.InvalidSyntaxException: Illegal nesting: content can't be given on the same line as html element or nested within it if the tag is closed at 16.17 回答1: In HAML, you can't provide

scala, spring, and scalate

懵懂的女人 提交于 2019-12-10 19:54:40
问题 I have a web project written in scala, spring, sitemesh, and jspx/jstl. The problem is with the jspx. I keep running into issues where it wants the types to be java collection types and so I have to keep converting between scala/java collections. And sometimes I forget, and my view blows up, etc. I'm wondering if there's a blog post out there somewhere that describes how/what's involved to migrate from jsp/jstl/jspx to scalate? Because otherwise it just seems a bit overwhelming to switch, no

Integrating Scalate into Play 2.0

北城以北 提交于 2019-12-08 07:14:44
问题 A feature of the Play 2.0 framework I appreciate is statically compiled views . If a controller renders a view without supplying the correct number of well-typed arguments, a compile error is thrown. This greatly increases maintainability as controller<>view discrepancies don't have to be tested by running the application but appear at compile time instead. However, the standard Play 2.0 view templates use plain HTML combined with Scala as a language. I want to use Scalate so I can combine

Servlet link relative to application base

早过忘川 提交于 2019-11-29 23:13:14
问题 I am writing a servlet (specifically with Scalatra). In the servlet I have many links on a table of contents which is included with every page. I want these links to be relative to the application base. If I use links such as "/foo", everything works fine when the servlet is served from the root (localhost:8080/) but if I serve it from Jetty/Tomcat along with other servlets (localhost:8080/servlet) the link points outside of the servlet. What is a good fix for this problem? 回答1: You need to