Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 1 Mar 2010 14:19:56 -0000 Issue 9016

user-digest-help

2010-03-01


Author LoginPost Reply

user Digest 1 Mar 2010 14:19:56 -0000 Issue 9016

Topics (messages 205187 through 205191):

Re: How to pass HTTPRequest between two JSP ?
 205187 by: Frederik Minatchy
 205188 by: Martin Gainty
 205189 by: Nils-Helge Garli Hegvik
 205190 by: Frederik Minatchy
 205191 by: Frederik Minatchy

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------


Attachment: user_205187.ezm (zipped)
Ok!!!!! Now I understand a little bit more!!!!!

But I will ask you on last question (I hope :) )
How can I do the same think without creating 2 independents request? It seems that the submit button is not the good choice...

Thank you for your help...



--- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik <nilsga@(protected) :

> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" <user@(protected)>
> Date: Lundi 1 mars 2010, 11h07
> In that case, you're talking about
> two entirely independent requests.
> The request for the first action is no longer accessible
> for the
> second action invocation. So in this case your options
> are:
>
> - Store the data as request parameters that you pass on to
> the next action
> - Store the data in the session.
>
> Nils-H
>
>
> On Mon, Mar 1, 2010 at 11:56 AM, Frederik Minatchy <frederik78@(protected)>
> wrote:
> > To go from the first action (the execute method) to
> the second one (supprimerIsbn) I use a submit button in the
> jsp :
> >
> >  <s:submit method="supprimerIsbn"
> id="supprimerIsbn" type="submit" />
> >
> >
> >
> >
> >
> >
> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
> <nilsga@(protected)>
> a écrit :
> >
> >> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
> >> Objet: Re: How to pass HTTPRequest between two JSP
> ?
> >> À: "Struts Users Mailing List" <user@(protected)>
> >> Date: Lundi 1 mars 2010, 10h44
> >> I'm not following the chain of
> >> actions here... Where's the
> >> flow/connection between the two actions?
> >>
> >> Nils-H
> >>
> >> On Mon, Mar 1, 2010 at 11:36 AM, Frederik Minatchy
> <frederik78@(protected)>
> >> wrote:
> >> > Perhaps it because of me and the way I
> understand
> >> HTTPRequest.
> >> >
> >> > Here is an other example :
> >> >
> >> >
> >> > in the class name :
> >> >
> >> >
> >>
> fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction
> >> implementing ServletRequestAware interface
> >> >
> >> >
> >> > when I am in the execute method I do :
> >> >
> >> >  public String execute() throws Exception {
> >> >  ...
> >> >   request.setAttribute("isbnListe",
> >> isbnEditeurBeanById); // isbnEditeurBeanById is a
> map
> >> > ...
> >> >
> >> >    return SUCCESS;
> >> > }
> >> >
> >> > and when I want to suppress element from the
> map
> >> stored in the request attribute
> >> >
> >> > I do :
> >> >
> >> >  public String supprimerIsbn()
> >> > {
> >> >   final Map<String, IsbnEditeurBean>
> >> allEditorIsbnToRemove =  (Map<String,
> >> IsbnEditeurBean>)
> request.getAttribute("isbnListe"); //
> >> is null ... why ?
> >> >     ...
> >> >    // remove selected elements
> >> >
> >> >   return "modification";
> >> > }
> >> >
> >> > in my xml file I have :
> >> >
> >> > ...
> >> >        <action name="editeur-detail"
> >>
> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
> >> >
> >> >                <result
> >>
> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp</result>
> >> >                <result
> name="success"
> >> type="dispatcher">
> >> >                        
> <param
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
> >> >                </result>
> >> >                <result
> name="modification"
> >> type="dispatcher">
> >> >                        <param
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
> >> >                </result>
> >> >                <result
> name="supprimerISBN"
> >> type="dispatcher">
> >> >                        <param
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
> >> >                </result>
> >> >        </action>
> >> > ...
> >> >
> >> >
> >> > and at least in the jsp :
> >> >
> >> >
> >> > I enter in the "supprimerIsbn" method with
> the submit
> >> button :
> >> > ...
> >> > <s:submit method="supprimerIsbn"
> id="supprimerIsbn"
> >> type="submit" />
> >> > ...
> >> >
> >> >
> >> > It's true... I can use Session... But after
> that I
> >> have to clean each elements I have set in session
> >> >
> >> >
> >> > I am sure that the dispatch result is a
> solution...
> >> but perhaps I made a mistake in the web.xml file.
> >> >
> >> > For example why in my url I always have
> something
> >> like
> >> >
> >> > http://localhost:8080/XXXXX/xxxxx.jsp and
> >> not http://localhost:8080/XXXXX/xxxxx.action?
> >> >
> >> >
> >> > Fred... Lost in struts2 world :(
> >> >
> >> >
> >> > --- En date de : Lun 1.3.10, Nils-Helge
> Garli Hegvik
> >> <nilsga@(protected)>
> >> a écrit :
> >> >
> >> >> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
> >> >> Objet: Re: How to pass HTTPRequest
> between two JSP
> >> ?
> >> >> À: "Struts Users Mailing List" <user@(protected)>
> >> >> Date: Lundi 1 mars 2010, 9h50
> >> >> Either:
> >> >>
> >> >> - Don't do a redirect, but a regular
> dispatch [1]
> >> >> - Store it in the session
> >> >>
> >> >> Regards,
> >> >>
> >> >> Nils-Helge Garli Hegvik
> >> >>
> >> >> [1] - http://struts.apache.org/2.1.8.1/docs/dispatcher-result.html
> >> >>
> >> >>
> >> >> On Mon, Mar 1, 2010 at 10:40 AM, Frederik
> Minatchy
> >> <frederik78@(protected)>
> >> >> wrote:
> >> >> >
> >> >> >
> >> >> > --- En date de : Lun 1.3.10, Alex
> Rodriguez
> >> Lopez
> >> >> <alopez@(protected)>
> >> >> a écrit :
> >> >> >
> >> >> >> De: Alex Rodriguez Lopez <alopez@(protected)>
> >> >> >> Objet: Re: How to pass
> HTTPRequest
> >> between two JSP
> >> >> ?
> >> >> >> À: "Struts Users Mailing List"
> <user@(protected)>
> >> >> >> Date: Lundi 1 mars 2010, 9h21
> >> >> >> 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-unsubscribe@(protected)
> >> >> >> > For additional commands,
> e-mail: user-help@(protected)
> >> >> >> >
> >> >> >> 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-unsubscribe@(protected)
> >> >> >> For additional commands, e-mail:
> user-help@(protected)
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > Thank you for your answer...
> >> >> >
> >> >> > But as I have to manage passwords I
> cannot
> >> pass values
> >> >> by using Request parameters (as they will
> appear
> >> in the
> >> >> url). I am forced to use Request
> Attributes. For
> >> the moment
> >> >> I am using SessionAware but it is not a
> good
> >> solution. Using
> >> >> Request attributes to store values seem
> to be a
> >> better way.
> >> >> (I remember that it was possible in strut
> 1.x
> >> wasn't it?)
> >> >> >
> >> >> >
> >> >> > I have read that with Dispatch
> result
> >> HTTPRequest was
> >> >> "kept" on the server and was not lost...
> I am
> >> trying to
> >> >> implement things as it is written in
> documentation
> >> but it
> >> >> fails...
> >> >> >
> >> >> > I appreciate your help...
> >> >> >
> >> >> > Fred
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> >> > For additional commands, e-mail: user-help@(protected)
> >> >> >
> >> >> >
> >> >>
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> >> For additional commands, e-mail: user-help@(protected)
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> > For additional commands, e-mail: user-help@(protected)
> >> >
> >> >
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>





Attachment: user_205188.ezm (zipped)

one way is to package a bean which contains a method which will get or post the request e.g.

<%@(protected)"%>
<jsp:useBean id="axiomclient" scope="application" class="gov.fmcsa.wribosservice.client.AXIOMClient" />

<html>

    <td width="77%" valign="center"><p><%=axiomclient.CallTheURL(object,request)%> </p><p>&nbsp;</p></td>
</html>



//sample code

AXIOMClient extends ABunchOfClasses implements ABunchOfInterfaces

{

public static void callTheURL(Object object,javax.servlet.http.HttpServletRequest request)

{

httpost=httpost_param; //save a local copy
org.apache.http.HttpResponse response_from_post = null;
org.apache.http.client.HttpClient httpclient = new org.apache.http.impl.client.DefaultHttpClient();

java.lang.String port="8007";
java.lang.String host="localhost";
java.lang.String protocol="http";

java.lang.String response_from_client="null response";
java.lang.String targetEndpoint=new String("http://localhost:8007/CommInterface2/servlet/Comminterface2Servlet");



//GET

org.apache.http.client.methods.HttpGet httpget = new org.apache.http.client.methods.HttpGet(targetEndpoint);
try
{
 httpget.addHeader("gov.fmcsa.wribosservice.client.WRIBOSServiceStub$SubmitmsgRequest",object.toString());
}
catch(Exception excp)
{
  if (debug) System.out.println("AXIOMClient produces Exception produced for httpget.addHeader(gov.fmcsa.wribosservice.client.WRIBOSServiceStub$SubmitmsgRequest,object.toString())");
}



//POST

    String resp=null;

    try
    {

 org.apache.http.HttpHost target = new org.apache.http.HttpHost("http://localhhost:8007/servlet/Comminterface2Servlet/");

// general setup
  org.apache.http.conn.scheme.SchemeRegistry supportedSchemes = new org.apache.http.conn.scheme.SchemeRegistry();

// Register the "http" protocol scheme, it is required
// by the default operator to look up socket factories.
  supportedSchemes.register(new org.apache.http.conn.scheme.Scheme("http",org.apache.http.conn.scheme.PlainSocketFactory.getSocketFactory(), 8007));

// prepare parameters
 org.apache.http.params.HttpParams params = new org.apache.http.params.BasicHttpParams();

 org.apache.http.params.HttpProtocolParams.setVersion(params, org.apache.http.HttpVersion.HTTP_1_1);

 org.apache.http.params.HttpProtocolParams.setContentCharset(params, "UTF-16");

 org.apache.http.params.HttpProtocolParams.setUseExpectContinue(params, true);

 org.apache.http.conn.ClientConnectionManager connMgr = new   org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager(params,supportedSchemes);

  httpclient = new org.apache.http.impl.client.DefaultHttpClient(connMgr, params);

  httpget = new org.apache.http.client.methods.HttpGet(targetEndpoint);

  httpget.addHeader("key",object.toString());

  httpost = new org.apache.http.client.methods.HttpPost("http://localhost:8007/CommInterface2/servlet/Comminterface2Servlet");

//roll thru the params and add in
     nvps = new java.util.ArrayList <org.apache.http.NameValuePair>();

     nvps.add(new org.apache.http.message.BasicNameValuePair("submitmsgRequest", object.toString() ));


     httpost.setEntity(new org.apache.http.client.entity.UrlEncodedFormEntity(nvps, "UTF-8"));

     set_httppost(object.toString());


     if (debug==true) System.out.println("AXIOMClient !!!!!!!!!!!About to call the server!!!!!!!!!!!");
     response_from_post=httpclient.execute(httpost);

     if(response_from_post!=null)
     {
       //acquire the entity
       org.apache.http.HttpEntity entity = response_from_post.getEntity();

   
    //response_client=org.apache.http.util.EntityUtils.toByteArray(entity);
       previous_label_str=null;
       submitMsgCounter=0;
       i=0;
       label_ctr=0;
       value_ctr=0;
       java.util.HashMap<String,String> returned_hashmap=ReturnBackFormattedList(org.apache.http.util.EntityUtils.toString(entity));
       String delimiterToAppend=new String("<br>");
       response_from_client = FormatTheHashMapAndReturnString(returned_hashmap,delimiterToAppend);
   }
  return response_from_client;

}



HTH
Martin Gainty
______________________________________________
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité



Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.





> Date: Sun, 28 Feb 2010 15:26:28 -0800
> From: frederik78@(protected)
> Subject: How to pass HTTPRequest between two JSP ?
> To: user@(protected)
>
> 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-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
           
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/201469230/direct/01/

Attachment: user_205189.ezm (zipped)
That depends. What are you trying to do? What is the purpose of the
submit in the first place? If you just need to execute the second
action directly after the first one, then configure your second action
as a result of the first action.

Nils-H

On Mon, Mar 1, 2010 at 12:12 PM, Frederik Minatchy <frederik78@(protected):
> Ok!!!!! Now I understand a little bit more!!!!!
>
> But I will ask you on last question (I hope :) )
> How can I do the same think without creating 2 independents request? It seems that the submit button is not the good choice...
>
> Thank you for your help...
>
>
>
> --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik <nilsga@(protected) :
>
>> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" <user@(protected)>
>> Date: Lundi 1 mars 2010, 11h07
>> In that case, you're talking about
>> two entirely independent requests.
>> The request for the first action is no longer accessible
>> for the
>> second action invocation. So in this case your options
>> are:
>>
>> - Store the data as request parameters that you pass on to
>> the next action
>> - Store the data in the session.
>>
>> Nils-H
>>
>>
>> On Mon, Mar 1, 2010 at 11:56 AM, Frederik Minatchy <frederik78@(protected)>
>> wrote:
>> > To go from the first action (the execute method) to
>> the second one (supprimerIsbn) I use a submit button in the
>> jsp :
>> >
>> >  <s:submit method="supprimerIsbn"
>> id="supprimerIsbn" type="submit" />
>> >
>> >
>> >
>> >
>> >
>> >
>> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
>> <nilsga@(protected)>
>> a écrit :
>> >
>> >> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" <user@(protected)>
>> >> Date: Lundi 1 mars 2010, 10h44
>> >> I'm not following the chain of
>> >> actions here... Where's the
>> >> flow/connection between the two actions?
>> >>
>> >> Nils-H
>> >>
>> >> On Mon, Mar 1, 2010 at 11:36 AM, Frederik Minatchy
>> <frederik78@(protected)>
>> >> wrote:
>> >> > Perhaps it because of me and the way I
>> understand
>> >> HTTPRequest.
>> >> >
>> >> > Here is an other example :
>> >> >
>> >> >
>> >> > in the class name :
>> >> >
>> >> >
>> >>
>> fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction
>> >> implementing ServletRequestAware interface
>> >> >
>> >> >
>> >> > when I am in the execute method I do :
>> >> >
>> >> >  public String execute() throws Exception {
>> >> >  ...
>> >> >   request.setAttribute("isbnListe",
>> >> isbnEditeurBeanById); // isbnEditeurBeanById is a
>> map
>> >> > ...
>> >> >
>> >> >    return SUCCESS;
>> >> > }
>> >> >
>> >> > and when I want to suppress element from the
>> map
>> >> stored in the request attribute
>> >> >
>> >> > I do :
>> >> >
>> >> >  public String supprimerIsbn()
>> >> > {
>> >> >   final Map<String, IsbnEditeurBean>
>> >> allEditorIsbnToRemove =  (Map<String,
>> >> IsbnEditeurBean>)
>> request.getAttribute("isbnListe"); //
>> >> is null ... why ?
>> >> >     ...
>> >> >    // remove selected elements
>> >> >
>> >> >   return "modification";
>> >> > }
>> >> >
>> >> > in my xml file I have :
>> >> >
>> >> > ...
>> >> >        <action name="editeur-detail"
>> >>
>> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
>> >> >
>> >> >                <result
>> >>
>> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp</result>
>> >> >                <result
>> name="success"
>> >> type="dispatcher">
>> >> >
>> <param
>> >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
>> >> >                </result>
>> >> >                <result
>> name="modification"
>> >> type="dispatcher">
>> >> >                        <param
>> >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
>> >> >                </result>
>> >> >                <result
>> name="supprimerISBN"
>> >> type="dispatcher">
>> >> >                        <param
>> >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
>> >> >                </result>
>> >> >        </action>
>> >> > ...
>> >> >
>> >> >
>> >> > and at least in the jsp :
>> >> >
>> >> >
>> >> > I enter in the "supprimerIsbn" method with
>> the submit
>> >> button :
>> >> > ...
>> >> > <s:submit method="supprimerIsbn"
>> id="supprimerIsbn"
>> >> type="submit" />
>> >> > ...
>> >> >
>> >> >
>> >> > It's true... I can use Session... But after
>> that I
>> >> have to clean each elements I have set in session
>> >> >
>> >> >
>> >> > I am sure that the dispatch result is a
>> solution...
>> >> but perhaps I made a mistake in the web.xml file.
>> >> >
>> >> > For example why in my url I always have
>> something
>> >> like
>> >> >
>> >> > http://localhost:8080/XXXXX/xxxxx.jsp and
>> >> not http://localhost:8080/XXXXX/xxxxx.action?
>> >> >
>> >> >
>> >> > Fred... Lost in struts2 world :(
>> >> >
>> >> >
>> >> > --- En date de : Lun 1.3.10, Nils-Helge
>> Garli Hegvik
>> >> <nilsga@(protected)>
>> >> a écrit :
>> >> >
>> >> >> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
>> >> >> Objet: Re: How to pass HTTPRequest
>> between two JSP
>> >> ?
>> >> >> À: "Struts Users Mailing List" <user@(protected)>
>> >> >> Date: Lundi 1 mars 2010, 9h50
>> >> >> Either:
>> >> >>
>> >> >> - Don't do a redirect, but a regular
>> dispatch [1]
>> >> >> - Store it in the session
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Nils-Helge Garli Hegvik
>> >> >>
>> >> >> [1] - http://struts.apache.org/2.1.8.1/docs/dispatcher-result.html
>> >> >>
>> >> >>
>> >> >> On Mon, Mar 1, 2010 at 10:40 AM, Frederik
>> Minatchy
>> >> <frederik78@(protected)>
>> >> >> wrote:
>> >> >> >
>> >> >> >
>> >> >> > --- En date de : Lun 1.3.10, Alex
>> Rodriguez
>> >> Lopez
>> >> >> <alopez@(protected)>
>> >> >> a écrit :
>> >> >> >
>> >> >> >> De: Alex Rodriguez Lopez <alopez@(protected)>
>> >> >> >> Objet: Re: How to pass
>> HTTPRequest
>> >> between two JSP
>> >> >> ?
>> >> >> >> À: "Struts Users Mailing List"
>> <user@(protected)>
>> >> >> >> Date: Lundi 1 mars 2010, 9h21
>> >> >> >> 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-unsubscribe@(protected)
>> >> >> >> > For additional commands,
>> e-mail: user-help@(protected)
>> >> >> >> >
>> >> >> >> 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-unsubscribe@(protected)
>> >> >> >> For additional commands, e-mail:
>> user-help@(protected)
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > Thank you for your answer...
>> >> >> >
>> >> >> > But as I have to manage passwords I
>> cannot
>> >> pass values
>> >> >> by using Request parameters (as they will
>> appear
>> >> in the
>> >> >> url). I am forced to use Request
>> Attributes. For
>> >> the moment
>> >> >> I am using SessionAware but it is not a
>> good
>> >> solution. Using
>> >> >> Request attributes to store values seem
>> to be a
>> >> better way.
>> >> >> (I remember that it was possible in strut
>> 1.x
>> >> wasn't it?)
>> >> >> >
>> >> >> >
>> >> >> > I have read that with Dispatch
>> result
>> >> HTTPRequest was
>> >> >> "kept" on the server and was not lost...
>> I am
>> >> trying to
>> >> >> implement things as it is written in
>> documentation
>> >> but it
>> >> >> fails...
>> >> >> >
>> >> >> > I appreciate your help...
>> >> >> >
>> >> >> > Fred
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> >> > For additional commands, e-mail: user-help@(protected)
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> >> For additional commands, e-mail: user-help@(protected)
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> > For additional commands, e-mail: user-help@(protected)
>> >> >
>> >> >
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> For additional commands, e-mail: user-help@(protected)
>> >>
>> >>
>> >
>> >
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>> > For additional commands, e-mail: user-help@(protected)
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_205190.ezm (zipped)
the submit button may be usefull to generate a password for example...
But the user is not constrained to use it... It's because of that the second page cannot be the result of the first page.




--- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik <nilsga@(protected) :

> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" <user@(protected)>
> Date: Lundi 1 mars 2010, 14h05
> That depends. What are you trying to
> do? What is the purpose of the
> submit in the first place? If you just need to execute the
> second
> action directly after the first one, then configure your
> second action
> as a result of the first action.
>
> Nils-H
>
> On Mon, Mar 1, 2010 at 12:12 PM, Frederik Minatchy <frederik78@(protected)>
> wrote:
> > Ok!!!!! Now I understand a little bit more!!!!!
> >
> > But I will ask you on last question (I hope :) )
> > How can I do the same think without creating 2
> independents request? It seems that the submit button is not
> the good choice...
> >
> > Thank you for your help...
> >
> >
> >
> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
> <nilsga@(protected)>
> a écrit :
> >
> >> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
> >> Objet: Re: How to pass HTTPRequest between two JSP
> ?
> >> À: "Struts Users Mailing List" <user@(protected)>
> >> Date: Lundi 1 mars 2010, 11h07
> >> In that case, you're talking about
> >> two entirely independent requests.
> >> The request for the first action is no longer
> accessible
> >> for the
> >> second action invocation. So in this case your
> options
> >> are:
> >>
> >> - Store the data as request parameters that you
> pass on to
> >> the next action
> >> - Store the data in the session.
> >>
> >> Nils-H
> >>
> >>
> >> On Mon, Mar 1, 2010 at 11:56 AM, Frederik Minatchy
> <frederik78@(protected)>
> >> wrote:
> >> > To go from the first action (the execute
> method) to
> >> the second one (supprimerIsbn) I use a submit
> button in the
> >> jsp :
> >> >
> >> >  <s:submit method="supprimerIsbn"
> >> id="supprimerIsbn" type="submit" />
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --- En date de : Lun 1.3.10, Nils-Helge
> Garli Hegvik
> >> <nilsga@(protected)>
> >> a écrit :
> >> >
> >> >> De: Nils-Helge Garli Hegvik <nilsga@(protected)>
> >> >> Objet: Re: How to pass HTTPRequest
> between two JSP
> >> ?
> >> >> À: "Struts Users Mailing List" <user@(protected)>
> >> >> Date: Lundi 1 mars 2010, 10h44
> >> >> I'm not following the chain of
> >> >> actions here... Where's the
> >> >> flow/connection between the two actions?
> >> >>
> >> >> Nils-H
> >> >>
> >> >> On Mon, Mar 1, 2010 at 11:36 AM, Frederik
> Minatchy
> >> <frederik78@(protected)>
> >> >> wrote:
> >> >> > Perhaps it because of me and the way
> I
> >> understand
> >> >> HTTPRequest.
> >> >> >
> >> >> > Here is an other example :
> >> >> >
> >> >> >
> >> >> > in the class name :
> >> >> >
> >> >> >
> >> >>
> >>
> fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction
> >> >> implementing ServletRequestAware
> interface
> >> >> >
> >> >> >
> >> >> > when I am in the execute method I do
> :
> >> >> >
> >> >> >  public String execute() throws
> Exception {
> >> >> >  ...
> >> >> >  
> request.setAttribute("isbnListe",
> >> >> isbnEditeurBeanById); //
> isbnEditeurBeanById is a
> >> map
> >> >> > ...
> >> >> >
> >> >> >    return SUCCESS;
> >> >> > }
> >> >> >
> >> >> > and when I want to suppress element
> from the
> >> map
> >> >> stored in the request attribute
> >> >> >
> >> >> > I do :
> >> >> >
> >> >> >  public String supprimerIsbn()
> >> >> > {
> >> >> >   final Map<String,
> IsbnEditeurBean>
> >> >> allEditorIsbnToRemove =
>  (Map<String,
> >> >> IsbnEditeurBean>)
> >> request.getAttribute("isbnListe"); //
> >> >> is null ... why ?
> >> >> >     ...
> >> >> >    // remove selected elements
> >> >> >
> >> >> >   return "modification";
> >> >> > }
> >> >> >
> >> >> > in my xml file I have :
> >> >> >
> >> >> > ...
> >> >> >        <action
> name="editeur-detail"
> >> >>
> >>
> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
> >> >> >
> >> >> >                <result
> >> >>
> >>
> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp</result>
> >> >> >                <result
> >> name="success"
> >> >> type="dispatcher">
> >> >> >
> >> <param
> >> >>
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
> >> >> >              
>  </result>
> >> >> >                <result
> >> name="modification"
> >> >> type="dispatcher">
> >> >> >                      
>  <param
> >> >>
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
> >> >> >              
>  </result>
> >> >> >                <result
> >> name="supprimerISBN"
> >> >> type="dispatcher">
> >> >> >                      
>  <param
> >> >>
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp</param>
> >> >> >              
>  </result>
> >> >> >        </action>
> >> >> > ...
> >> >> >
> >> >> >
> >> >> > and at least in the jsp :
> >> >> >
> >> >> >
> >> >> > I enter in the "supprimerIsbn"
> method with
> >> the submit
> >> >> button :
> >> >> > ...
> >> >> > <s:submit method="supprimerIsbn"
> >> id="supprimerIsbn"
> >> >> type="submit" />
> >> >> > ...
> >> >> >
> >> >> >
> >> >> > It's true... I can use Session...
> But after
> >> that I
> >> >> have to clean each elements I have set in
> session
> >> >> >
> >> >> >
> >> >> > I am sure that the dispatch result
> is a
> >> solution...
> >> >> but perhaps I made a mistake in the
> web.xml file.
> >> >> >
> >> >> > For example why in my url I always
> have
> >> something
> >> >> like
> >> >> >
> >> >> > http://localhost:8080/XXXXX/xxxxx.jsp and
> >> >> not http://localhost:8080/XXXXX/xxxxx.action?
> >> >> >
> >> >> >
> >> >> > Fred... Lost in struts2 world :(
> >> >> >
> >> >> >
> >> >> > --- En date de : Lun 1.3.10,
> Nils-Helge
> >> Garli Hegvik
> >> >> <nilsga@(protected)>
> >> >> a écrit :
> >> >> >
> >> >> >> De: Nils-Helge Garli Hegvik
> <nilsga@(protected)>
> >> >> >> Objet: Re: How to pass
> HTTPRequest
> >> between two JSP
> >> >> ?
> >> >> >> À: "Struts Users Mailing List"
> <user@(protected)>
> >> >> >> Date: Lundi 1 mars 2010, 9h50
> >> >> >> Either:
> >> >> >>
> >> >> >> - Don't do a redirect, but a
> regular
> >> dispatch [1]
> >> >> >> - Store it in the session
> >> >> >>
> >> >> >> Regards,
> >> >> >>
> >> >> >> Nils-Helge Garli Hegvik
> >> >> >>
> >> >> >> [1] - http://struts.apache.org/2.1.8.1/docs/dispatcher-result.html
> >> >> >>
> >> >> >>
> >> >> >> On Mon, Mar 1, 2010 at 10:40 AM,
> Frederik
> >> Minatchy
> >> >> <frederik78@(protected)>
> >> >> >> wrote:
> >> >> >> >
> >> >> >> >
> >> >> >> > --- En date de : Lun
> 1.3.10, Alex
> >> Rodriguez
> >> >> Lopez
> >> >> >> <alopez@(protected)>
> >> >> >> a écrit :
> >> >> >> >
> >> >> >> >> De: Alex Rodriguez
> Lopez <alopez@(protected)>
> >> >> >> >> Objet: Re: How to pass
> >> HTTPRequest
> >> >> between two JSP
> >> >> >> ?
> >> >> >> >> À: "Struts Users
> Mailing List"
> >> <user@(protected)>
> >> >> >> >> Date: Lundi 1 mars
> 2010, 9h21
> >> >> >> >> 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-unsubscribe@(protected)
> >> >> >> >> > For additional
> commands,
> >> e-mail: user-help@(protected)
> >> >> >> >> >
> >> >> >> >> 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-unsubscribe@(protected)
> >> >> >> >> For additional
> commands, e-mail:
> >> user-help@(protected)
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > Thank you for your
> answer...
> >> >> >> >
> >> >> >> > But as I have to manage
> passwords I
> >> cannot
> >> >> pass values
> >> >> >> by using Request parameters (as
> they will
> >> appear
> >> >> in the
> >> >> >> url). I am forced to use
> Request
> >> Attributes. For
> >> >> the moment
> >> >> >> I am using SessionAware but it
> is not a
> >> good
> >> >> solution. Using
> >> >> >> Request attributes to store
> values seem
> >> to be a
> >> >> better way.
> >> >> >> (I remember that it was possible
> in strut
> >> 1.x
> >> >> wasn't it?)
> >> >> >> >
> >> >> >> >
> >> >> >> > I have read that with
> Dispatch
> >> result
> >> >> HTTPRequest was
> >> >> >> "kept" on the server and was not
> lost...
> >> I am
> >> >> trying to
> >> >> >> implement things as it is
> written in
> >> documentation
> >> >> but it
> >> >> >> fails...
> >> >> >> >
> >> >> >> > I appreciate your help...
> >> >> >> >
> >> >> >> > Fred
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >

> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> >> >> > For additional commands,
> e-mail: user-help@(protected)
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> >> >> For additional commands, e-mail:
> user-help@(protected)
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> >> > For additional commands, e-mail: user-help@(protected)
> >> >> >
> >> >> >
> >> >>
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> >> For additional commands, e-mail: user-help@(protected)
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> > For additional commands, e-mail: user-help@(protected)
> >> >
> >> >
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>





Attachment: user_205191.ezm (zipped)
Not so bad... But I have the impression it would be complicated to apply on my source... Because we have nearly finish and they will kill me if I touch too much objects :)

--- En date de : Lun 1.3.10, Martin Gainty <mgainty@(protected) :

> De: Martin Gainty <mgainty@(protected)>
> Objet: RE: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" <user@(protected)>
> Date: Lundi 1 mars 2010, 13h57
>
> one way is to package a bean which contains a method which
> will get or post the request e.g.
>
> <%@(protected)
> contentType="text/html;charset=windows-1252"%>
> <jsp:useBean id="axiomclient" scope="application"
> class="gov.fmcsa.wribosservice.client.AXIOMClient" />
>
> <html>
>
>         <td width="77%"
> valign="center"><p><%=axiomclient.CallTheURL(object,request)%>
> </p><p>&nbsp;</p></td>
> </html>
>
>
>
> //sample code
>
> AXIOMClient extends ABunchOfClasses implements
> ABunchOfInterfaces
>
> {
>
> public static void callTheURL(Object
> object,javax.servlet.http.HttpServletRequest request)
>
> {
>
>   httpost=httpost_param; //save a local copy
>   org.apache.http.HttpResponse response_from_post =
> null;
>   org.apache.http.client.HttpClient httpclient = new
> org.apache.http.impl.client.DefaultHttpClient();
>
>   java.lang.String port="8007";
>   java.lang.String host="localhost";
>   java.lang.String protocol="http";
>
>   java.lang.String response_from_client="null
> response";
>   java.lang.String targetEndpoint=new String("http://localhost:8007/CommInterface2/servlet/Comminterface2Servlet");
>
>
>
> //GET 
>
>   org.apache.http.client.methods.HttpGet httpget = new
> org.apache.http.client.methods.HttpGet(targetEndpoint);
>   try
>   {
>    httpget.addHeader("gov.fmcsa.wribosservice.client.WRIBOSServiceStub$SubmitmsgRequest",object.toString());
>   }
>   catch(Exception excp)
>   {
>     if (debug) System.out.println("AXIOMClient
> produces Exception produced for
> httpget.addHeader(gov.fmcsa.wribosservice.client.WRIBOSServiceStub$SubmitmsgRequest,object.toString())");
>   }
>
>
>
> //POST
>
>         String resp=null;
>
>         try
>         {
>
>    org.apache.http.HttpHost target = new
> org.apache.http.HttpHost("http://localhhost:8007/servlet/Comminterface2Servlet/");
>
> // general setup
>  
>    org.apache.http.conn.scheme.SchemeRegistry
> supportedSchemes = new
> org.apache.http.conn.scheme.SchemeRegistry();
>
> // Register the "http" protocol scheme, it is required
> // by the default operator to look up socket factories.
>      supportedSchemes.register(new
> org.apache.http.conn.scheme.Scheme("http",org.apache.http.conn.scheme.PlainSocketFactory.getSocketFactory(),
> 8007));
>
> // prepare parameters
>    org.apache.http.params.HttpParams params
> = new org.apache.http.params.BasicHttpParams();
>
>    org.apache.http.params.HttpProtocolParams.setVersion(params,
> org.apache.http.HttpVersion.HTTP_1_1);
>
>    org.apache.http.params.HttpProtocolParams.setContentCharset(params,
> "UTF-16");
>
>    org.apache.http.params.HttpProtocolParams.setUseExpectContinue(params,
> true);
>
>    org.apache.http.conn.ClientConnectionManager
> connMgr = new   
> org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager(params,supportedSchemes);
>
>     httpclient = new
> org.apache.http.impl.client.DefaultHttpClient(connMgr,
> params);
>
>     httpget = new
> org.apache.http.client.methods.HttpGet(targetEndpoint);
>
>     httpget.addHeader("key",object.toString());
>
>     httpost = new
> org.apache.http.client.methods.HttpPost("http://localhost:8007/CommInterface2/servlet/Comminterface2Servlet");
>
> //roll thru the params and add in
>          nvps = new
> java.util.ArrayList
> <org.apache.http.NameValuePair>();
>
>          nvps.add(new
> org.apache.http.message.BasicNameValuePair("submitmsgRequest",
> object.toString() ));
>
>
>      
>    httpost.setEntity(new
> org.apache.http.client.entity.UrlEncodedFormEntity(nvps,
> "UTF-8"));
>
>      
>    set_httppost(object.toString());
>
>
>          if (debug==true)
> System.out.println("AXIOMClient !!!!!!!!!!!About to call the
> server!!!!!!!!!!!");
>      
>    response_from_post=httpclient.execute(httpost);
>
>      
>    if(response_from_post!=null)
>          {
>             //acquire the
> entity
>            
> org.apache.http.HttpEntity entity =
> response_from_post.getEntity();
>
>      
>    
>    //response_client=org.apache.http.util.EntityUtils.toByteArray(entity);
>            
> previous_label_str=null;
>            
> submitMsgCounter=0;
>             i=0;
>             label_ctr=0;
>             value_ctr=0;
>            
> java.util.HashMap<String,String>
> returned_hashmap=ReturnBackFormattedList(org.apache.http.util.EntityUtils.toString(entity));
>             String
> delimiterToAppend=new String("<br>");
>            
> response_from_client =
> FormatTheHashMapAndReturnString(returned_hashmap,delimiterToAppend);
>       }
>     return response_from_client;
>
> }
>
>
>
> HTH
> Martin Gainty
> ______________________________________________
> Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
> Vertraulichkeitanmerkung/Note de déni et de
> confidentialité
>
>
>
> Ez az üzenet bizalmas.  Ha nem ön az akinek szánva
> volt, akkor kérjük, hogy jelentse azt nekünk vissza.
> Semmiféle továbbítása vagy másolatának készítése
> nem megengedett.  Ez az üzenet csak ismeret cserét
> szolgál és semmiféle jogi alkalmazhatósága sincs. 
> Mivel az electronikus üzenetek könnyen
> megváltoztathatóak, ezért minket semmi felelöség nem
> terhelhet ezen üzenet tartalma miatt.
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der
> vorgesehene Empfaenger sein, so bitten wir hoeflich um eine
> Mitteilung. Jede unbefugte Weiterleitung oder Fertigung
> einer Kopie ist unzulaessig. Diese Nachricht dient lediglich
> dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten
> Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer
> den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si
> vous n'êtes pas le destinataire prévu, nous te demandons
> avec bonté que pour satisfaire informez l'expéditeur.
> N'importe quelle diffusion non autorisée ou la copie de
> ceci est interdite. Ce message sert à l'information
> seulement et n'aura pas n'importe quel effet légalement
> obligatoire. Étant donné que les email peuvent facilement
> être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>
> > Date: Sun, 28 Feb 2010 15:26:28 -0800
> > From: frederik78@(protected)
> > Subject: How to pass HTTPRequest between two JSP ?
> > To: user@(protected)
> >
> > 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-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
>    
>         
>           
>  
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> http://clk.atdmt.com/GBL/go/201469230/direct/01/




©2008 gg3721.com - Jax Systems, LLC, U.S.A.