Struts2.0 framework Configuration File
Previous Home Next


The struts2 configuration file described the all request which is send by user then configure action class will be invoked . The action class return the string this string is configure in configuration file then send the response with the help of Result class. 

 There are two ways to do configuration file in struts2 framework

First XML based configuration file:-


"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
<package name="demo" extends="struts-default">
<action name="hello" class="mypack.MyAction">
<result name="success">/hello.jsp</result>

Second Java Annotation based configuration:-

@Result(name="input", value="/RegistrationSuccess.jsp" )
@Result(value="/RegistrationSuccess.jsp" )
public class Login implements Action {
public String execute() {
//Business logic for login

Previous Home Next