JSP compile question

We have some front-end developers that use Weblogic Workshop to create JSPs.
When they use classes from the java.util package in those JSPs they aren't
required to import them. But, when I open the JSPs in IDEA all those classes
are marked red and IDEA wants to import them. Is this because WL uses a
different jsp compiler? Is there a way to get IDEA to realize these classes
don't need to get imported?


0
12 comments

Hello Brad L.,

Are you sure that JDK is specified correctly for your module?

We have some front-end developers that use Weblogic Workshop to create
JSPs. When they use classes from the java.util package in those JSPs
they aren't required to import them. But, when I open the JSPs in IDEA
all those classes are marked red and IDEA wants to import them. Is
this because WL uses a different jsp compiler? Is there a way to get
IDEA to realize these classes don't need to get imported?



0

Yes. If I import the package or class, everything is fine. Problem is, all
our jsps are like this. So, every jsp I open is full of red markers.

"Nikolay Chashnikov (JetBrains)" <Nikolay.Chashnikov@jetbrains.com> wrote in
message news:c8a89437d3238c977bca05b9821@news.intellij.net...

Hello Brad L.,

>

Are you sure that JDK is specified correctly for your module?

>
>> We have some front-end developers that use Weblogic Workshop to create
>> JSPs. When they use classes from the java.util package in those JSPs
>> they aren't required to import them. But, when I open the JSPs in IDEA
>> all those classes are marked red and IDEA wants to import them. Is
>> this because WL uses a different jsp compiler? Is there a way to get
>> IDEA to realize these classes don't need to get imported?
>>
>



0

I should also note that java.lang classes aren't marked red.

"Brad L." <no@no.no> wrote in message news:f4bglv$46r$1@is.intellij.net...

Yes. If I import the package or class, everything is fine. Problem is, all
our jsps are like this. So, every jsp I open is full of red markers.

>

"Nikolay Chashnikov (JetBrains)" <Nikolay.Chashnikov@jetbrains.com> wrote
in message news:c8a89437d3238c977bca05b9821@news.intellij.net...

>> Hello Brad L.,
>>
>> Are you sure that JDK is specified correctly for your module?
>>
>>> We have some front-end developers that use Weblogic Workshop to create
>>> JSPs. When they use classes from the java.util package in those JSPs
>>> they aren't required to import them. But, when I open the JSPs in IDEA
>>> all those classes are marked red and IDEA wants to import them. Is
>>> this because WL uses a different jsp compiler? Is there a way to get
>>> IDEA to realize these classes don't need to get imported?
>>>
>>
>>
>



0

That is weird. I would be surprised if these worked on another server. This sounds more like a "feature" of the particular JSP compiler and nothing to be relied upon. I would see this as a bug that your server would even support this. What version are you using? Maybe you can upgrade and remove the "feature".

0

Hello Brad L.,

Looks like this implicit importing java.util package is WebLogic-specific
feature. It doesn't work in Tomcat.
I think the simplest way to fix your problem is including import statement
to a prelude jsp.

I should also note that java.lang classes aren't marked red.

"Brad L." <no@no.no> wrote in message
news:f4bglv$46r$1@is.intellij.net...

>> Yes. If I import the package or class, everything is fine. Problem
>> is, all our jsps are like this. So, every jsp I open is full of red
>> markers.
>>
>> "Nikolay Chashnikov (JetBrains)" <Nikolay.Chashnikov@jetbrains.com>
>> wrote in message
>> news:c8a89437d3238c977bca05b9821@news.intellij.net...
>>
>>> Hello Brad L.,
>>>
>>> Are you sure that JDK is specified correctly for your module?
>>>
>>>> We have some front-end developers that use Weblogic Workshop to
>>>> create JSPs. When they use classes from the java.util package in
>>>> those JSPs they aren't required to import them. But, when I open
>>>> the JSPs in IDEA all those classes are marked red and IDEA wants to
>>>> import them. Is this because WL uses a different jsp compiler? Is
>>>> there a way to get IDEA to realize these classes don't need to get
>>>> imported?
>>>>


0

That's not an option. These are jsps someone else already created.

"Nikolay Chashnikov (JetBrains)" <Nikolay.Chashnikov@jetbrains.com> wrote in
message news:c8a89437d3978c9780b6ffe89a7@news.intellij.net...

Hello Brad L.,

>

Looks like this implicit importing java.util package is WebLogic-specific
feature. It doesn't work in Tomcat.
I think the simplest way to fix your problem is including import statement
to a prelude jsp.

>
>> I should also note that java.lang classes aren't marked red.
>>
>> "Brad L." <no@no.no> wrote in message
>> news:f4bglv$46r$1@is.intellij.net...
>>
>>> Yes. If I import the package or class, everything is fine. Problem
>>> is, all our jsps are like this. So, every jsp I open is full of red
>>> markers.
>>>
>>> "Nikolay Chashnikov (JetBrains)" <Nikolay.Chashnikov@jetbrains.com>
>>> wrote in message
>>> news:c8a89437d3238c977bca05b9821@news.intellij.net...
>>>
>>>> Hello Brad L.,
>>>>
>>>> Are you sure that JDK is specified correctly for your module?
>>>>
>>>>> We have some front-end developers that use Weblogic Workshop to
>>>>> create JSPs. When they use classes from the java.util package in
>>>>> those JSPs they aren't required to import them. But, when I open
>>>>> the JSPs in IDEA all those classes are marked red and IDEA wants to
>>>>> import them. Is this because WL uses a different jsp compiler? Is
>>>>> there a way to get IDEA to realize these classes don't need to get
>>>>> imported?
>>>>>
>



0

Yeah, we're using Weblogic Portal 8.1.5 which seems to have a lot of
"features" that aren't standard. We're supposed to be moving to WL 10 soon
which is supposed to be more standards based. But, that basically was my
original question. Can you change the jsp compiler/parser that IDEA uses to
"validate" jsps?

"Norris Shelton" <no_reply@jetbrains.com> wrote in message
news:24371524.1181309748319.JavaMail.itn@is.intellij.net...

That is weird. I would be surprised if these worked on another server.
This sounds more like a "feature" of the particular JSP compiler and
nothing to be relied upon. I would see this as a bug that your server
would even support this. What version are you using? Maybe you can
upgrade and remove the "feature".



0

Hello Brad L.,

No, you cannot change it.

Yeah, we're using Weblogic Portal 8.1.5 which seems to have a lot of
"features" that aren't standard. We're supposed to be moving to WL 10
soon which is supposed to be more standards based. But, that basically
was my original question. Can you change the jsp compiler/parser that
IDEA uses to "validate" jsps?

"Norris Shelton" <no_reply@jetbrains.com> wrote in message
news:24371524.1181309748319.JavaMail.itn@is.intellij.net...

>> That is weird. I would be surprised if these worked on another
>> server. This sounds more like a "feature" of the particular JSP
>> compiler and nothing to be relied upon. I would see this as a bug
>> that your server would even support this. What version are you
>> using? Maybe you can upgrade and remove the "feature".
>>


0

Preludes doesn't change JSPs.

0

LOL I don't see them changing IJ to mimic a bug in an obsolete web server.

We just decomissioned our last WL8 server. We currently have WL91 and WL92. I hope to get a WL10 server in production later this year.

My suggestion is to have your developers make the imports manually. If you ever upgrade the server, then the pages are going to need to be changed anyway. Might as well fix the known incompatibilities while it isn't a blocker for your migration to the new server.

0

FYI, we have the same issue where 18 years of legacy code (created with intelliJ) does not include java.util classes explicitly in JSPs because Weblogic does not require it, even in the most recent version. JSP validation only started working for us in the most recent version of intelliJ, so we never knew we were creating substandard code. The comment that we would have to update this sooner or later seems to only be true if we switch app servers...and issues like this help drive the decision NOT to change app servers.

0

Oh, and BTW, the reason it works for us in Weblogic is because we include java.util.* in a base JSP segment that is included by every other page, and it transitively imports the java.util branch -- it's not really what I would call a bug in Weblogic.

0

Please sign in to leave a comment.