I have HTML code in the jsp page that I want it to be displayed only after the user submits data and get redirected to this page. So I have to set a success flag as a parameter in the link like:
http://site.com/page?success=true
Not sending in the request because it will be lost since I am redirecting
I don’t want to send it in the link as a parameter and I am thinking of another way
and ideas how to send it? So the link will be:
http://site.com/page
and I can display the the html code?
Just set it as a request attribtue.
Use JSTL
c:iftag to conditionally render content based on EL expression.If you want to survive the redirects, then you need to set it as session attribtue instead:
Use
c:removeremove it after first display so that the subsequent requests won’t be affected: