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

Struts2 and Eclipse: No configuration found for the specified action in namespace: ''

 
eddy johns
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone. I'm running the struts2 simple HelloWorld app from http://www.vaannila.com/struts-2/struts-2-example/struts-2-hello-world-example-1.html, and getting this error: "No configuration found for the specified action: 'HelloWorld' in namespace: ''. Form action defaulting to 'action' attribute's literal value." Then, when I run the first jsp, it doesn't even call the HelloWorld.java.

I think the reason is that the app -- in Eclipse -- doesn't even find my struts.xml, because if I change the namespace property to something like this:



it still gives the same error, with namespace:''

My struts.xml is in the java src folder and it definitely in the project's classpath. Why isn't it getting found?

Thanks!
 
Venkata Kumar
Ranch Hand
Posts: 110
Firefox Browser Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Johns,

Please post the contents of Jsp that you are accessing.

<package name="default" extends="struts-default" namespace="asdfasdfadsfasdf">

Default namespace is "/". You have to append "/" to the new namespace string

Are you able to access the page when you don't specify any namespace?

How are you accessing the action class. If you are using namespace then action url should be accessed using namespace
for example http://<IPADDRESS>:<PORT>/<ApplicationContextRoot>/<Namespace>/<Action>;

 
Sita Marivada
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also facing the same error with the same example.Can some body help me on this?
 
Lalit Negi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Vannila example posted has various dtd and other tags on the top of various jsp file index.jsp , success.jsp, struts.xml etc or try to compare your app code with the Example1 posted in the same site. it should work then.
 
wking qing
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this problem is easy.you can do this:
new a folder named "namespace" in WebRoot ,then drag success.jsp in it.
the action result url will be change into <ApplicationContextRoot>/<Namespace>/<result location>;
for example :
your url will be change into <ApplicationContextRoot>/asdfasdfadsfasdf/success.jsp
obviously,it's wrong url.because you don't have a jsp in the folder named asdfasdfadsfasd
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic