Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Eclipse to format JSP code properly?

I use code formatting command (Ctrl + Shift + F) a lot in Eclipse IDE. While this works pretty well for Java / CSS source codes, the JSP formatting is just sucks.

Is there any plug-in available to make the JSP formatting better in Eclipse IDE? By formatting I mean proper indenting of JSP/HTML tags.

like image 938
Veera Avatar asked Aug 12 '10 15:08

Veera


People also ask

How can I get beautify code in Eclipse?

Go to Source | Format Document or press Ctrl+Shift+F.

How do I indent a JSP in Eclipse?

Preferences -> Jsp -> Editor -> HTML Editor -> Indent using tabs. All lines start from column 1 after doing source-> format! automatically too.

Does Eclipse support JSP files?

Eclipse Enterprise Java and Web Developer Tools Enables Enterprise Java Bean, Java Enterprise Application, Fragments, and Connector, Java Web Application, JavaServer Faces (JSF), Java Server Pages (JSP), Java Servlet, Java Web Services, and Tag ...

How do I fix indentation in Eclipse?

You can use Ctrl + A to select the entire file, then use this shortcut to quickly fix all the indentation. You can also change how Eclipse handles indentation by going to Window > Preferences, then in the left panel, navigate to Java > Code Style > Formatter > Edit... > Indentation.


1 Answers

A quick search with Google turns up this part of MyEclipse Enterprise Workbench.

But a quick, if obvious, question: do you have the J2EE tools installed?

like image 195
Borealid Avatar answered Sep 19 '22 14:09

Borealid