Results 1 to 3 of 3

Thread: "redirect:" with Tiles?

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Brisbane
    Posts
    9

    Default "redirect:" with Tiles?

    Hi guys,

    I'm using Tiles with Spring MVC. I have a question regarding using the "redirect:" option:

    I have a MultiActionController with multiple related "action" methods that return ModelAndView. For example:

    Code:
    ModelAndView action1(request, response) {
        do stuff...
        return ModelAndView("tilesName");
    }
    So, my question is: what happens if I want to redirect to a particular Tiles view name? I tried:

    Code:
        return ModelAndView("redirect:tilesName");
    ... but that doesn't seem to be the correct place to put it.

    Has anyone else done this?

    Cheers,

    Matt.

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default

    You can't redirect to a tiles name.

    You can redirect to a .htm, etc. as you probably already know.

    It would be nice if you could to avoid having to know the underlying controller mapping name, and reference a page the same way regardless of whether you were doing a forward or a redirect.

    Best you can probably do is inject the .htm name that you want to redirect to into the controller.

  3. #3

    Default

    Hi Matt,
    This might not be much help to you but I had the same problem and that was when I started looking at Sitemesh. It might not be an option for you but my project was still in it's early stages and the switch was surprisingly easy. Having used them both now, I prefer Sitemesh over Tiles.

    Cheers,
    Kevin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •