Nahid,

Again, I can't see all the code you are using, but it looks like you can
just have SecondAction extend FirstAction:

public class SecondAction extends FirstAction {
@DefaultHandler
@DontValidate
public Resolution callImportTable() {
return super.importTable();
}
}

I can't see all the code you have, so this may or may not work.

-- Rick


On Fri, Feb 27, 2015 at 7:41 AM, Nahid Seidi <nahid.se...@gmail.com> wrote:

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