views:

519

answers:

3

So I am working on a jsp/servlet that came to me and I'm looking at the jsp file and it is just a jungle of jstl tags, java code and html thrown together. At first it looked like someone ran the standard eclipse formatter on it and had the page width set to 40 so alot of stuff is broken up, I tried to format it with a larger page width but that seemed to make it worse to the point of not being able to tell what is going on without formatting parts of it first.

Anyone have any luck with any jsp/code formatter?

A: 

Try maybe IntelliJ IDEA. I can't guarantee it will do the job better but it won't hurt to try.

Ray
A: 

Netbeans does a decent job at formatting my jsp code. You could download Netbeans 6.5.1 and format the files in there.

Kevin Crowell
+1  A: 

Are you using Eclipse WTP plugin? If not, take a look at it - it has quite a few ways to customize formatting of JSP.

If you are, JSP formatting can be customized under Window -> Preferences; Web -> JSP Files -> Editor; note that there are two separate links there - for XML and HTML JSP.

ChssPly76
Didn't know you could do that in eclipse. This mostly worked for me, it didn't get it perfect or the way I really would have liked it, but at the very least it is managable now. Maybe if i tinker with it more I"ll get it. Thanks.