forked from stoerr/GrokConstructor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeb-Framework.txt
19 lines (14 loc) · 1.13 KB
/
Web-Framework.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Since IntelliJ Community Edition does not have a web framework plugin for scala at the moment and
I don't currently know either Play nor Lift and both seem to be annoying without a plugin, I decide
to roll my own mini-framework for now.
Basic idea: The interesting parts of the page are done in Scala classes with its XML mode,
since then I have code completion for that. (OTOH, if you don't know all details of HTML by heart, a
HTML completion is very valuable as well. But I can't have both right now.)
This approach also allows for massively DRY code.
There is a JSP for the frame of the page. It takes various parts from to-Stringable request attributes.
Everything is stateless here - both to conserve server resources and to allow opening multiple windows.
Thus, everything needed is transmitted in hidden fields.
Error handling:
Uncaught exceptions will display a generic error page in WebDispatcher with request info, a stacktrace and all.
Common errors during processing are caught in the processing methods (e.g. MatcherEntryView.showResult), but
that's difficult if the exception is created in the constructor / variable initializations.