• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2.1.6 struts-tags not found, help!

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic