Cannot resolve tag libraries

OK, I know there have been other posts on this topic. I've read every one, tried enabling web support and restarting IDEA, but still it doesn't work. If anyone can help out, I'd appreciate it.

Here's an example of my tag in the JSP:
Here's the appropriate web.xml information: struts-html.tld /WEB-INF/struts-html.tld ]]>

I've enabled Web Application support and have one entry defined as follows:
Name: MyProject
Path: C:\jakarta-tomcat-4.1.12\webapps\myproject

Under myproject is a WEB-INF directory where both web.xml and struts-html.tld files reside.

I'm using IDEA 3.0 (build 675) on Windows XP with JDK 1.4.1_01.

-ryan

PS. I've also tried configuring an external resource as:
URI: struts-html.tld
Path: C:\jakarta-tomcat-4.1.12\webapps\myproject\WEB-INF\struts-html.tld

With no success.

6 comments
Comment actions Permalink

If the uri part shows red in <%@ taglib prefix="html" uri="struts-html.tld"
%>, try configuring the external resource.

Right after you specify the external resource, the taglib declaration should
turn green. However, the tags are not recognized in the JSP pages until you
restart IDEA (it might work if you just disable/enable the web support for
that web app, but I haven't tried). One would think the changes should be
picked up on the fly...

HTH,
Andrei

"Ryan Shriver" <rshriver@ddig.com> wrote in message
news:6358068.1039203145212.JavaMail.jrun@is.intellij.net...

OK, I know there have been other posts on this topic. I've read every one,

tried enabling web support and restarting IDEA, but still it doesn't work.
If anyone can help out, I'd appreciate it.
>

Here's an example of my tag in the JSP:
<%@ taglib prefix="html" uri="struts-html.tld" %>

>

Here's the appropriate web.xml information:
<taglib>
<taglib-uri>struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

>

I've enabled Web Application support and have one entry defined as

follows:

Name: MyProject
Path: C:\jakarta-tomcat-4.1.12\webapps\myproject

>

Under myproject is a WEB-INF directory where both web.xml and

struts-html.tld files reside.
>

I'm using IDEA 3.0 (build 675) on Windows XP with JDK 1.4.1_01.

>

-ryan

>

PS. I've also tried configuring an external resource as:
URI: struts-html.tld
Path: C:\jakarta-tomcat-4.1.12\webapps\myproject\WEB-INF\struts-html.tld

>

With no success.



0
Comment actions Permalink

OK, got it to work, thanks.

I now realize there was a mis-understanding on my part with what a Web Application meant. I thought it was meant to define the local deployment location (ie under Tomcat/webapps) and not where my web application source code lived.

I changed the Web Application to point to my source web code (JSP's, images) and added the Struts Taglibs under the external resources and it all works well now.

-ryan

0
Comment actions Permalink

Ryan,

If you put the newest struts jars into WEB-INF/lib folder, IDEA will
recognize their URIs automatically (this behaviour is fully described in
JSP7.3.4)

--
Best regards,
Mike Aizatsky.
-


JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"


0
Comment actions Permalink

Hi,
I am probably doing something incorrectly, but here is what I am doing

I have 3 pages

1 header.jsp
3 body.jsp
4 completePage.jsp

in header.jsp I have:


<%@ taglib uri="/WEB-INF/app.tld" prefix="app" %>
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/lib/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/lib/struts-template.tld" prefix="logic" %>

and everything is color green and is fine.

in compeltePage.jsp I just have some includes like this:

<%@ page language="java" %>


<jsp.include file="header.jsp" />


<jsp.include file="body.jsp" />


and everyhting is OK.

However, in body.jsp I am seeing red.

For example,

<html:form action="/addToCart">

<logic:iterate id="inventoryItem" type="com.digisolutions.ear.model.InventoryItem" name="SEARCH_RESULTS_LIST">

both HTML and LOGIC are red.
If I paste the contents of the header.jsp to the top of this file, the red goes away.

I was hoping to be able to use includes as described above and have IDEA resolve the tag libs.

I was wondering what I am perhaps doing wrong.

I have enabled Web App and pointed to my "www" direcory with is where the root document is located as well my web.xml file.

Any pointers appreciated.

Thanks, Spencer


0
Comment actions Permalink

Spencer Marks <smarks@digisolutions.com> wrote:


in header.jsp I have:

<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html" %>

in compeltePage.jsp I just have some includes like this:

<jsp.include file="header.jsp" />
<jsp.include file="body.jsp" />

However, in body.jsp I am seeing red.

<html:form action="/addToCart">

I was hoping to be able to use includes as described above and have IDEA resolve the tag libs.


You're asking a lot of the system.

It's not unreasonable for the system to know that header.jsp is included in
completePage.jsp and to know that the tag lib declarations from header.jsp
are in scope in completePage.jsp.

But, how is the system to know what scope body.jsp is going to be included
into? What if there are six pages that include body.jsp -- how will the
system know which of the six is in scope when you are editing body,jsp.

You've got your dependencies backwards. If you want to guarantee that
body.jsp will compile (and not see red), you need to make sure you bring
the tag library declarations into scope for body.jsp, either by putting the
tag library declarations in body.jsp, or by including a common file that
has them.

Paul

0
Comment actions Permalink

I guess I was hoping for a way to set global includes. Since each of my .jsp pages is snippet (save for completepage.jsp) I though including the taglibs on each snipppet incorrect. However, I will reconsider my approach. I'll see how the Apache Tiles project works for one thing. That might help.

Thanks for your reply.

0

Please sign in to leave a comment.