• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Couple JSP Questions

 
Pam Doucette
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a good debugger or editor for jsps? It gets awfully tricky trying to sort out the java, HTML and javascript to correct errors.
On the same line, are there best practice guidelines for integrating these technologies cleanly so the jsp doesn't end up looking like spaghetti?
 
manav kher
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
several solution to your Mess :-)
I use Homesite and it does a good job of visually seperating the diff tags by using a diff color scheme for each technology.
Also javascript can be very cleanly seperated by putting all your script in a .js file and having just the script include tag in your jsp tag
<script src="myScript.js"></script>
(infact this should be standard practice even for HTML/JavaScript pages)
also, if your html is very long you can put it in a diff file and use a FileReader in the JSP and push the html to the client .
-manav
 
Pam Doucette
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your excellent suggestions. Wish me luck separating my spaghetti!
 
Dustin Marx
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spaghetti code you mention is exactly why I have been moving from JSPs containing everything to trying to keep only HTML and JSP tags in the JSP files and Java in JavaBeans or tag handler classes employed by the JSP.
The "Blueprints" program at http://java.sun.com lists best practices and architectural recommendations for J2EE, including JSPs ("Web Tier").
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic