In following code I am calling a method in 'FirstAction' from
'SecondAction'.

When exception occurs in 'FirstAction' I need the 'getSourcePageResolution'
to get back to 'import.jsp' as the UrlBinding is saying so, but instead, it
gets back to a default error page which I defined in web.xml as following:

<error-page>
    <error-code>500</error-code>
    <location>/WEB-INF/jsp/error.jsp</location>
</error-page>

Here is the code for two actions and one jsp that I'm using

FirstAction.java

@UrlBinding("/example/import.action")
public class FirstAction implements ActionBean {
@DontValidate
public Resolution importTable() throws IOException  {
try {
// do something
} catch(Exception e) {
this.getContext().getValidationErrors().addGlobalError(new
SimpleError(e.getMessage()));
return getContext().getSourcePageResolution();
}
 return new RedirectResolution("/list.action");
}
}

SecondAction.java

public class SecondAction implements ActionBean {
@DefaultHandler
@DontValidate
public Resolution callImportTable() {
return new RedirectResolution (FirstAction.class, "importTable");
}
}

import.jsp

<stripes:link beanclass="com.example.action.SecondAction"
event="callImportTable">
<input type="button" value="Import table" />
</stripes:link>

Is there any way to do the binding from 'SecondAction' to 'FirstAction' so
 'getSourcePageResolution' shows the 'import.jsp' instead of 'error.jsp' ?
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to