|
From: Colin S. <col...@ex...> - 2004-11-10 14:08:07
|
Also, if you're willing to go to CVS code (which will be 1.1.2 in a few
days), you can rely on the new redirect: prefix support, and get away
from the controller knowing that a RedirectView is used at all.
Dion Almaer wrote:
>Colin -
>
>You are the man :)
>
>return new ModelAndView(new RedirectView(getSuccessView(), true), "id",
>theId));
>
>Is all I needed.
>
>Cheers,
>
>Dion
>
>
>-----Original Message-----
>From: Colin Sampaleanu [mailto:col...@ex...]
>Sent: Tuesday, November 09, 2004 11:03 PM
>To: spr...@li...
>Subject: Re: [Springframework-developer] successView changes
>
>Dion,
>
>I presume you are actually using this view as a RedirectView? That's the
>only thing that makes sense, given that you're playing around with the name
>as if it's a URL, and the fact that it has .html at the end; I presume this
>is mapped to another controller?
>
>In any case, you shouldn't be manipulating the view name at all. What you
>should be doing is just setting the id as a model object, and letting
>RedirectView build the URL for you:
> return new ModelAndView(new RedirectView(getSuccessView(), true), "id",
>theId));
>
>Now do you have a problem with the controller itself knowing the name of the
>param?
>
>Colin
>
>
>Dion Almaer wrote:
>
>
>
>>Hi guys -
>>
>>I run into the following use case a lot:
>>
>>- Create a new FOO
>>- On success I want to SHOW that FOO
>>
>>Ideally I would want to:
>>
>><property
>>name="successView"><value>viewFoo.html?id=$request['id']</value></prope
>>rty>
>>
>>viewFoo.html?id=$request['id]
>>
>>Could of course be something else like: id=$id or
>>$request.getParameter("id") or whatever.
>>
>>But it would be really nice to be able to do something like this
>>instead of having my controller do a
>>
>>.... getSuccessView() + "id=" + theId ....
>>
>>If there another clean way to do this that I am missing?
>>
>>Cheers,
>>
>>Dion
>>
>>
>>
|