Announcement Announcement Module
Collapse
No announcement yet.
Alternative Views Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Alternative Views

    Hi,

    Is there a way in spring to specify more then one view name for example in ModelAndView({ "view_customer_key", "view_default", model)
    and have spring use the first available view. The reason I need this is that I have a default view for all clients, but certain clients can have a customized view. Looking the API docs, it doesn't support this in ModelAndView but if anyone can suggest another method of checking for existing views that would be great.

    Regards,

    Huy

  • #2
    Use AbstractWizardFormController

    Hi,

    use "AbstractWizardFormController". In this setPages();

    Regards,

    Shahzad

    Comment


    • #3
      I would do that as a HandlerInterceptor. You can write an Interceptor that can change the view name dynamically. I wouldn't use the logic of "if the view exists, then use it", I would explicitly code the logic to determine which view to use. The nice part about using a HandlerInterceptor is you can re-use the logic across all of your Controllers.

      Comment


      • #4
        Originally posted by sethladd
        I wouldn't use the logic of "if the view exists, then use it", I would explicitly code the logic to determine which view to use.
        But this is what I want so that I don't have to change my code if a client decides they want a customized version. It would be similar to how internationalization would work I guess.

        Comment

        Working...
        X