[Struts2] problem with links and Firefox

2006-09-28 Thread Labey Sébastien
Hi,
 
I have a strange problem : I have 2 links in my page to change the locale. The 
"english" and the "french" link are not build the same way (for tests...) but 
the 2 solutions give the url that I want in the end.
 
  

  <%/* anglais */%>
  
 en
   ">

  

  <%/* francais */%>
  
 fr
   ">

  

  
 
But, the strange thing is that on Firefox when I select the link associated 
with a locale that is not in the request (ex. select "fr" when my 
request_locale is now "en"), Firefox opens a new tab. But when I select the 
link for the locale that is already in the request (ex. select "fr" when my 
request_locale is now "fr") this works fine and the page is still in the same 
tab. 
Any idea for this problem? 
Thanks in advance.
 
Sebastien
 
 
Sébastien LABEY
 
Division Immobilier
R&D IKOS
 
04.72.18.47.07
  [EMAIL PROTECTED]
20, chemin du Randin - B1 - 69130 Ecully
P Avant d'imprimer, ayez une pensée pour notre environnement

*

 


RE: [Strust2] how does Interceptor work?

2006-09-27 Thread Labey Sébastien
Thanks for your help. I've read these pages and I better understand how it 
works. I've to try this further now...
You said I could post my Interceptor to the list, but for the moment it doesn't 
really exist... It is only an idea to have an Interceptor that belongs to my 
default Interceptor stack and that give acces to before() and after() methods 
in all Action whatever the method that is called in the Action. So I could add 
some work to do before and/or after the execute() method (or create() or 
update() or read()...) if needed without having to modify the Interceptors 
discribed in the struts.xml for the specific action. All actions could extend 
these before() and after() methods only if needed.
One other solution would be to describe a "mother" Action class that would call 
before() and/or after() methods of the Action class called during the execute() 
method... not sure that it is very clear...
Maybe there is a better way?

-Message d'origine-
De : David Evans [mailto:[EMAIL PROTECTED]
Envoyé : mardi 26 septembre 2006 18:42
À : Struts Users Mailing List
Objet : Re: [Strust2] how does Interceptor work?


Hello,

These webwork and xwork doc pages may help:
http://wiki.opensymphony.com/display/XW/Interceptors
http://www.opensymphony.com/webwork/api/com/opensymphony/xwork/ActionInvocation.html
http://www.opensymphony.com/webwork/api/com/opensymphony/xwork/ActionProxy.html

Passed in to your interceptor's intercept method is an ActionInvocation.
This object has a getProxy() method, which returns an ActionProxy.
The ActionProxy has a getMethod() method, which will return the method
name as a String. So you'll need to call those methods and then use
reflection to call your beforeXXX and afterXXX methods.

In your intercept method the invocation.invoke() line is what continues
down the chain of interceptors and finally to the Action's method.
Anything you do before the invocation.invoke() is before the action
execution, anything after invocation.invoke is after the action
execution. It is also after the result execution, so for your case it
seems you'd have to setup the PreResultListener, and put the ActionProxy
method lookup and reflective call bit in there as well.

If you post your Interceptor to the list, that might help also.

Dave



On Tue, 2006-09-26 at 12:11 +0200, Labey Sébastien wrote:
> Hi, I'm new to Struts2 and i don't really understand how does Interceptor 
> technique work. 
> I have made my own interceptor that implements Interceptor interface. I place 
> it in struts.xml with my action. It's OK, before invoking my action, i go 
> through my interceptor in the intercept() method.
> But do all interceptor classes go only through intercept() method or is there 
> a solution to go through another method name? My need is to go through a 
> beforeXXX() method depending on the name of the méthod described in 
> struts.xml for my current navigation.
>  
> My second question is how to go through an interceptor after the action has 
> been executed but before "forwarding" to jsp? I read in documentation that my 
> interceptor has to implements PreResultListener interface, so i made it, but 
> nothing appens. I dont go through the beforeResult() method, neither the 
> intercept() method... Is it possible to have only one interceptor for both 
> the beforeXXX() and the afterXXX() methods?
>  
> All your helps would be great. Thanks in advance
>  
> Sebastien
>  
> 
> Sébastien LABEY
>  
> Division Immobilier
> R&D IKOS
>  
> 04.72.18.47.07
>  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
> 20, chemin du Randin - B1 - 69130 Ecully
> P Avant d'imprimer, ayez une pensée pour notre environnement
> 
> *
> 
>  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Strust2] how does Interceptor work?

2006-09-26 Thread Labey Sébastien
Hi, I'm new to Struts2 and i don't really understand how does Interceptor 
technique work. 
I have made my own interceptor that implements Interceptor interface. I place 
it in struts.xml with my action. It's OK, before invoking my action, i go 
through my interceptor in the intercept() method.
But do all interceptor classes go only through intercept() method or is there a 
solution to go through another method name? My need is to go through a 
beforeXXX() method depending on the name of the méthod described in struts.xml 
for my current navigation.
 
My second question is how to go through an interceptor after the action has 
been executed but before "forwarding" to jsp? I read in documentation that my 
interceptor has to implements PreResultListener interface, so i made it, but 
nothing appens. I dont go through the beforeResult() method, neither the 
intercept() method... Is it possible to have only one interceptor for both the 
beforeXXX() and the afterXXX() methods?
 
All your helps would be great. Thanks in advance
 
Sebastien
 
 
Sébastien LABEY
 
Division Immobilier
R&D IKOS
 
04.72.18.47.07
  [EMAIL PROTECTED]
20, chemin du Randin - B1 - 69130 Ecully
P Avant d'imprimer, ayez une pensée pour notre environnement

*

 


[Struts 2] and tags adding unwanted HTML code

2006-09-15 Thread Labey Sébastien
Hi,
 
I was using Struts 1.2.8 and I'm now discovering Struts 2 and some new tags.
I'm transforming an .html page designed with CSS only (no , , ) 
to an .jsp page with Struts tags and I'm surprised to see that the source code 
generated when using ,  and  contains some html 
code with , ,  around the divs of my form.
Is there the source code :
 

 
 
 Connectez vous :
 
  login : 
  
 
 
  mot de passe : 
  
 
 

 
  
 

 
Is there an option to deactivate this? Or maybe I'm wrong in using these tags.
For my test I'm using the "struts-blank" app (found in Struts 2), with jre1.5 
and Tomcat 5.5.12.
Thank you in advance for your help.
 
Sébastien
 
Sébastien LABEY
 
Division Immobilier
R&D IKOS
 
04.72.18.47.07
  [EMAIL PROTECTED]
20, chemin du Randin - B1 - 69130 Ecully
P Avant d'imprimer, ayez une pensée pour notre environnement

*