This comes from me when I skip JSP / frameworks, write servlets in Scala with built-in xml for templates:
class MyServlet extends HttpServlet { def get(req) = { var title = "hello world" var link = "somepage" <html> <head><title>{ title }</title></head> <body><a href={ "/" + link }>Click</a></body> </html> } def doGet(req: HttpServletRequest, res: HttpServletResponse) = { val out = new PrintWriter(res.getOutputStream()) out.println(get(req)) out.close } }
My solution consists of two parts:
- Use
fsc instead of scalac - Use FireBug , in particular its
edit button.
The constant little changes that I find for myself are a stylesheet (which doesn't require a Jetty restart) or a game with possible HTML alternatives. The best way to do this is to right-click the HTML, click Inspect Element, then click the edit button in the firebug console and edit it in place. This means that you do not restore the state of the site every time you make changes.
When you look at it correctly, copy the changes to Scala and click make.
David Crawshaw
source share