-
1. Re: sendRedirect and setRenderParameter
roy.russo Aug 8, 2006 11:40 AM (in response to pedrosacosta)Why would you want to do that? It doesnt make sense to set a render param and then redirect to some foreign url.
-
2. Re: sendRedirect and setRenderParameter
pedrosacosta Aug 8, 2006 12:15 PM (in response to pedrosacosta)In the portal that i'm building, i'm using attributes to send information from the java classes to the jsp files. For example, have a jsp that shows the name of the user logged in.
But, in other use cases, like submit a form, i want to show messages to the user like "The registration submitted sucessfully". But this message must dissappear if i do another action that follow the submit action.
I thought to put this variables/attributes in session, but i had a problem. The variables remains in session, and in the sequence of the pageflow, it is very difficult to remove the attributes in all cases of the pageflow of my portlet. My portlet has many pages that use the same portlet, but for different cases.
So, i thought to use renderParameter as a substiture to setAttribute. I thought that the renderParameter value dissappeared if i render the same page again.
For example, when i render a page, i set a message with renderParameter. If i re-render the page, the parameter would dissapear.
But, i'm seeing that it's not possible.
So, how can i set values that won't remain in session?
Thanks,
Pedro -
3. Re: sendRedirect and setRenderParameter
soshah Aug 8, 2006 12:27 PM (in response to pedrosacosta)Pedro-
As an alternate approach for redirect, you can still set the render parameter for your view and forward to the appropriate view.
Then you can use a javascript redirect to get to the next screen instead of using the sendRedirect method.
sample code for the view:<form name="redirect" action="location to go to" method="post"/> <!-- perform a sendRedirect to the above resource --> <script type="text/javascript" language="javascript"> document.redirect.submit(); </script>
Thanks
Sohil