JSTL code printed in RED, though tags work OK

Hi. I'm working with JSTL in IDEA 3.0 build 664 and the IDE is showing some of the code in red type. However, I can't find any errors, and the application runs fine.

For example, when I put this in a JSP...

]]>

The "http://java.sun.com/jstl/core" appears in red and the mouseover popup message reads "Cannot resolve tag library".

Lower down in the page, when I use...

somestuff ]]>

The first "c" prefix appears in red and the message is "Invalid tag library prefix "c"".

However, despite all this, the server (JRun 4) compiles the JSP and the app works.

Any information would be greatly appreciated.

Thank you.

Ethan

7 comments
Comment actions Permalink

Hi Ethan,

You'll have to create a mapping for all the .tld files you use either in your web.xml or in the Idea settings.

Goto : "Options -> IDE Settings -> Resources -> Add".
And enter for example :

(Ofcourse the path entry will need to contain the actual location of the c.tld file on your machine.)

Maas

0
Comment actions Permalink

Oops.. and make sure the jstl jars are in your project classpath.

Maas

0
Comment actions Permalink

Thanks for the reply. I changed the settings you recommended. However, the uri and prefix are still appearing in red as before.

Ethan

0
Comment actions Permalink

But there are no .tld files at http://java.sun.com/jstl/core. Shouldn't the URI point to the tag library desciptor?
Best regards,

Eugene Belyaev
JetBrains, Inc
"Develop with pleasure!"

Hi. I'm working with JSTL in IDEA 3.0 build 664 and the IDE is showing some of the code in red type. However, I can't find any errors, and the application runs fine.

For example, when I put this in a JSP...

]]>

The "http://java.sun.com/jstl/core" appears in red and the mouseover popup message reads "Cannot resolve tag library".

Lower down in the page, when I use...

> somestuff > ]]>

The first "c" prefix appears in red and the message is "Invalid tag library prefix "c"".

However, despite all this, the server (JRun 4) compiles the JSP and the app works.

Any information would be greatly appreciated.

Thank you.

Ethan


0
Comment actions Permalink

Hi Eugene,

>But there are no .tld files at http://java.sun.com/jstl/core. Shouldn't the URI point to the tag library desciptor?

Unfortunately they don't have to. :(

The spec authors probably emphasized on web.xml uri mapping because they expected lots of taglib authors wouldn't be able to actually host their tlds.... or something along those lines. Still :(

<quote_jsp12_spec>
JSP.7.2 Tag Libraries
A tag library is a collection of actions that encapsulate
some functionality to be used from within a JSP page. A
tag library is made available to a JSP page through a
taglib directive that identifies the tag library via a URI
(Universal Resource Identifier).

The URI identifying a tag library *may be any valid URI as
long as it can be used to uniquely identify the semantics
of the tag library.*

The URI identifying the tag library is associated with a
Tag Library Description (TLD) file and with tag handler
classes as indicated in Section JSP.7.3 below.
</quote_jsp12_spec>

Maas

0
Comment actions Permalink

Hi Ethan,

hmm unexpected ... :( :)

Could you please double double check you didn't make a typo in the resource definition.

If you're still stuck Zip up your little project and post it to this forum together with the config/options/other.xml file from your Idea dir. And i'll have a look.

Maas

0
Comment actions Permalink

Is webapp support enabled for your project and the web application defined
in your project?
The jsp should be within a valid web application, with the taglib(s) defined
in the web.xml.

If the app runs in your container, the web.xml is probably correct, but just
to make sure: Does your taglib definition in the web.xml match your taglib
directive in the jsp?

http://java.sun.com/jstl/core /WEB-INF/c.tld "Ethan Michaels" ]]> wrote in message
news:3293072.1041882091586.JavaMail.jrun@is.intellij.net...

Hi. I'm working with JSTL in IDEA 3.0 build 664 and the IDE is showing

some of the code in red type. However, I can't find any errors, and the
application runs fine.
>

For example, when I put this in a JSP...

>

]]>

>

The "http://java.sun.com/jstl/core" appears in red and the mouseover popup

message reads "Cannot resolve tag library".
>

Lower down in the page, when I use...

>

> somestuff > ]]>

>

The first "c" prefix appears in red and the message is "Invalid tag

library prefix "c"".
>

However, despite all this, the server (JRun 4) compiles the JSP and the

app works.
>

Any information would be greatly appreciated.

>

Thank you.

>

Ethan



0

Please sign in to leave a comment.