Struts 2 release inquiry

2010-03-01 Thread Jevica Arianne B. Zurbano

Hi,

Is there a plan of releasing 2.0.15?

Thanks in advance!

--


Jev


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



Re: Inserting data into nested collections

2010-03-01 Thread Alex
Thanks Adam for the fast reply.

I'm not sure howver that your solution would solve my problem. I'll try to
inspire from it however : )

I found this issue which looks pretty much related to my problem :

http://jira.opensymphony.com/browse/XW-408

Is this a known issue in Struts 2  and OGNL ?

Thansk you for your help and suggestions !


RE: Inserting data into nested collections

2010-03-01 Thread adam pinder

 
Alex,
 
i used the following and it worked ok with struts2.
 
In JSP :-
 


In Action, i have a get/set for opportunity which is an object with the 
following property (with get/setters)
 
 private Collection opportunityItems = new ArrayList(0);

and the following additional method in the opportunity class
 
  public OpportunityItem getOpportunityItem(int occ)
  {
   Collection coll = this.getOpportunityItems();
   Object[] objs = coll.toArray();
   
   OpportunityItem oppItem = null;
   if (objs[occ] instanceof OpportunityItem)
   {
oppItem = (OpportunityItem)objs[occ]; 
   }
   
   return oppItem;
  }

you could cast the collection to ArrayList and use .get(occ) but i wanted to be 
able to change collection type.
 
struts2 then takes "opportunity.opportunityItem[0].quantity" and does...
 
getOpportunity().getOpportunityItem(0).setQuantity(12)
 
i've found the utility methods are sometimes needed to handle arrays.
 
if it was just a repeating field you could define a String[] and have the 
fields with the same name and struts would populate it for you.
 
regards
adam  
_
Do you have a story that started on Hotmail? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Inserting data into nested collections

2010-03-01 Thread Alex
Hi list,


I am having hard time figuring out how to solve what seems to be a somewhat
trivial problem ...

I am using Struts 2 and OGNL in my JSP to send textfield values in my Action
Class

The struts Action looks something like this :

public class MyAction extends ActionSupport {

   HashMap> customAltTerms = new
HashMap>();

   /**
* @return the customAltTerms
*/
   public HashMap> getCustomAltTerms() {
   return customAltTerms;
   }

   /**
* @param customAltTerms the customAltTerms to set
*/
   public void setCustomAltTerms(HashMap<
String, ArrayList> customAltTerms) {
   this.customAltTerms = customAltTerms;
   }


public String execute() throws Exception{

 some code here to test what's in the hashmap after the form has been
submited

}

  other methods of the Action class


}



I am unable to insert the data collected from the textfields of the form
into the HashMap.


I have tried the following in my JSP :




or




or



or




I almost always end up with java.lang.String cannot be cast to
java.util.ArrayList
java.lang.ClassCastException: java.lang.String cannot be cast to
java.util.ArrayList
etc ...

I also tried replacing the ArrayList with a String[] with the same result
(ClassCastException).

However if I use a HashMap the key and the value are
populated correctly.But of course I only get one value per key which is not
what I intend to do.

What syntax must I use in the "name" attribute of the textfield to have the
actual value of the textefield inserted in the ArrayList containend in the
HashMap for the given key?


Thank you for helping me.


Action tag: execute method not being called

2010-03-01 Thread adam pinder

 
BACKGROUND:
 
I have the following line in a jsp page that is shown after login
 
findMyActivityYes
 
This action simply gathers data and stores it in a session object.
 
Later on in the same jsp page i then have lines like
 

 
The GenerateChart action uses the session object (from TeamActivity action) 
containing the data to render a pie chart - the reason for the session object 
is that i call several GenerateChart actions from this page rendering various 
charts all from the same data and thought it was more efficient than retrieving 
the data each time.
 
PROBLEM:
 
In Internet Explorer and Firefox all works well, i can see the TeamActivity 
action parameters being passed, the prepare, validate and execute methods 
firing, the data is retrieved and i get all the charts displayed.
 
In Safari (trying to be iphone friendly) the parameters are passed, prepare and 
validate methods fire but the execute method is not called. I have even removed 
all content from validate method (in case some parameter is invalid now) and 
still execute method doesn't get called.
 
I thought this processing was purely server side so i don't understand why 
Safari makes any difference.
 
Any thoughts on why Safari is having this influence gratefully received.
 
thanks
adam
  
_
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Frederik Minatchy
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  a écrit :

> De: Martin Gainty 
> Objet: RE: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" 
> 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.
> 
> <%@ page
> contentType="text/html;charset=windows-1252"%>
>  class="gov.fmcsa.wribosservice.client.AXIOMClient" />
> 
> 
> 
>          valign="center"><%=axiomclient.CallTheURL(object,request)%>
>  
> 
> 
>  
> 
> //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
> ();
> 
>          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
> returned_hashmap=ReturnBackFormattedList(org.apache.http.util.EntityUtils.toString(entity));
>             String
> delimiterToAppend=new String("");
>            
> 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
> confidentia

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Frederik Minatchy
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  a 
écrit :

> De: Nils-Helge Garli Hegvik 
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" 
> 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 
> 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
> 
> a écrit :
> >
> >> De: Nils-Helge Garli Hegvik 
> >> Objet: Re: How to pass HTTPRequest between two JSP
> ?
> >> À: "Struts Users Mailing List" 
> >> 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
> 
> >> wrote:
> >> > To go from the first action (the execute
> method) to
> >> the second one (supprimerIsbn) I use a submit
> button in the
> >> jsp :
> >> >
> >> >   >> id="supprimerIsbn" type="submit" />
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --- En date de : Lun 1.3.10, Nils-Helge
> Garli Hegvik
> >> 
> >> a écrit :
> >> >
> >> >> De: Nils-Helge Garli Hegvik 
> >> >> Objet: Re: How to pass HTTPRequest
> between two JSP
> >> ?
> >> >> À: "Struts Users Mailing List" 
> >> >> 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
> >> 
> >> >> 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 IsbnEditeurBean>
> >> >> allEditorIsbnToRemove =
>  (Map >> >> IsbnEditeurBean>)
> >> request.getAttribute("isbnListe"); //
> >> >> is null ... why ?
> >> >> >     ...
> >> >> >    // remove selected elements
> >> >> >
> >> >> >   return "modification";
> >> >> > }
> >> >> >
> >> >> > in my xml file I have :
> >> >> >
> >> >> > ...
> >> >> >         name="editeur-detail"
> >> >>
> >>
> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
> >> >> >
> >> >> >                 >> >>
> >>
> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >> >                 >> name="success"
> >> >> type="dispatcher">
> >> >> >
> >>  >> >>
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >> >              
>  
> >> >> >                 >> name="modification"
> >> >> type="dispatcher">
> >> >> >                      
>   >> >>
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >> >              
>  
> >> >> >                 >> name="supprimerISBN"
> >> >> type="dispatcher">
> >> >> >                      
>   >> >>
> >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >> >              
>  
> >> >> >        
> >> >> > ...
> >> >> >
> >> >> >
> >> >> > and at least in the jsp :
> >> >> >
> >> >> >
> >> >> > I enter in the "supprimerIsbn"
> method with
> >> the submit
> >> >> button :
> >> >> > ...
> >> >> >  >> id="supprimerIsbn"
> >> >> type="submit" />
> >> >> > ...
> >> >> >
> >> >> >
> >> >> > It's true... I can use Session...
> But after
> >> that I
> >> >> have to clean each elements I have set in
>

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
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  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  a 
> écrit :
>
>> De: Nils-Helge Garli Hegvik 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> 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 
>> wrote:
>> > To go from the first action (the execute method) to
>> the second one (supprimerIsbn) I use a submit button in the
>> jsp :
>> >
>> >  > id="supprimerIsbn" type="submit" />
>> >
>> >
>> >
>> >
>> >
>> >
>> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
>> 
>> a écrit :
>> >
>> >> De: Nils-Helge Garli Hegvik 
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" 
>> >> 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
>> 
>> >> 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
>> >> allEditorIsbnToRemove =  (Map> >> IsbnEditeurBean>)
>> request.getAttribute("isbnListe"); //
>> >> is null ... why ?
>> >> >     ...
>> >> >    // remove selected elements
>> >> >
>> >> >   return "modification";
>> >> > }
>> >> >
>> >> > in my xml file I have :
>> >> >
>> >> > ...
>> >> >        > >>
>> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
>> >> >
>> >> >                > >>
>> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >> >                > name="success"
>> >> type="dispatcher">
>> >> >
>> > >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >> >                
>> >> >                > name="modification"
>> >> type="dispatcher">
>> >> >                        > >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >> >                
>> >> >                > name="supprimerISBN"
>> >> type="dispatcher">
>> >> >                        > >>
>> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >> >                
>> >> >        
>> >> > ...
>> >> >
>> >> >
>> >> > and at least in the jsp :
>> >> >
>> >> >
>> >> > I enter in the "supprimerIsbn" method with
>> the submit
>> >> button :
>> >> > ...
>> >> > > 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/X/x.jsp and
>> >> not http://localhost:8080/X/x.action?
>> >> >
>> >> >
>> >> > Fred... Lost in struts2 world :(
>> >> >
>> >> >
>> >> > --- En date de : Lun 1.3.10, Nils-Helge
>> Garli Hegvik
>> >> 
>> >> a écrit :
>> >> >
>> >> >> De: Nils-Helge Garli Hegvik 
>> >> >> Objet: Re: How to pass HTTPRequest
>> between two JSP
>> >> ?
>> >> >> À: "Struts Users Mailing List" 
>> >> >> Date: Lundi 1 mars 2010, 9h50
>> >> >> Either:
>> >> >>
>> >> >> - Don't do a redirect, but a regular
>> dispatch [1]
>> >> >> - Store it in the session
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Nils-He

RE: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Martin Gainty

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

<%@ page contentType="text/html;charset=windows-1252"%>




<%=axiomclient.CallTheURL(object,request)%> 
 


 

//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 ();

 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 
returned_hashmap=ReturnBackFormattedList(org.apache.http.util.EntityUtils.toString(entity));
String delimiterToAppend=new String("");
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 

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Frederik Minatchy
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  a 
écrit :

> De: Nils-Helge Garli Hegvik 
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" 
> 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 
> wrote:
> > To go from the first action (the execute method) to
> the second one (supprimerIsbn) I use a submit button in the
> jsp :
> >
> >   id="supprimerIsbn" type="submit" />
> >
> >
> >
> >
> >
> >
> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
> 
> a écrit :
> >
> >> De: Nils-Helge Garli Hegvik 
> >> Objet: Re: How to pass HTTPRequest between two JSP
> ?
> >> À: "Struts Users Mailing List" 
> >> 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
> 
> >> 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
> >> allEditorIsbnToRemove =  (Map >> IsbnEditeurBean>)
> request.getAttribute("isbnListe"); //
> >> is null ... why ?
> >> >     ...
> >> >    // remove selected elements
> >> >
> >> >   return "modification";
> >> > }
> >> >
> >> > in my xml file I have :
> >> >
> >> > ...
> >> >         >>
> class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
> >> >
> >> >                 >>
> name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >                 name="success"
> >> type="dispatcher">
> >> >                        
>  >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >                
> >> >                 name="modification"
> >> type="dispatcher">
> >> >                         >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >                
> >> >                 name="supprimerISBN"
> >> type="dispatcher">
> >> >                         >>
> name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >> >                
> >> >        
> >> > ...
> >> >
> >> >
> >> > and at least in the jsp :
> >> >
> >> >
> >> > I enter in the "supprimerIsbn" method with
> the submit
> >> button :
> >> > ...
> >> >  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/X/x.jsp and
> >> not http://localhost:8080/X/x.action?
> >> >
> >> >
> >> > Fred... Lost in struts2 world :(
> >> >
> >> >
> >> > --- En date de : Lun 1.3.10, Nils-Helge
> Garli Hegvik
> >> 
> >> a écrit :
> >> >
> >> >> De: Nils-Helge Garli Hegvik 
> >> >> Objet: Re: How to pass HTTPRequest
> between two JSP
> >> ?
> >> >> À: "Struts Users Mailing List" 
> >> >> 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
> >> 
> >> >> wrote:
> >> >> >
> >> >> >
> >> >> > --- En date de : Lun 1.3.10, Alex
> Rodriguez
> >> Lopez
> >> >> 
> >> >> a écrit :
> >> >> >
> >> >> >> De: Alex Rodriguez Lopez 
> >> >> >> Objet: Re: How to pass
> HTTPRequest
> >> between two JSP
> >> >> ?
> >> >> >> À: "Struts Users Mailing List"
>

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
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  wrote:
> To go from the first action (the execute method) to the second one 
> (supprimerIsbn) I use a submit button in the jsp :
>
>  
>
>
>
>
>
>
> --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
> écrit :
>
>> De: Nils-Helge Garli Hegvik 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> 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 
>> 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
>> allEditorIsbnToRemove =  (Map> IsbnEditeurBean>) request.getAttribute("isbnListe"); //
>> is null ... why ?
>> >     ...
>> >    // remove selected elements
>> >
>> >   return "modification";
>> > }
>> >
>> > in my xml file I have :
>> >
>> > ...
>> >        > class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
>> >
>> >                > name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                > type="dispatcher">
>> >                         > name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                
>> >                > type="dispatcher">
>> >                        > name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                
>> >                > type="dispatcher">
>> >                        > name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>> >                
>> >        
>> > ...
>> >
>> >
>> > and at least in the jsp :
>> >
>> >
>> > I enter in the "supprimerIsbn" method with the submit
>> button :
>> > ...
>> > > 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/X/x.jsp and
>> not http://localhost:8080/X/x.action?
>> >
>> >
>> > Fred... Lost in struts2 world :(
>> >
>> >
>> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
>> 
>> a écrit :
>> >
>> >> De: Nils-Helge Garli Hegvik 
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" 
>> >> 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
>> 
>> >> wrote:
>> >> >
>> >> >
>> >> > --- En date de : Lun 1.3.10, Alex Rodriguez
>> Lopez
>> >> 
>> >> a écrit :
>> >> >
>> >> >> De: Alex Rodriguez Lopez 
>> >> >> Objet: Re: How to pass HTTPRequest
>> between two JSP
>> >> ?
>> >> >> À: "Struts Users Mailing List" 
>> >> >> 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 :
>> >> >> >
>> >> >> > ...
>> >> >> > 
>> >> >> >
>> >> >>
>> struts2
>> >> >> >
>> >> >>
>> >>
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>> >> >> >      
>> >> >> >     
>> >> >> >
>> >> >>
>> struts2
>> >> >> >
>> >> >>
>> /*
>> >> >> >     
>> >> >> > ...
>> >> >> >
>> >> >> >
>> >> >> > the struts.xml file :
>> >> >> >
>> >> >> > ...
>> >> >> >
>> >> >> > > >> >>
>> >>
>> class="fr.bnf.platon.bnf.actions.

Re: struts 2 token interceptor problem

2010-03-01 Thread andreistoiculescu

Hi,

Maybe you are caching web pages, either through explicit HTTP headers sent
from the web server to the client, invisible in the HTML code, or in the
Head section of your HTML pages, through the "meta" tags. If this is the
case, the token interceptor will probably return a valid response only the
first time the page is rendered, because a new token will not be computed,
but the old one will be resubmitted.

Andrei


repuken2 wrote:
> 
> Hi,
> 
> i'm having trouble with token interceptor, i'm using struts 2.1.8.1 with
> eclipse and glassfish V3. 
> ***we're using struts 1 plugin***  , we're migrating an old project wich
> used struts 1 and so far everything is working ok, fileupload interceptor,
> forms, etc. but toke-interceptor stuff. When goin from an action to
> another that is protected-affected by this token-interceptor ( the jsp has
> the  tag and the config.xml is properly configured having the
> interceptor-ref token in the corresponding action) the interceptor indeed
> works and interceps but it always return invalid.token result. The action
> never executes as the application flow is interrupted at the interceptor
> stage.
> 
> Has anybody experimented something similar? using struts 1 plugin or not?
> does it have to do with this plugin and it would work using pure struts 2?
> ( don't ask me why but we need this up and working with the S1 plugin) ,
> any ideas??
> 
> Cheerz and thanks in advance,
> 
> best regards.
> 
> Manuel
> 

-- 
View this message in context: 
http://old.nabble.com/struts-2-token-interceptor-problem-tp27714506p27742169.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Axis2 1.4.1, Struts 1.2.9 and Weblogic 8.1. Problem in the deployment if the application is stressed.

2010-03-01 Thread Triquoit Mathieu
Hello,

I have an application which runs under Weblogic 8.1SP3 (Solaris) and it uses
Axis 2 1.4.1 to expose a webservice. The application (which is a web-based
application) contains also Struts 1.2.9.

When we deploy the application without traffic to the application in
production, there is no problem. But if the application (under deployment)
receives a lot of requests, my Struts servlet is not correctly initialized.
I have this problem since we have migrated from Axis 1.4 to Axis2 1.4.1.

Do you know if there is something in a library or somewhere else which can
produce this error ?

Thanks in advance,
Best regards,

Mathieu


Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Frederik Minatchy
To go from the first action (the execute method) to the second one 
(supprimerIsbn) I use a submit button in the jsp :

 






--- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
écrit :

> De: Nils-Helge Garli Hegvik 
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" 
> 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 
> 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
> allEditorIsbnToRemove =  (Map IsbnEditeurBean>) request.getAttribute("isbnListe"); //
> is null ... why ?
> >     ...
> >    // remove selected elements
> >
> >   return "modification";
> > }
> >
> > in my xml file I have :
> >
> > ...
> >         class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction"
> >
> >                 name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >                 type="dispatcher">
> >                          name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >                
> >                 type="dispatcher">
> >                         name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >                
> >                 type="dispatcher">
> >                         name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
> >                
> >        
> > ...
> >
> >
> > and at least in the jsp :
> >
> >
> > I enter in the "supprimerIsbn" method with the submit
> button :
> > ...
> >  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/X/x.jsp and
> not http://localhost:8080/X/x.action?
> >
> >
> > Fred... Lost in struts2 world :(
> >
> >
> > --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik
> 
> a écrit :
> >
> >> De: Nils-Helge Garli Hegvik 
> >> Objet: Re: How to pass HTTPRequest between two JSP
> ?
> >> À: "Struts Users Mailing List" 
> >> 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
> 
> >> wrote:
> >> >
> >> >
> >> > --- En date de : Lun 1.3.10, Alex Rodriguez
> Lopez
> >> 
> >> a écrit :
> >> >
> >> >> De: Alex Rodriguez Lopez 
> >> >> Objet: Re: How to pass HTTPRequest
> between two JSP
> >> ?
> >> >> À: "Struts Users Mailing List" 
> >> >> 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 :
> >> >> >
> >> >> > ...
> >> >> > 
> >> >> >
> >> >>
> struts2
> >> >> >
> >> >>
> >>
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
> >> >> >      
> >> >> >     
> >> >> >
> >> >>
> struts2
> >> >> >
> >> >>
> /*
> >> >> >     
> >> >> > ...
> >> >> >
> >> >> >
> >> >> > the struts.xml file :
> >> >> >
> >> >> > ...
> >> >> >
> >> >> >  >> >>
> >>
> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
> >> >> >
> >> >>  >> >>
> >>
> name="success">/pages/bnf/administration/detailBnf.jsp
> >> >> >         
> >> >> >
> >> >> >
> >> >> >
> >> >> >          >> >> name="bnf-detail_modification"
> >> >>
> >>
> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction"
> >> >> method="modificationSubmit">
> >> >> >
> >> >>  >> >>
> >>
> name="success">/pages/bnf/administration/detailBnf.jsp
> >> >> >         
> >> >> > ...
> >> >> >
> >> >> > and a part of the action java file
> (which
> >> >> implementents RequestAware):
> >> >> >
> >> >> >    public

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
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  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 allEditorIsbnToRemove =  (Map IsbnEditeurBean>) request.getAttribute("isbnListe"); // is null ... why ?
>     ...
>    // remove selected elements
>
>   return "modification";
> }
>
> in my xml file I have :
>
> ...
>         class="fr.bnf.platon.bnf.actions.ConsultationEditeurDetailAction" >
>                 name="input">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>                          name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>                
>                         name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>                
>                         name="location">/pages/bnf/consultationDemandes/detailEditeur.jsp
>                
>        
> ...
>
>
> and at least in the jsp :
>
>
> I enter in the "supprimerIsbn" method with the submit button :
> ...
> 
> ...
>
>
> 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/X/x.jsp and not 
> http://localhost:8080/X/x.action?
>
>
> Fred... Lost in struts2 world :(
>
>
> --- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
> écrit :
>
>> De: Nils-Helge Garli Hegvik 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> 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 
>> wrote:
>> >
>> >
>> > --- En date de : Lun 1.3.10, Alex Rodriguez Lopez
>> 
>> a écrit :
>> >
>> >> De: Alex Rodriguez Lopez 
>> >> Objet: Re: How to pass HTTPRequest between two JSP
>> ?
>> >> À: "Struts Users Mailing List" 
>> >> 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 :
>> >> >
>> >> > ...
>> >> > 
>> >> >
>> >> struts2
>> >> >
>> >>
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>> >> >      
>> >> >     
>> >> >
>> >> struts2
>> >> >
>> >> /*
>> >> >     
>> >> > ...
>> >> >
>> >> >
>> >> > the struts.xml file :
>> >> >
>> >> > ...
>> >> >
>> >> > > >>
>> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
>> >> >
>> >> > >>
>> name="success">/pages/bnf/administration/detailBnf.jsp
>> >> >         
>> >> >
>> >> >
>> >> >
>> >> >         > >> name="bnf-detail_modification"
>> >>
>> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction"
>> >> method="modificationSubmit">
>> >> >
>> >> > >>
>> name="success">/pages/bnf/administration/detailBnf.jsp
>> >> >         
>> >> > ...
>> >> >
>> >> > 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 redire

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Frederik Minatchy
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 allEditorIsbnToRemove =  (Map) request.getAttribute("isbnListe"); // is null ... why ?
 ... 
// remove selected elements 

   return "modification";
}

in my xml file I have :

...

/pages/bnf/consultationDemandes/detailEditeur.jsp

 /pages/bnf/consultationDemandes/detailEditeur.jsp


/pages/bnf/consultationDemandes/detailEditeur.jsp


/pages/bnf/consultationDemandes/detailEditeur.jsp
   

...


and at least in the jsp :


I enter in the "supprimerIsbn" method with the submit button :
...
 
...


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/X/x.jsp and not 
http://localhost:8080/X/x.action?


Fred... Lost in struts2 world :(


--- En date de : Lun 1.3.10, Nils-Helge Garli Hegvik  a 
écrit :

> De: Nils-Helge Garli Hegvik 
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" 
> 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 
> wrote:
> >
> >
> > --- En date de : Lun 1.3.10, Alex Rodriguez Lopez
> 
> a écrit :
> >
> >> De: Alex Rodriguez Lopez 
> >> Objet: Re: How to pass HTTPRequest between two JSP
> ?
> >> À: "Struts Users Mailing List" 
> >> 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 :
> >> >
> >> > ...
> >> > 
> >> >
> >> struts2
> >> >
> >>
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
> >> >      
> >> >     
> >> >
> >> struts2
> >> >
> >> /*
> >> >     
> >> > ...
> >> >
> >> >
> >> > the struts.xml file :
> >> >
> >> > ...
> >> >
> >> >  >>
> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
> >> >
> >>  >>
> name="success">/pages/bnf/administration/detailBnf.jsp
> >> >         
> >> >
> >> >
> >> >
> >> >          >> name="bnf-detail_modification"
> >>
> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction"
> >> method="modificationSubmit">
> >> >
> >>  >>
> name="success">/pages/bnf/administration/detailBnf.jsp
> >> >         
> >> > ...
> >> >
> >> > 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
> >>
> >>
> >
> >
> >

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Nils-Helge Garli Hegvik
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  wrote:
>
>
> --- En date de : Lun 1.3.10, Alex Rodriguez Lopez  a 
> écrit :
>
>> De: Alex Rodriguez Lopez 
>> Objet: Re: How to pass HTTPRequest between two JSP ?
>> À: "Struts Users Mailing List" 
>> 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 :
>> >
>> > ...
>> > 
>> >
>> struts2
>> >
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
>> >      
>> >     
>> >
>> struts2
>> >
>> /*
>> >     
>> > ...
>> >
>> >
>> > the struts.xml file :
>> >
>> > ...
>> >
>> > > class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
>> >
>> > name="success">/pages/bnf/administration/detailBnf.jsp
>> >         
>> >
>> >
>> >
>> >         > name="bnf-detail_modification"
>> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction"
>> method="modificationSubmit">
>> >
>> > name="success">/pages/bnf/administration/detailBnf.jsp
>> >         
>> > ...
>> >
>> > 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
>>
>>
>
>
>
> 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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Frederik Minatchy


--- En date de : Lun 1.3.10, Alex Rodriguez Lopez  a 
écrit :

> De: Alex Rodriguez Lopez 
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" 
> 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 :
> >
> > ...
> > 
> >         
> struts2
> >         
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
> >      
> >     
> >    
> struts2
> >        
> /*
> >     
> > ...
> >
> >
> > the struts.xml file :
> >
> > ...
> >
> >  class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction">
> >             
>  name="success">/pages/bnf/administration/detailBnf.jsp
> >         
> >
> >
> >
> >          name="bnf-detail_modification"
> class="fr.bnf.platon.bnf.actions.ConsultationBnfDetailAction"
> method="modificationSubmit">
> >             
>  name="success">/pages/bnf/administration/detailBnf.jsp
> >         
> > ...
> >
> > 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
> 
> 



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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Alex Rodriguez Lopez

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 :

...

 struts2
 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
 

struts2
/*

...


the struts.xml file :

...


/pages/bnf/administration/detailBnf.jsp





/pages/bnf/administration/detailBnf.jsp

...

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



Re: When I link to a *.do I get "Page not found"

2010-03-01 Thread Alex Rodriguez Lopez

Em 27-02-2010 13:30, Søren Blidorf escreveu:

I have made a struts application and it works just fine on my testserver.



I have now uploaded it to my hosted webserver and struts does not work.



When I link to a *.do I get “Page not found”



Could it be a Tomcat config problem. Placing the jars and classes ect.



Struts 1.2 // Tomcat 5.5



Soren




It sure looks like a Tomcat config thing. Check your web.xml config for 
filter-mapping, *.do should be the url-pattern to use with struts 1. 
Tomcat has some config files, maybe some are taking preference over the 
one in your project.


Regards.

Alex Lopez.

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