Search code examples
jspparametersstruts2invisible

Struts 2 passing parameters to jsp from struts.xml INVISIBLY


In my struts.xml file I'm redirecting to a particular jsp from an action. Actualy this is what happens there.

       <action name="redirectingToAction" class="sm.Login">
         <result name="success" type="redirectAction">
           <param name="actionName">redirectToJsp</param>
           <param name="namespace">/</param>
           <param name="page">somepage</param>
         </result>
       </action>

    <action name="redirectToJsp">
        <result >redirectedPage.jsp</result>
    </action>

The problem is when i redirect the paramer I'm passing appears in the addressbar of the browser. http://localhost:8084/myaplication/redirectToJsp?page=somepage
This is like in html get method. Is thereany way to send this parameter invisibly? like in html post method?


Solution

  • You might want to use UrlRewriteFilter, more info you can find here http://code.google.com/p/urlrewritefilter/