• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URI cannot be resolved

 
Kaiser Lautern
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, folks,

Can anybody please tell me what is exactly the meaning of this message:

org.apache.jasper.JasperException: /index.jsp(0,0) This absolute uri (http://struts.apache.org/tags-bean) cannot be resolved in either web.xml or the jar files deployed with this application.

The .jsp declares the taglig as follows:

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

It is the application struts-resum´┐Ż. It originally used the
http://jakarta.apache.org/struts/tags-bean uri. I changed to the new one, but the error persists.

Kaiser
 
Mallika R Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
In your jsp page, the tag declaration should be
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
Here, "uri" points to "taglib-uri" property in web.xml. In your web.xml, the declaration should be something like this:
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

The declaration in web.xml points to your local copy of the struts-bean.tld, and these tld files are placed in <web-root>/WEB-INF directory.

-Mallika.
 
Kaiser Lautern
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mallika,

Thanks for your answer.



In your jsp page, the tag declaration should be
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>


Well, the URI attribute is just a logical name and as such I can choose anything I want, I suppose, as long as I use the same name in the web.xml, where I'm going to map it to an absolute location. So why not a big URL?



The declaration in web.xml points to your local copy of the struts-bean.tld, and these tld files are placed in <web-root>/WEB-INF directory.


Yes. That's what I thought too, but this example I took from a full fledged struts app called struts-resume, which was supposed to work without much effort. And its web.xml does not include the taglib mapping...

Kaiser
 
Cesar Olavo
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

You don't need to map the taglib in the web.xml. From Servlet 2.3 (Tomcat 4.1, for example), JARs in WEB-INF/lib are inspected for .tld files in their META-INF directory. If a .tld file exists, its URI can be used in your JSPs without having to define any taglibs in web.xml. Please check if you have all the needed jars.


Cesar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic