Announcement Announcement Module
Collapse
No announcement yet.
Redirect to custom view if site is down for maintenance Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Redirect to custom view if site is down for maintenance

    Hi - simple question - the answer seems to be eluding me.

    I'm using the SimpleFormController. Just before I render the data entry form I want to check a database field and if it's set to something - render a different page with a model (which contains a string I pull from the db like "down for maintenance").

    That's it really - just not sure how to plug in the check and render a different form from that specified in ...

    <property name="formView">
    <value>jsp/myform.jsp</value>
    </property>

    Cheers

    Rob

  • #2
    Create a HandlerInterceptor, implement the preHandle method, throw an exception like 'SiteDownException'. Configure a SimpleMappingExceptionResolver to show the desired page.

    Comment


    • #3
      Works great - thanks for the info. Is there any way to pass a string to the page used for when the site is down ? I'd like to provide an estimate as to when the system is expected to return - and I'd like to pull this from the db.

      Cheers

      Rob

      Comment


      • #4
        scrap that - think I've sussed it.

        Cheers

        Rob

        Comment

        Working...
        X