简体   繁体   中英

Formatting rules of JSP in Eclipse

Eclipse has a huge number of formatting rules for Java and Javascripting, which can be reached via "code-style" option under java and javascript. I couldn't find any JSP settings for formatting rules. Is there any?

I could find a few basic setting in Web->JSP Files->Editor which redirects to Web->Html->Editor and Web->XML->Editor. This options include splitting attributes, clean blank lines, whitespace padding and indentation style (tabs/spaces). I can confirm that the XML settings are used when formatting JSP pages. HTML editor is used only for the length of line.

Also, how do I export these settings? Are they exported via File->Export->General-Preferences?

The xml formatting configuration IS exported through File->Export->General-Preferences. Just made a test comparing the exported file before and after changing the indentation size an char, and the following settings were changed in the exported file:

/instance/org.eclipse.wst.xml.core/indentationSize=2 /instance/org.eclipse.wst.xml.core/indentationChar=space

Also the html formatting is exported, here is the setting changed when I modified the line width for html:

/instance/org.eclipse.wst.html.core/lineWidth=132

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM