jsp tag files - does IDEA recognise them?

Hi,

I have several tag files in my JSP project, but when I use them in a JSP, IDEA says:

"Cannot resolve symbol tags"

The taglib line is this:

<%@ taglib prefix="h" tagdir="/WEB-INF/tags" %>

It works fine with tomcat 5.

Does IDEA 5.1.1 handle these and if so is there a "trick to it"?

If not, does IDEA 6 handle these?

Thanks,
Chris

11 comments
Comment actions Permalink

you must create a subdir with your .tag files under /WEB-INF/tags/ and map that one

0
Comment actions Permalink

Hi,

I do have the /WEB-INF/tags/ directory with my tag files in (they work fine under tomcat).

The "map that one" seems to imply that maybe I need to configure IDEA with details about my tags directory - if so, how?

Thanks,
Chris

0
Comment actions Permalink

That works fine in both 5.1 and 6. Is the web root for your web module configured
correctly?


0
Comment actions Permalink

Hi,

Ok - I think I've got it now - the content root was not my webapp root directory and I was not using the default IDEA web project structure - now that I have changed my content root, its finding my tags ok - might be worth making it clear that a web module takes its content root as the web root.

Thanks,
Chris

0
Comment actions Permalink

The module content root does not have to be the webapp root.

Let me show an example web project configured for IDEA 6.0:
c:\work\mywebproject
(configured as "module content root" in "Sources" tab)

c:\work\mywebproject\src\java
(marked as "Sources (blue)" in "Sources" tab)

c:\work\mywebproject\src\webapp
(configured as "web resource directory" => "/" in "Web Module Settings" tab)

To clarify, the full path to WEB-INF would be:
c:\work\mywebproject\src\webapp\WEB-INF

Hope this helps,
-tt


0
Comment actions Permalink

Hi,

That is much clearer/cleaner - in my original module, when I add a web resource directory mapping my web root to / the tags all work fine too.

Many thanks,
Chris

0
Comment actions Permalink

I have a similar issue--no recognition of .tag in Idea 6.0.4

Attached is a screenshot that shows, in project panel, that the "/" directory is defined such that the tagdir reference (in the right-hand JSP code page) should be correct to identify the tagdir.

you can see from the bottom left part of the project panel that "form.tag" is unrecognized.

So if the webapp dir is set correctly, what else could be going wrong?

thanks,

larry



Attachment(s):
ideaTagdir.png
0
Comment actions Permalink

you can see from the bottom left part of the project panel that
"form.tag" is unrecognized.


Check your file associations (Settings->File Types).
Find the group "Java Server Page files". It should be mapped to patterns
below:
*.jsf
*.jsp
*.jspf
*.tag
*.tagf
*.xjsp

If that doesn't help, please provide some more information, or even better:
a minimal sample project.

Tag files (both .tag and .tagx format) are fully supported in 6.0.4.


0
Comment actions Permalink

Thanks, I added *.tag to the control panel for jsp file types and it worked.

This project was generated by maven 2 using

mvn idea:idea

Perhaps the bug is there? Or does the default project lack *.tag for jsp files?

larry

0
Comment actions Permalink

Hello larry,

Thanks, I added *.tag to the control panel for jsp file types and it
worked.

This project was generated by maven 2 using

mvn idea:idea

Perhaps the bug is there? Or does the default project lack *.tag for
jsp files?


No, everything should work out of the box - and does so for me.
Which version of maven and the idea:idea plugin are you using?


0
Comment actions Permalink

$ mvn -version
Maven version: 2.0.4

The plugin comes from the 'superpom' associated with the core maven classes--all automatically updated on my client machine. That's a way of saying I don't know the plug-in version; let me know if there's a command to identify it.

Here's a clue: this project, created by Maven, has a web app in it. A sub-project was correctly created for that web project, but the servlet API version was misidentified as Servlet 2.3 (which doesn't have .tag files). I changed that manually to 2.4.

larry

attached is .ipr project generated by maven; notice the 2.3 setting. (web.xml is clearly 2.4)

below is output for maven

-



larry@HAM6 ~/cvs/able/able
$ mvn idea:idea
Scanning for projects...
Reactor build order:
Able Parent Project
Able JPA Core library
Able Examples WAR
Searching repository for plugin with prefix: 'idea'.
-


---
Building Able Parent Project
task-segment:
-


---
Preparing idea:idea
No goals needed for project - skipping

jdkName is not set, using as default.
-


---
Building Able JPA Core library
task-segment:
-


---
Preparing idea:idea
No goals needed for project - skipping


Artifact javax.servlet:servlet-api:jar:2.4:provided retains local scope
'provided' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify or remove the loc
al scope.

While downloading javassist:javassist:3.0
This artifact has been relocated to jboss:javassist:3.0.


While downloading easymock:easymock:2.0
This artifact has been relocated to org.easymock:easymock:2.0.



Artifact commons-io:commons-io:jar:1.0:provided retains local scope 'pro
vided' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify or remove the loc
al scope.


Artifact xerces:xercesImpl:jar:2.8.0:provided retains local scope 'provi
ded' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify or remove the loc
al scope.

-


---
Building Able Examples WAR
task-segment:
-


---
Preparing idea:idea
snapshot org.mortbay.jetty:maven-jetty-plugin:6.1-SNAPSHOT: checking for
updates from OpenSymphony
snapshot org.mortbay.jetty:project:6.1-SNAPSHOT: checking for updates fro
m OpenSymphony
snapshot org.codehaus.cargo:cargo-maven2-plugin:0.3-SNAPSHOT: checking fo
r updates from OpenSymphony
snapshot org.codehaus.cargo:cargo-extensions:0.9-SNAPSHOT: checking for u
pdates from OpenSymphony
snapshot org.codehaus.cargo:cargo:0.9-SNAPSHOT: checking for updates from
OpenSymphony
No goals needed for project - skipping

While downloading javassist:javassist:3.0
This artifact has been relocated to jboss:javassist:3.0.


While downloading easymock:easymock:2.0
This artifact has been relocated to org.easymock:easymock:2.0.


snapshot com.opensymphony.able:able-core:1.0-SNAPSHOT: checking for updat
es from OpenSymphony


-


Reactor Summary:
-


Able Parent Project ................................... SUCCESS
Able JPA Core library ................................. SUCCESS
Able Examples WAR ..................................... SUCCESS
-


-


BUILD SUCCESSFUL
-


Total time: 3 seconds
Finished at: Tue Feb 20 16:25:24 PST 2007
Final Memory: 6M/11M
-




Attachment(s):
able-parent.ipr
0

Please sign in to leave a comment.