aspose file tools*
The moose likes Struts and the fly likes Struts 2.1.6 struts-tags not found, help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2.1.6 struts-tags not found, help!" Watch "Struts 2.1.6 struts-tags not found, help!" New topic
Author

Struts 2.1.6 struts-tags not found, help!

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Hi guys

I am looking to try some development in Strust 2 (2.1.6) with Hibernate 3 (3.3.2)

I have found a simple Struts2 example but when I create it and run it on Apache 6 I get the following error:

org.apache.jasper.JasperException: File "/struts-tags" not found

I have the following JSRs in the WEB-INF/lib folder and the struts-tags.tld is in the struts2-core-2.1.6.jar/META-INF as you would expect, but my app can not see it
lib:
- commons-logging-1.0.4.jar
- freemarker-2.3.13.jar
- hibernate3.jar
- mysql-connector-java-5.0.5-bin.jar
- ognl-2.6.11.jar
- struts2-core-2.1.6.jar
- xwork-2.1.2.jar

Any reasons why?

Cheers in advance

KS

-----

Just an update...
I can get this working if I drop the struts-tags.tld into the WEB-INF folder, but then I get a

org.apache.jasper.JasperException: /struts/WEB-INF/pages/displayEmployee.jsp(10,31) Unable to load tag handler class "org.apache.struts2.views.jsp.PropertyTag" for tag "s:property"

error, so it would seem my app can not see the struts2-core-2.1.6.jar at all!

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please post the taglib directive you're trying to use.

I'm not sure why it'd run at all without the commons-io and commons-fileupload jars; they're required for S2.1.6.
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Hi David

Slight delay in the response, I have added the two JARs you mentioned (they were not mentioned in the example I was using - http://www.benmccann.com/dev-blog/struts-2-tutorial-getting-started/) & this is my 'taglib directive'



As I say, the JAR (struts2-core-2.1.6.jar) is under /webapp/WEB-INF/lib
The JSP is under /WEB-INF/pages/displayEmployee.jsp
Ranveer K Kumar
Ranch Hand

Joined: Sep 13, 2009
Posts: 64
Keith Seller wrote:Hi David

Slight delay in the response, I have added the two JARs you mentioned (they were not mentioned in the example I was using - http://www.benmccann.com/dev-blog/struts-2-tutorial-getting-started/) & this is my 'taglib directive'

[code]

did you check web.xml for proper tag defination..
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Ranveer K Kumar wrote:did you check web.xml for proper tag defination..


That's not required as the container looks inside jars for tld files.

You said that the jars (including commons jars that David pointed out) are in /struts/WEB-INF/lib folder. You wrote /webapp/WEB-INF/lib but earlier you said the project folder name was struts. Please confirm this and that the commons jars are also in the lib folder...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Ankit Garg wrote:
Ranveer K Kumar wrote:did you check web.xml for proper tag defination..


That's not required as the container looks inside jars for tld files.

You said that the jars (including commons jars that David pointed out) are in /struts/WEB-INF/lib folder. You wrote /webapp/WEB-INF/lib but earlier you said the project folder name was struts. Please confirm this and that the commons jars are also in the lib folder...


Sorry, the webapp name is 'struts', I was beign generic when I wrote webapp.

The app is called 'struts' under it I have the /WEB-INF/lib folder, which has the JARs listed above including the two extra ones Dave mentioned. The TLD is in the struts2-core2.1.6.jar under /META-INF

I have the taglib directive of
<%@ taglib prefix="s" uri="/struts-tags" %>

My understanding from the example is that Struts2 will automatically look through the JARs for teh matching .tld file.
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Quick update, used this example instead (http://www.vaannila.com/struts-2/struts-2-example/struts-2-annotation-example-1.html) and it works, not sure what's so different using the same JAR files as I used before but it's working.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2.1.6 struts-tags not found, help!