News for hackers. Stuff that matters.
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.

Re:Ask HN: Why are there so few apps being built with JSP? by kp212 on Wednesday July 21, 2010 @03:13PM (#1536202)
Yeah you are right, lets just forget using jsp without the framework model.