Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2.1.6 struts-tags not found, help!

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic