Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

I know that this question is for JSP, and not javascript, but this works pretty well all the same: http://jsbeautifier.org/

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

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

This seems to work fine for mine JSP and JS code (free at the momenti'm using it)

http://www.danstools.com/javascript-beautify/

Use this to format any HTML,JSP or any other language tag: https://www.freeformatter.com/html-formatter.htm

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top