1

I had a sample HelloWorld Example of Struts 2 from web.

Its struts.xml contains:

<struts>
    <package name="default" extends="struts-default">
        <action name="HelloWorld">
            <result>/success.jsp</result>
        </action>
    </package>

</struts>

On running application, I get a warning stating that:

No configuration found for the specified action: 'HelloWorld' in namespace: ''. Form action defaulting to 'action' attribute's literal value.

So, on clicking of submit button in index.jsp page, I get Http 404 error(requested resource is not avaiable) error.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Ankit
  • 2,126
  • 4
  • 33
  • 53
  • You should post the code of `` and ``. – lschin May 16 '11 at 01:37
  • better post the code with struts.xml file and this issue seems to be related to the mapping of your action – Umesh Awasthi May 16 '11 at 05:43
  • Following is the package code in struts.xml. This file is located in src/java folder. package name="default" extends="struts-default" action name="HelloWorld" class="vaannila.HelloWorld" result name="SUCCESS">/success.jsp/result /action /package> – Ankit May 20 '11 at 08:02
  • The formatting matters. Can you repost, by editing the original question. Ensure that you format the xml as code. – Quaternion May 20 '11 at 18:53

2 Answers2

0

I got this problem quite often. so because my application does not refresh correctly. So i clean my project and the problem is solved. Go to 'Project' and select 'Clean...'.

Gaurav Manral
  • 600
  • 4
  • 7
  • 24
0

You are coding with the help of vaannilla example that is found on web with Struts2 keyword on Google search.

Are you using any development tool for coding? At least in Eclipse you can create an empty dynamic web project and then at least you have correct file structure, correctly formed xml templates and so on.

You have to follow the tutoarial strictly, not leaving anything out and having all files in correct locations. Also xml files on that example are missing some "title" type of rows that can be copied from the template of Eclipse's hello world example or similar.

But if you don't want to stick inside the vaannilla solution, the struts2 official Hello World tutorial has more comprehensive approach on their one. At least there are entire xml files present.

mico
  • 12,730
  • 12
  • 59
  • 99