This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

URI cannot be resolved

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic