This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Couple JSP Questions" Watch "Couple JSP Questions" New topic

Couple JSP Questions

Pam Doucette

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 .
Pam Doucette

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 lists best practices and architectural recommendations for J2EE, including JSPs ("Web Tier").
I agree. Here's the link:
subject: Couple JSP Questions
It's not a secret anymore!