开发者

JSP pages in Eclipse do not indent?

I've read this article describing how to format jsp's in eclipse. I have WTP installed and the jsp ta开发者_C百科gs are colored. However, there is no indenation on the html (i.e. <html> and <body> etc. are all at the same level). I've tried Source -> Format with no success. Is this a bug?


  • make sure you open the jsps with the JSP editor (Right click > Open with)
  • open it and try CTRL + SHIFT + F
  • get a fresh installation of eclipse (don't delete the current one), and try it there


Same problem here Toy around with the formatter settings for html as this is used for jsp.

window > preferences > left tree pick web > editor. Then change the line width to maybe 180 Click "Split multiple attributes each on a new line" seems to do the trick


Sorry for writing soooo late, but I had the same problem, and I managed to solve It, and like me, maybe others don't know how.

Window -> Preferences -> left tree pick: General -> Editors -> Text Editors.

And change the "display the tab width" attribute to the desired value.

After this, "CTRL + SHIFT + F" should indent as expected for you.

This move was tested on Eclipse Helios. It may work for other versions as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜