Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Internal Exception Page in LiveSite
mlerman
Hi folks,
My team's making a Teamsite 6.7.2 / LiveSite 3.1.0 based web site/application that has some fairly heavy Java that backs the external components. What we're trying to do is create an "Internal Error Page" so that whenever one of my Java Externals throws an Exception, I get directed to an "Internal Server Error" page.
In struts-based applications I've written before, I was able to do this fairly easily. Is there a way I can do this without adding Controllers to every page/component I write?
Thanks!
Find more posts tagged with
Comments
Stokes
I don't have any concrete experience doing that, but it sounds cool so I'm interested in the answers from others. Just some thoughts from the hip:
Is it acceptable to have a common parent class for all your Java externals? If so you might use a template method pattern in a way that lets you catch all exceptions from the parent class and handle/package them.
Regarding your controller, could you add a post-Controller to your
site
to avoid having to do anything on each page? I think you can edit your
.site
and add one and it will get called for every page in the site without having to modify the page.
Also, I know the
.site
can be configured with an error page. I don't know exactly what triggers this page to be rendered and what context it has available when it renders, but it might already do what you need. Have you tried this approach and found it lacking?
Stokes.
mlerman
The issue we were having with a site-wide post-Controller is that post-Controllers can't forward you to a new page.
What we ended up doing is two-fold. First, similar to having a wrapper for all externals, each external catches the Exception and sticks something in the session. Second, our site-wide post-Controller reads the session, and then grabs the context.getRequest().getWriter() and writes some javascript to the bottom of the page (a function, with an onload event to call the function) that re-writes the HTML in the body of the page to contain our message. Using fixed area layout helps with this, as most of our site has the same layout, and thus I can write generic JS to re-write my DOM.