• 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: There is no Action mapped for namespace [/] and action name [actionname]

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,

I am migrating a project from struts1 to struts2. I am having annotation based action mapping rather xml based. so I removed struts.xml from classpath.

I kept all struts2 jars in my class path no jar file is missing I guess. After configuring one test action I am getting below exception:

There is no Action mapped for namespace [/] and action name [annotationTest] associated with context path [/cfw].

here annotationTest is my action name and cfw is project context path.

Please refer my files to resolve this:

web.xml





AnnotationTestAction.java





index.jsp




I have attached one image file for project structure.

When I build this project using build script it makes a war file name: cfw.war, inside this war file all the jsps are kept where my welcome_test.jsp is kept. all the class files are in a jar file name web-customer.jar, where my AnnotationTestAction.class is there in the jar file.

I am able to load index.jsp but when I tried to click above metioned links I get this error:

There is no Action mapped for namespace [/] and action name [annotationTest5] associated with context path [/cfw].

all the links give no action mapped error. I know I m missing something wrong but not able to identify. please post your solutions.

Thanks in advance :-)






scrn.png
[Thumbnail for scrn.png]
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vishal Patidar wrote:
I kept all struts2 jars in my class path no jar file is missing I guess.



What JAR files are you using?
You should not be putting your application JAR dependencies in the CLASSPATH, they should be in the WEB-INF/lib directory. If you put JAR dependencies in the CLASSPATH and your web server has conflicts with those dependencies, you can encounter difficult-to-debug errors.
The Struts annotations appear to depend on the Convention Plugin. Have you installed and configured this plugin?
 
Vishal Patidar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sorry. my jar files are kept at WEB-INF/lib only I did not put inside classpath. It was written by mistake.
below is the list of jar files:

asm-3.1.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.4.jar
commons-lang3-3.1.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.19.jar
javassist-3.11.0.GA.jar
javax.servlet_2.0.0.0_3-0.jar
ognl-3.0.6.jar
struts2-convention-plugin-2.3.16.3.jar
struts2-core-2.3.16.jar
struts2-dojo-plugin-2.3.16.jar
xwork-core-2.3.16.jar
 
Vishal Patidar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can somebody please look into it. I'm still stuck at it.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i guess you should write action name attribute instead of value attribute.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic