Taking a look to your code, it looks like you just want to end the action in a JSP, so I do not understand why you are trying to do it using redireciton
type. I recommend to use default redirect type: dispatcher
<action name="AddPayAction" class="controller.AddPayAction">
<result name="error">/Error.jsp</result>
<result name="success">/Pay.jsp</result>
</action>
Notice that as dispatcher
is de default type you don't need to write type="dispatcher"
in the results. So, now, if you want to have variables available in the JSP, you just need to declare those variables in the action with its get/set methods. For example:
private String msg;
public String AddPayAction() {
// your action code
this.setMsg("my message");
return SUCCESS;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg= msg;
}
Take a look to the result types available.