2

Do we always need to extend the struts-default package? I am seeing following exception on server startup:

Caused by: Error building results for action loginScreen in namespace /User - action - file:/C:/glassfish4/glassfish/domains/domain1/eclipseApps/Struts2Example/WEB-INF/classes/login.xml:9:30

package:

<package name="login" namespace="/User" >
    <action name="loginScreen">
        <result>pages/login.jsp</result>
    </action>
</package>

if I add the extends="struts-default" to above package then server is starts up without any error.

Can someone please give more details on this error/exception?

Roman C
  • 49,761
  • 33
  • 66
  • 176
  • 2
    Read struts 2 in action.That would help you a lot. – Algorithmist Aug 24 '13 at 03:18
  • 1
    Please read some books and go through some examples. If you get stuck in some concept, the community will help, but asking them to train ain't such a good idea. Always state what you've already tried in your question. I meant train because the question is too broad to be explained in here when you can easily find it with a quick-google. – coding_idiot Aug 24 '13 at 18:38

1 Answers1

2

In your configuration you are using a dispatcher result type by default to configure your result. But this type is defined in the struts-default package which your package should extend. It's not obligatory to extend this package, but to have support from the Struts2 framework you need at least your root package extend the struts-default.

Roman C
  • 49,761
  • 33
  • 66
  • 176