JSP import statements using new import tag for each import

In version 5.0 when you do the Alt-Enter to add the import it looks like this:

<%@ page import="java.util.Enumeration"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.HashMap"%>

Is there some way to change that to the normal way of having it like this:

<%@ page import="java.util.Enumeration,
java.util.Map,
java.util.HashMap"%>

4 comments
Comment actions Permalink

There is a new setting in

Global Code Style->Imports->JSP imports layout-> Prefer one import statement per page directive (default on).

Change it to Prefer comma separated import list.

-Alex

0
Comment actions Permalink

But when import a new class,it does not start a new line and it looks like this:
<%@ page import="java.util.Enumeration,java.util.Map,java.util.HashMap"%>

Is there some way to change that to the normal way of having it like this:

<%@ page import="java.util.Enumeration,
java.util.Map,
java.util.HashMap"%>

0
Comment actions Permalink

Thanks, that's the answer!

0
Comment actions Permalink

You should file a Jira bug on that. They need to offer an option to control the formatting or just change it so each class is on a newline. I'm not sure anyone would like it how it is now.

I hadn't noticed this because I like the other format where you have page directive for each import statement.

There's definately some rough edges to the JSP language support. Hopefully 5.0.X will fix some of this!!

Another thing I wanted was for the import statements to be collapsed by default just like a java file.

0

Please sign in to leave a comment.