aspose file tools*
The moose likes Struts and the fly likes taglib uri failing me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "taglib uri failing me" Watch "taglib uri failing me" New topic
Author

taglib uri failing me

Santiago Conde
Greenhorn

Joined: Nov 09, 2004
Posts: 16
Hello all

I'm trying to make a minimal application using Struts. Right now I'm having problems with the Struts taglibs. I'm working with Struts 1.2.4, Tomcat 4.1.29 and I'm a bit confused about how are the taglibs configured.

When I try to access to the entry page I get the following exception:



If I understood the documentation right, there's no need to write the <taglibs> elements in the web.xml descriptor, just using the directive inside every .jsp you need. I did so in my entry page



I also have the tlds in the path "/WEB-INF/tlds/struts-html.tld", although I think that this should not be necessary.

Any idea about this error?

Thanks in advance
Santi


Dudo, your brain is vanishing like the fog.- Fraggel Rock
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try specifying the taglib in the format:

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
[ May 09, 2005: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Santiago Conde
Greenhorn

Joined: Nov 09, 2004
Posts: 16
Hello Merrill

The change you suggested works well, but now I have problems with the path of my classes:
but I have that class inside a .jar archive in /WEB-INF/lib/TestStruts.jar. I have verified that using the command
(by the way, I'm not able to configure Ant to build the bundle with the first letter in lower case, but that's just a little detail).

As far as I know there should be no problem with that path since the classes are scanned inside both /WEB-INF/classes and /WEB-INF/lib paths.

Thanks for your response and your time
Santi
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I don't really know why Tomcat isn't finding this class. Are you positive the .class file is in the jar and not just the .java file? Try un-jarring it and putting it in the classes folder and see if it works.
Santiago Conde
Greenhorn

Joined: Nov 09, 2004
Posts: 16
Hi Merrill

I had the same idea and tried it without success. It's weird.

I guess I'll have to do some investigation about that. The access permissions are right, the paths seem right, I don't have any duplicates which could confuse the class loader´┐Ż Well, in this time zone is very late to do anything more. Perhaps my bed could give me some hints.

If I discover the source of the error I'll post it later.

Thanks again
Santi
Santiago Conde
Greenhorn

Joined: Nov 09, 2004
Posts: 16
Going on with the research, I created a standard servlet (not controlled by Struts) and instantiated an EmpregadoForm object. It worked fine.

In addition to that, I implemented a main() method within the EmpregadoForm class and made a test from /WEB-INF/lib directory (I added /WEB-INF/lib/testStruts.jar to the CLASSPATH in a new terminal). It worked fine too. So, I'm running out of ideas.

Perhaps an initialization issue with the controller servlet?

Following is my struts-config file, for the sake of information.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: taglib uri failing me
 
Similar Threads
error in struts-html.tld file
struts-blank.war file
Error: The requested resource /webapplication_name/ is not available
JasperException: File "/WEB-INF/struts-bean.tld" not found
EL Configuration Problem