Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 1 Mar 2010 11:08:15 -0000 Issue 9015

user-digest-help

2010-03-01


Author LoginPost Reply

user Digest 1 Mar 2010 11:08:15 -0000 Issue 9015

Topics (messages 205169 through 205186):

Re: Struts2 and PlugIn interface
 205169 by: Maciej Radochonski

facebook connect
 205170 by: Frans Thamura
 205171 by: Manos Batsis
 205174 by: Chris Pratt
 205175 by: Frans Thamura

How to pass HTTPRequest between two JSP ?
 205172 by: Frederik Minatchy
 205173 by: Burton Rhodes
 205176 by: Frederik Minatchy
 205178 by: Alex Rodriguez Lopez
 205179 by: Frederik Minatchy
 205180 by: Nils-Helge Garli Hegvik
 205181 by: Frederik Minatchy
 205182 by: Nils-Helge Garli Hegvik
 205183 by: Frederik Minatchy
 205186 by: Nils-Helge Garli Hegvik

Re: When I link to a *.do I get "Page not found"
 205177 by: Alex Rodriguez Lopez

Axis2 1.4.1, Struts 1.2.9 and Weblogic 8.1. Problem in the deployment if the application is stressed.
 205184 by: Triquoit Mathieu

Re: struts 2 token interceptor problem
 205185 by: andreistoiculescu

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_205169.ezm (zipped)
Thanks Pawel,

I'll give it a try.

2010/2/28 Paweł Wielgus <poulwiel@(protected)>

> Hi Maciej,
> You can implement ServletContextListener
> and register it in web.xml like this:
>
>     < listener >
>           < listener-class >com.ppp.oko.struts.AppListener< /
> listener-class >
>     < / listener >
> just mind extra spaces i've added to xml tags.
>
> Best greetings,
> Paweł Wielgus.
>
> 2010/2/26 Maciej Radochonski <mradochonski@(protected)>:
> > Further on the subject. For my persistence layer I use iBatis. With
> Struts1
> > I had been using plugin to load the connection object on start-up. Any
> > suggestion on how can I achieve similar effect with Struts2?
> >
> > Thank you,
> > Maciej Radochonski
> >
> > On Fri, Feb 19, 2010 at 3:01 PM, Maciej Radochonski
> > <mradochonski@(protected):
> >
> >> Thanks for the answer.
> >>
> >> Maciej
> >>
> >>
> >> On Fri, Feb 19, 2010 at 2:53 PM, Lukasz Lenart <
> >> lukasz.lenart@(protected):
> >>
> >>> 2010/2/19 Maciej Radochonski <mradochonski@(protected)>:
> >>> > Currently I am migration one of my applications from Struts1 onto
> >>> Struts2. I
> >>> > am using several Struts1 PlugIn's (mainly for data source
> configuration)
> >>> > that are loaded on start up of the app. Could someone advise me if
> such
> >>> a
> >>> > functionality, or similar, is available in Struts2?
> >>>
> >>> No, use Spring, Guice or Hibernate - there are plugins to connect such
> >>> frameworks with Struts 2
> >>>
> >>>
> >>> Regards
> >>> --
> >>> Łukasz
> >>> http://www.lenart.org.pl/
> >>> Kapituła Javarsovia 2010
> >>> http://javarsovia.pl
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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_205170.ezm (zipped)
hi all

anyone working with facebook connect, may be can share the code :)

sorry, in lazy mode on. to make my development faster


--
Frans Thamura
Meruvian.
Experiential Tempation of Java and Enterprise OpenSource

Meruvian jTechnopreneur Program (S1) telah hadir, Dapatkan benefit bagi SMK
yang melakukan mapping SKKD, dg program beasiswa dari Gunadarma

Mobile: +6287885901958
Blog & Profile: http://frans.thamura.info

We provide services to migrate your apps to Java (web), in amazing fast and
reliable.

Attachment: user_205171.ezm (zipped)
Frans Thamura wrote:
> hi all
>
> anyone working with facebook connect, may be can share the code :)
>
> sorry, in lazy mode on. to make my development faster

Someone posted an OS library for that recently, currently hosted on
google code. Search the archives.

hth,

Manos


Attachment: user_205174.ezm (zipped)
Frans,
Saeed Iqbal posted
http://code.google.com/p/remove-registration/recently. I haven't had
a chance to look into it, but have been meaning to.
 (*Chris*)

On Sun, Feb 28, 2010 at 1:56 PM, Frans Thamura <frans@(protected):

> hi all
>
> anyone working with facebook connect, may be can share the code :)
>
> sorry, in lazy mode on. to make my development faster
>
>
> --
> Frans Thamura
> Meruvian.
> Experiential Tempation of Java and Enterprise OpenSource
>
> Meruvian jTechnopreneur Program (S1) telah hadir, Dapatkan benefit bagi SMK
> yang melakukan mapping SKKD, dg program beasiswa dari Gunadarma
>
> Mobile: +6287885901958
> Blog & Profile: http://frans.thamura.info
>
> We provide services to migrate your apps to Java (web), in amazing fast and
> reliable.
>

Attachment: user_205175.ezm (zipped)
thx

we are working on it :)

F

On Mon, Mar 1, 2010 at 8:54 AM, Chris Pratt <thechrispratt@(protected):

> Frans,
> Saeed Iqbal posted
> http://code.google.com/p/remove-registration/recently. I haven't had
> a chance to look into it, but have been meaning to.
>   (*Chris*)
>
> On Sun, Feb 28, 2010 at 1:56 PM, Frans Thamura <frans@(protected):
>
> > hi all
> >
> > anyone working with facebook connect, may be can share the code :)
> >
> > sorry, in lazy mode on. to make my development faster
> >
> >
> > --
> > Frans Thamura
> > Meruvian.
> > Experiential Tempation of Java and Enterprise OpenSource
> >
> > Meruvian jTechnopreneur Program (S1) telah hadir, Dapatkan benefit bagi
> SMK
> > yang melakukan mapping SKKD, dg program beasiswa dari Gunadarma
> >
> > Mobile: +6287885901958
> > Blog & Profile: http://frans.thamura.info
> >
> > We provide services to migrate your apps to Java (web), in amazing fast
> and
> > reliable.
> >
>

Attachment: user_205172.ezm (zipped)
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?






Attachment: user_205173.ezm (zipped)
I think you may want to do a 'redirect' to the next action in your xml
file. You pass the request from one action to the other. Not from jsp
to jsp.

On 2/28/10, Frederik Minatchy <frederik78@(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)
>
>

--
Sent from my mobile device


Attachment: user_205176.ezm (zipped)
Thank you for your answer ...


Yes... In fact the goal is to pass the request from an action to an other. But after having reading the struts's documentation I can only use result dispatcher type.

In this part :
http://cwiki.apache.org/WW/redirect-result.html

they say that, with a redirect result, the last action is lost and the only way to pass attributes (or parameters) is to use session or web parameters.


Finally the question may be how to configure the dispatch result?

Regards...

Fred

--- En date de : Lun 1.3.10, Burton Rhodes <burtonrhodes@(protected) :

> De: Burton Rhodes <burtonrhodes@(protected)>
> Objet: Re: How to pass HTTPRequest between two JSP ?
> À: "Struts Users Mailing List" <user@(protected)>
> Date: Lundi 1 mars 2010, 1h24
> I think you may want to do a
> 'redirect' to the next action in your xml
> file.  You pass the request from one action to the
> other. Not from jsp
> to jsp.
>
> On 2/28/10, Frederik Minatchy <frederik78@(protected)>
> wrote:
> > 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)
> >
> >
>
> --
> Sent from my mobile device
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>





Attachment: user_205178.ezm (zipped)
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


Attachment: user_205179.ezm (zipped)


--- En date de : Lun 1.3.10, Alex Rodriguez Lopez <alopez@(protected) :

> 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







Attachment: user_205180.ezm (zipped)
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):
>
>
> --- En date de : Lun 1.3.10, Alex Rodriguez Lopez <alopez@(protected) :
>
>> 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)
>
>


Attachment: user_205181.ezm (zipped)
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) :

> 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)
>
>





Attachment: user_205182.ezm (zipped)
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):
> 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) :
>
>> 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)
>
>


Attachment: user_205183.ezm (zipped)
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) :

> 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)
>
>





Attachment: user_205186.ezm (zipped)
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):
> 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) :
>
>> 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)
>
>


Attachment: user_205177.ezm (zipped)
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.


Attachment: user_205184.ezm (zipped)
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

Attachment: user_205185.ezm (zipped)

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 <s:token\> 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
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


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