Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Redirecting from an External to the error page of my application
Shivangi Malot
Hi,
I am facing an issue while trying to redirect to the error page whenever an exception occurs in my external while the page is being rendered.
Can we redirect from an external to some other page in case of any exception?
Any help in this context is welcomed.
Thanks
Find more posts tagged with
Comments
Rick Poulin
Can we redirect from an external to some other page in case of any exception?
Not server side, no. The best you could do with an external is have the component render a bit of Javascript to change the window.location.
Only precontrollers can redirect the page flow on the server side (by returning an appropriate instance of a ForwardAction. Once it gets to the externals, the response has already been initialized and it's too late to redirect. What you should do is retrieve and validate your essential content in a precontroller (and redirect if a failure occurs). To avoid processing the data twice, you can store the validated data in the request (e.g. as a request attribute) so that your external can assume that if it's executing, then the data has been validated and it's available for retrieval somewhere.