Re:Ask HN: Why are there so few apps being built with JSP?
by kp212 on Wednesday July 21, 2010 @02:01PM
(#1535945)
You can do that with a JSP page, and Tomcat. You can use JSP very much like a scripting language (no need to hit a servlet, controller, etc), but obviously it can get a little messy to manage depending how large of app you write.
[ Parent
| on HN ]
Re:Ask HN: Why are there so few apps being built with JSP?
by tomh on Wednesday July 21, 2010 @03:07PM
(#1536182)
One big problem; if you keep most of the Java code on the servlet side and you throw an exception, the stack trace will give you the line number of the offending code.
OTOH, if you do all that heavy lifting in the JSP side, depending on your choice of server, you get a stack trace...either without a line number, or with a line number of the JSP which was compiled and turned into a Java program on the fly.
And we all know what machine-generated Java looks like, right? Like a big plate of pain with some extra pain on top. Good luck bug-hunting that one.
Re:Ask HN: Why are there so few apps being built with JSP?
by eccp on Thursday July 22, 2010 @04:36PM
(#1539475)
Not entirely true. On Tomcat 5 and 6, the resulting code is really close to the original, plus lots of out.write().
If the logs show an exception on org.apache.jsp.mypage_jsp._jspService(mypage_jsp.java:NNNN), you can find the generated Java class on TOMCAT_HOME/work/Catalina/localhost/myapp and it's rather straightforward from there.
I do this on a daily basis to maintain a legacy app. Not sexy but, not hard either.