Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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...'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top