Duplicate attribute import (multiple page import directive)

I have more JSP file that contain page import directive like this:

<%@ page
import = "javax.naming.*"
import = "javax.ejb.*"
import = "java.util.*"
import = "java.math.BigInteger"
import = "java.security.*"
%>
<%!

// skipped

%>

Since IDEA 5.0 that format of page import direcitive can't be correctly recognized. IDEA says "Duplicate attribute import"

But under specification JSP it is valid format. And it is successfully validated and compiled by JBoss and WebLogic app-servers.

IDEA 4.5 work fine with this format.

This bag or feature?

P.S.
Bug report here:
http://www.jetbrains.net/jira/browse/IDEA-7818

<%@ page
import = "javax.naming.*"
import = "javax.ejb.*"
import = "java.util.*"
import = "java.math.BigInteger"
import = "java.security.*"
%>
<%!

// skipped

%>

Since IDEA 5.0 that format of page import direcitive can't be correctly recognized. IDEA says "Duplicate attribute import"

But under specification JSP it is valid format. And it is successfully validated and compiled by JBoss and WebLogic app-servers.

IDEA 4.5 work fine with this format.

7 comments
Comment actions Permalink

From JSP 2.0 spec
JSP.1.10.1 The page Directive
...
There shall be only one occurrence of any attribute/
value pair defined by this directive in a given translation unit, unless
the values for
the duplicate attributes are identical for all occurrences.

Vitaliy wrote:

I have more JSP file that contain page import directive like this:

<%@ page
import = "javax.naming.*"
import = "javax.ejb.*"
import = "java.util.*"
import = "java.math.BigInteger"
import = "java.security.*"
%>
<%!

// skipped

%>

Since IDEA 5.0 that format of page import direcitive can't be correctly recognized. IDEA says "Duplicate attribute import"

But under specification JSP it is valid format. And it is successfully validated and compiled by JBoss and WebLogic app-servers.

IDEA 4.5 work fine with this format.

This bag or feature?

P.S.
Bug report here:
http://www.jetbrains.net/jira/browse/IDEA-7818

<%@ page
import = "javax.naming.*"
import = "javax.ejb.*"
import = "java.util.*"
import = "java.math.BigInteger"
import = "java.security.*"
%>
<%!

// skipped

%>

Since IDEA 5.0 that format of page import direcitive can't be correctly recognized. IDEA says "Duplicate attribute import"

But under specification JSP it is valid format. And it is successfully validated and compiled by JBoss and WebLogic app-servers.

IDEA 4.5 work fine with this format.



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Hello, Maxim.

Thank you fro your reply!

I read spec too :)

Continuation of you quote:
--- cut --
*The import and pageEncoding attributes are exempt from this rule and
can appear multiple times. Multiple uses of the import attribute are
cumulative (with ordered set union semantics).*
--- cut --
(the same JSP 2.0)

What can you say about it?

0
Comment actions Permalink

Ok, there is no chance to support such semantic in nearest release (IDEA
6) because we are bound to quoted statement:)

Vitaliy wrote:

Hello, Maxim.

Thank you fro your reply!

I read spec too :)

Continuation of you quote:
--- cut --
*The import and pageEncoding attributes are exempt from this rule and
can appear multiple times. Multiple uses of the import attribute are
cumulative (with ordered set union semantics).*
--- cut --
(the same JSP 2.0)

What can you say about it?



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

:)

And when it will be fixed? (In what release)

0
Comment actions Permalink

IDEA will not complaint about 'duplicate attribute import' in IDEA 6
(from next EAP build) but complete such case support (optimize import,
highlighter, etc) will require more work (and other JIRA items)

Vitaliy wrote:

:)

And when it will be fixed? (In what release)



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

I have a problem related to this behavior in IDEA (running 6.02). I'm on a project with a large number of JSP files, a large portion of which use this import syntax. As IDEA does not recognize the imports, it believes that every class referenced in the JSP has not been imported, marks them as errors, and prompts me to import them individually.

I need, at the least, to turn off this error checking for JSP files as I don't have the go-ahead to change all these files just to suit IDEAs behavior. Any suggestions?

Thanks
Patrick

0
Comment actions Permalink

You can ask the Hector

Patrick Wright wrote:

I have a problem related to this behavior in IDEA (running 6.02). I'm on a project with a large number of JSP files, a large portion of which use this import syntax. As IDEA does not recognize the imports, it believes that every class referenced in the JSP has not been imported, marks them as errors, and prompts me to import them individually.

I need, at the least, to turn off this error checking for JSP files as I don't have the go-ahead to change all these files just to suit IDEAs behavior. Any suggestions?

Thanks
Patrick



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.