Em 28-02-2010 23:26, Frederik Minatchy escreveu:
Hello...

Since a few days I am working with Struts 2. (2.1.6)
I am facing a big problem with HttpRequest and JSPs.

Well... I have to forward a HTTPRequest from page1.jsp to page2.jsp

So... How can I pass HTTPRequest attribute betwen 2 pages?

Here is a part my web.xml file :

...
<filter>
         <filter-name>struts2</filter-name>
         
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
     </filter>
        <filter-mapping>
        <filter-name>struts2</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
...


the struts.xml file :

...

<action name="bnf-detail" 
class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
                <result 
name="success">/pages/bnf/administration/detailBnf.jsp</result>
                </action>



                <action name="bnf-detail_modification" 
class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction" method="modificationSubmit">
                <result 
name="success">/pages/bnf/administration/detailBnf.jsp</result>
                </action>
...

and a part of the action java file (which implementents RequestAware):

   public String execute() throws Exception
    {
       request.put("test", 58);
       return SUCCESS;
     }

    public String modificationSubmit() throws TechniqueException, 
FonctionnelleException
    {
       request.get("test"); // is null
       editMode = true;
       return SUCCESS;
    }



So... How can I pass the request attribute from on page to an other?





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

I think you should be able to redirect with something like this: http://struts.apache.org/2.0.14/docs/redirect-action-result.html

use return type redirect-action, work at request level redirecting requests, no jsps. I think request params are retained this way.


Regards.
Alex Lopez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to