Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Request for Code Review  RSS feed

 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I wondered if anyone could do a code review. I inherited this application and wanted to know from an expert opinion what may be wrong with the existing code. I noticed the JQuery was very very old, so old it is no longer referenced on the JQuery site when you search for it. However, I wondered if there was a better way to structure this page.



Thanks, Michele
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there's a much better way to structure it: move all the Java code to a servlet, or a Java class, and only use the JSP for rendering he output. That is what JSPs should be used (which are, after all, just the "V" in "MVC").
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never got past the two first characters. "<%" means that scriptlets are in use in the page. Java scriptlets in a page has been obsolete and discredited for 13 years. now. They should never be used in a modern JSP page. Using such cranky and discredited technology in 2014 is just downright irresponsible.

Please read this article for a discussion of how to properly structure modern Java web applications.
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! I went to the journal and had a really good look and appreciate your suggestions! -- Thanks again, Michele
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!