How to make Eclipse to format JSP code properly?

前端 未结 3 2134
栀梦
栀梦 2021-02-15 12:42

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 formatt

3条回答
  •  温柔的废话
    2021-02-15 13:26

    So what I found out was, that eclipse reformat's jsp files by methods not line by line. Only if it can reformat the entire method properly it will try. For example if you have this kind of code in the method.

    + message
        + "

    ");

    The refactor wont happen.

    You need to make it to

    + message
        + "

");

And now refactor will work. To this

+ message
+ "

");

提交回复
热议问题