SivaKumarl wrote:
>
> When a exception is arising i m forwarding to Jsp page(techinical
> error.jsp) using StripesExceptionHandler
> This page contains
> SOME TEXT LIKE "internal problem occured";
> and one "Back button";
>
> when clicking on back button i want to go jsp page where the exception is
> raised.
>
I don't think I quite understand--you want the back button to take you back
to a page that is generating an exception? Won't it just forward you to the
exception page again? Well, if you want the Error page to have a variable
that you can use to send you back to the calling page, just pass it as a
parameter. For example:
public void handle(Throwable throwable, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
[...]
ForwardResolution next = new ForwardResolution("/Error.action");
next.addParameter("realSource", makeSourceParameter(request));
[...]
next.execute(...)
}
private String makeSourceParameter(HttpServletRequest request) {
UrlBuilder ub = new UrlBuilder(request.getRequestURI(), false);
ub.addParameters(request.getParameterMap());
try {
return URLEncoder.encode(ub.toString(), "utf-8");
} catch (UnsupportedEncodingException e) {
log.error("Failed to encode url [" + ub.toString() + "]", e);
}
return null;
}
Then later on in your Error.jsp/action, put a parameter called "realSource"
that gets bound when the action is executed:
public class ErrorAction implements ActionBean {
private String realSource;
public String getRealSource() [...]
public void setRealSource(String realSource) [...]
[...]
}
Now your error page has a variable you can use wherever you like that
contains the address of the source of the exception.
--
View this message in context:
http://www.nabble.com/How-to-go-back-to-action-from-ExceptionHandling-page-tp16269575p16301522.html
Sent from the stripes-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users