File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Couple JSP Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Couple JSP Questions" Watch "Couple JSP Questions" New topic
Author

Couple JSP Questions

Pam Doucette
Greenhorn

Joined: Mar 13, 2001
Posts: 27
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

Joined: Nov 21, 2000
Posts: 98
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

Joined: Mar 13, 2001
Posts: 27
Thanks for your excellent suggestions. Wish me luck separating my spaghetti!
Dustin Marx
Ranch Hand

Joined: Mar 06, 2001
Posts: 40
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").
 
jQuery in Action, 2nd edition
 
subject: Couple JSP Questions