RE: AW: [OS-webwork] action chaining fun

2003-12-05 Thread Ben Hall
For some reason, I couldn't edit the Xwork Interceptors page so I added it
to http://wiki.opensymphony.com/space/WebWork+2+Interceptors instead (down
the bottom).

It _seriously_ needs fleshing out so i'll take you up on that offer:
http://wiki.opensymphony.com/space/Chaining+Interceptor

Anyone who can help, feel free to chip in :)

-Original Message-
From: Jason Carreira [mailto:[EMAIL PROTECTED]
Sent: 04 December 2003 16:06
To: [EMAIL PROTECTED]
Subject: RE: AW: [OS-webwork] action chaining fun


Umm.. Probably on the Xwork Interceptors page... If you want to start it,
that would be great. I'll flesh out any details that need to be added.

 -Original Message-
 From: Ben Hall [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 04, 2003 10:48 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: AW: [OS-webwork] action chaining fun
 
 
 Having spent some time wrestling with this myself, this sort 
 of info would be nice to be added to the Wiki somewhere :)  
 What's the best place for it and i'll add it ?
 
 -Original Message-
 From: Jason Carreira [mailto:[EMAIL PROTECTED]
 Sent: 04 December 2003 15:46
 To: [EMAIL PROTECTED]
 Subject: RE: AW: [OS-webwork] action chaining fun
 
 
 Oops... That last one should be Interceptor-stack A after
 
  -Original Message-
  From: Jason Carreira
  Sent: Thursday, December 04, 2003 10:41 AM
  To: [EMAIL PROTECTED]
  Subject: RE: AW: [OS-webwork] action chaining fun
  
  
  Action chaining works like this:
  
  Interceptors-stack A before
  Action A
  Interceptor-stack B before
  Action B
  Action B result
  Interceptor-stack B after
  Interceptor-stack B after
  
  
  If you want callbacks before the results are executed (for
  instance the chaining result or Action B's result) you can 
  have your Interceptors register instances of 
  com.opensymphony.xwork.interceptor.PreResultListener with the 
  ActionInvocation using addPreResultListener(PreResultListener 
  listener) and it will get called after the Action has 
  executed and before the result is executed.
  
  Jason
  
   -Original Message-
   From: Anoop Ranganath [mailto:[EMAIL PROTECTED]
   Sent: Thursday, December 04, 2003 9:44 AM
   To: [EMAIL PROTECTED]
   Subject: Re: AW: [OS-webwork] action chaining fun
   
   
   That chains them, but it is not the behavior I am looking for. 
   Ideally, if i had action A  interceptor-stack A and action B with 
   interceptor-stack B, this would happen
   
   interceptor-stack A before
 action A
   interceptor-stack A after
   interceptor-stack B before
 action B
   interceptor-stack B after
   
   And somehow get a property from action A to action B.
   
   This is a moot point right now, I've already found a way to work 
   around the issue.  I would like to knwo if it's possible though.
   
   Anoop
   
   On Dec 4, 2003, at 3:51 AM, Patrick Holzmann wrote:
   
Hi Anoop,
   
all you have to do is have a getter/setter for the
  parameter in both
actions (+ same name for variable). Then you include 
 the chaining
interceptor (interceptor-ref
name=chain/) to your interceptor stack
in xwork.xml:
interceptor-stack name=myStack
  interceptor-ref name=component/
  interceptor-ref name=defaultStack/
  interceptor-ref name=chain/
/interceptors
...
Then you chain both actions together:
action name=forward_somewhere class=...
interceptor-ref name=myStack/
result name=success type=chain
param name=actionNameshow/param
/result
/action
action name=show_something class=...
interceptor-ref name=myStack/
result name=success type=dispatcher
param name=location/some.jsp/param
/result
/action
   
Basically that's all - Xowrk does the rest for you. The set
   method in
the second action will be called passing the parameter
   automatically.
   
Hope this helps.
Cheers
P
   
   
-Ursprüngliche Nachricht-
Von: Anoop Ranganath [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 3. Dezember 2003 21:08
An: [EMAIL PROTECTED]
Betreff: [OS-webwork] action chaining fun
   
   
I'm looking to somehow implement chain-like behaviour.
  I'd like to
perform one action completely, with all it's
  interceptors, and then
perform another action completely with all it's
  interceptors.  The
catch is that I want some parameters passed between them.
   
Any ideas?
   
Anoop
   
   
   
---
This SF.net email is sponsored by: SF.net Giveback 
 Program. Does 
SourceForge.net help you be more productive?  Does it help
   you create
better code?  SHARE THE LOVE, and help us help YOU!  
 Click Here: 
http://sourceforge.net/donate/ 
___

[OS-webwork] Small exception problem

2003-12-05 Thread BOGAERT Mathias
Can someone add a space to

throw new XworkException(Action class  + actionClass.getClass().getName()
+ does not implement  + Action.class.getName(), e);

Before 'does not implement' at
com.opensymphony.xwork.DefaultActionInvocation.createAction(DefaultActionInv
ocation.java:212)

Thanks,
Mathias


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


[OS-webwork] Xwork and hot redeploy

2003-12-05 Thread Craig Raw
Hi,

I have encountered what is to me a serious usability issue with XWork. I 
am using it deployed in a .war in Jboss, where hot redeploy greatly 
reduces update times during the development process. To reduce the size 
of the created .war files, I store the xwork/webwork jars in the JBoss 
server lib configuration.

The problem I have encountered is that Xwork seems to store its 
configuration information from xwork.xml in as static attribute in a 
class. Thus, if this class is not redeployed, the configuration does not 
change.

The only way to get around this is to include the xwork jar, the webwork 
 jar and the velocity jar in WEB-INF/lib for every .war I create. This 
boosts the size of each .war from a few kb to almost a Mb. It also seems 
rather wasteful, given that I try to componentize my webapp into several 
smaller .wars.

Have I got this right? If so, and there's no workaround, I may have to 
go back to Struts. Great framework otherwise.

Craig

PS The static attribute seems to be configurationInstance in 
ConfigurationManager.



---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


RE: [OS-webwork] in DefaultActionProxy.execute() whats the purpose of the nestedContext and WW-407?

2003-12-05 Thread Jason Carreira
The purpose is for each ActionInvocation to have its own ActionContext
which is only active while the ActionInvocation is being executed (as
managed by the ActionProxy). 

If, for instance, you chain to another Action, that nested Action should
have its own ActionContext which is available while it is executing, and
which should be reset to the parent ActionInvocation's ActionContext
when the nested Action is done. 

The problem you're seeing is probably due to not having gone through any
type of Dispatcher yet to set the request and response into the
ActionContext. The reason you're seeing 1 of 2 objects is probably
because your servlet container has just 2 execution threads which is
cycles through, and each one has a default ActionContext ThreadLocal
(which is probably never used, except for in your Sitemesh filters,
because a new one will be created and associated for the
ActionInvocation when it gets to the ServletDispatcher to execute an
Action, and then the default set back after it's done executing the
result, but before the Sitemesh filter activates).

I think the solution to your problem is to use the request directly in
your sitemesh code... I'll let Patrick comment more, since he was
refactoring the tags and stuff to work with Sitemesh.

Jason

 -Original Message-
 From: Francisco Hernandez [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 05, 2003 12:22 AM
 To: [EMAIL PROTECTED]
 Subject: [OS-webwork] in DefaultActionProxy.execute() whats 
 the purpose of the nestedContext and WW-407?
 
 
 the issue: 
 http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-407
 
 
 heres the method, whats the purpose of nestedContext?
 -
  public String execute() throws Exception {
  ActionContext nestedContext = ActionContext.getContext();
  ActionContext.setContext(invocation.getInvocationContext());
 
  String retCode = null;
 
  try {
  retCode = invocation.invoke();
  } finally {
  ActionContext.setContext(nestedContext);
  }
 
  return retCode;
  }
 --
 
 
 the problems im having and described and shown in the app 
 attached for WW-407 go away after i comment out the line:
  ActionContext.setContext(nestedContext);
 
 another thing i've noticed is that with 
 ActionContext.getContext always returns either one of two 
 objects, always 
 alternating for every request (this is when used inside a 
 sitemesh decorator)
 
 
 
 
 
 
 ---
 This SF.net email is sponsored by: SF.net Giveback Program. 
 Does SourceForge.net help you be more productive?  Does it 
 help you create better code?  SHARE THE LOVE, and help us 
 help YOU!  Click Here: http://sourceforge.net/donate/ 
 ___
 Opensymphony-webwork mailing list 
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
 


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


RE: [OS-webwork] Small exception problem

2003-12-05 Thread Jason Carreira
OK... Will do, thanks.

 -Original Message-
 From: BOGAERT Mathias [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 05, 2003 9:43 AM
 To: [EMAIL PROTECTED]
 Subject: [OS-webwork] Small exception problem
 
 
 Can someone add a space to
 
 throw new XworkException(Action class  + 
 actionClass.getClass().getName()
 + does not implement  + Action.class.getName(), e);
 
 Before 'does not implement' at 
 com.opensymphony.xwork.DefaultActionInvocation.createAction(De
 faultActionInv
 ocation.java:212)
 
 Thanks,
 Mathias
 
 
 ---
 This SF.net email is sponsored by: SF.net Giveback Program. 
 Does SourceForge.net help you be more productive?  Does it 
 help you create better code?  SHARE THE LOVE, and help us 
 help YOU!  Click Here: http://sourceforge.net/donate/ 
 ___
 Opensymphony-webwork mailing list 
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
 


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


RE: Spam:[OS-webwork] Xwork and hot redeploy

2003-12-05 Thread Jason Carreira
You can set 

webwork.configuration.xml.reload=true

In your webwork.properties to tell it to check and automatically reload
XML configuration files (this includes the xwork.xml file and any other
included xwork configuration files, validation.xml files, and type
conversion .properties files right now). 

As far as being able to have the one Xwork.jar and have multiple
configurations, that's a good idea... Please add a Jira issue. I've
always hated that Singleton, so we can look at how to get rid of it. In
the meantime, is it possible to have the one xwork.jar file and have
Jboss load it individually in the classloader of each web app (instead
of just once in the server classloader)?

Also, any hints on how Struts implements this? I know how I'd like to
implement it (refactor all of our internal pieces into IoC components
instead of having singletons for each other to look up), but this would
be a major undertaking.

Jason

 -Original Message-
 From: Craig Raw [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 05, 2003 9:53 AM
 To: [EMAIL PROTECTED]
 Subject: Spam:[OS-webwork] Xwork and hot redeploy
 
 
 Hi,
 
 I have encountered what is to me a serious usability issue 
 with XWork. I 
 am using it deployed in a .war in Jboss, where hot redeploy greatly 
 reduces update times during the development process. To 
 reduce the size 
 of the created .war files, I store the xwork/webwork jars in 
 the JBoss 
 server lib configuration.
 
 The problem I have encountered is that Xwork seems to store its 
 configuration information from xwork.xml in as static attribute in a 
 class. Thus, if this class is not redeployed, the 
 configuration does not 
 change.
 
 The only way to get around this is to include the xwork jar, 
 the webwork 
   jar and the velocity jar in WEB-INF/lib for every .war I 
 create. This 
 boosts the size of each .war from a few kb to almost a Mb. It 
 also seems 
 rather wasteful, given that I try to componentize my webapp 
 into several 
 smaller .wars.
 
 Have I got this right? If so, and there's no workaround, I 
 may have to 
 go back to Struts. Great framework otherwise.
 
 Craig
 
 PS The static attribute seems to be configurationInstance in 
 ConfigurationManager.
 
 
 
 ---
 This SF.net email is sponsored by: SF.net Giveback Program. 
 Does SourceForge.net help you be more productive?  Does it 
 help you create better code?  SHARE THE LOVE, and help us 
 help YOU!  Click Here: http://sourceforge.net/donate/ 
 ___
 Opensymphony-webwork mailing list 
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
 


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


Re: [OS-webwork] in DefaultActionProxy.execute() whats the purpose of the nestedContext and WW-407?

2003-12-05 Thread Francisco Hernandez
the tags work fine in sitemesh decorators as it stands, but the problem is that i need 
to use
ActionContext.getContext().getSession() and that returns null when used inside of a 
sitemesh decorator
Im using ActionContext.getContext().getSession() inside the decorator to do the typical checking of the session to see 
if theres a user logged in or not and display the appropriate links ie: login, register or logout, edit profile

all of this checking of the user is implemented as a method getLoggedInUser in my BaseAction, this is what I was using 
before I started using sitemesh and using ugly includes.

Jason Carreira wrote:
The purpose is for each ActionInvocation to have its own ActionContext
which is only active while the ActionInvocation is being executed (as
managed by the ActionProxy). 

If, for instance, you chain to another Action, that nested Action should
have its own ActionContext which is available while it is executing, and
which should be reset to the parent ActionInvocation's ActionContext
when the nested Action is done. 

The problem you're seeing is probably due to not having gone through any
type of Dispatcher yet to set the request and response into the
ActionContext. The reason you're seeing 1 of 2 objects is probably
because your servlet container has just 2 execution threads which is
cycles through, and each one has a default ActionContext ThreadLocal
(which is probably never used, except for in your Sitemesh filters,
because a new one will be created and associated for the
ActionInvocation when it gets to the ServletDispatcher to execute an
Action, and then the default set back after it's done executing the
result, but before the Sitemesh filter activates).
I think the solution to your problem is to use the request directly in
your sitemesh code... I'll let Patrick comment more, since he was
refactoring the tags and stuff to work with Sitemesh.
Jason


-Original Message-
From: Francisco Hernandez [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 05, 2003 12:22 AM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] in DefaultActionProxy.execute() whats 
the purpose of the nestedContext and WW-407?

the issue: 
http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-407

heres the method, whats the purpose of nestedContext?
-
public String execute() throws Exception {
ActionContext nestedContext = ActionContext.getContext();
ActionContext.setContext(invocation.getInvocationContext());
String retCode = null;

try {
retCode = invocation.invoke();
} finally {
ActionContext.setContext(nestedContext);
}
return retCode;
}
--
the problems im having and described and shown in the app 
attached for WW-407 go away after i comment out the line:
ActionContext.setContext(nestedContext);

another thing i've noticed is that with 
ActionContext.getContext always returns either one of two 
objects, always 
alternating for every request (this is when used inside a 
sitemesh decorator)





---
This SF.net email is sponsored by: SF.net Giveback Program. 
Does SourceForge.net help you be more productive?  Does it 
help you create better code?  SHARE THE LOVE, and help us 
help YOU!  Click Here: http://sourceforge.net/donate/ 
___
Opensymphony-webwork mailing list 
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork






---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


RE: [OS-webwork] in DefaultActionProxy.execute() whats the purpose of the nestedContext and WW-407?

2003-12-05 Thread Jason Carreira
You could have it populate this boolean during execution, or pull this
into an Interceptor. I don't think leaving around leftover state in a
ThreadLocal is the way to go, though...

 -Original Message-
 From: Francisco Hernandez [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 05, 2003 11:23 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [OS-webwork] in DefaultActionProxy.execute() 
 whats the purpose of the nestedContext and WW-407?
 
 
 the tags work fine in sitemesh decorators as it stands, but 
 the problem is that i need to use
 ActionContext.getContext().getSession() and that returns null 
 when used inside of a sitemesh decorator
 
 Im using ActionContext.getContext().getSession() inside the 
 decorator to do the typical checking of the session to see 
 if theres a user logged in or not and display the appropriate 
 links ie: login, register or logout, edit profile
 
 all of this checking of the user is implemented as a method 
 getLoggedInUser in my BaseAction, this is what I was using 
 before I started using sitemesh and using ugly includes.
 
 
 Jason Carreira wrote:
  The purpose is for each ActionInvocation to have its own 
 ActionContext 
  which is only active while the ActionInvocation is being 
 executed (as 
  managed by the ActionProxy).
  
  If, for instance, you chain to another Action, that nested Action 
  should have its own ActionContext which is available while it is 
  executing, and which should be reset to the parent 
 ActionInvocation's 
  ActionContext when the nested Action is done.
  
  The problem you're seeing is probably due to not having 
 gone through 
  any type of Dispatcher yet to set the request and response into the 
  ActionContext. The reason you're seeing 1 of 2 objects is probably 
  because your servlet container has just 2 execution threads 
 which is 
  cycles through, and each one has a default ActionContext 
 ThreadLocal 
  (which is probably never used, except for in your Sitemesh filters, 
  because a new one will be created and associated for the 
  ActionInvocation when it gets to the ServletDispatcher to 
 execute an 
  Action, and then the default set back after it's done executing the 
  result, but before the Sitemesh filter activates).
  
  I think the solution to your problem is to use the request 
 directly in 
  your sitemesh code... I'll let Patrick comment more, since he was 
  refactoring the tags and stuff to work with Sitemesh.
  
  Jason
  
  
 -Original Message-
 From: Francisco Hernandez [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 05, 2003 12:22 AM
 To: [EMAIL PROTECTED]
 Subject: [OS-webwork] in DefaultActionProxy.execute() whats 
 the purpose of the nestedContext and WW-407?
 
 
 the issue:
 http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-407
 
 
 heres the method, whats the purpose of nestedContext?
 -
  public String execute() throws Exception {
  ActionContext nestedContext = ActionContext.getContext();
  
 ActionContext.setContext(invocation.getInvocationContext());
 
  String retCode = null;
 
  try {
  retCode = invocation.invoke();
  } finally {
  ActionContext.setContext(nestedContext);
  }
 
  return retCode;
  }
 --
 
 
 the problems im having and described and shown in the app
 attached for WW-407 go away after i comment out the line:
  ActionContext.setContext(nestedContext);
 
 another thing i've noticed is that with
 ActionContext.getContext always returns either one of two 
 objects, always 
 alternating for every request (this is when used inside a 
 sitemesh decorator)
 
 
 
 
 
 
 ---
 This SF.net email is sponsored by: SF.net Giveback Program.
 Does SourceForge.net help you be more productive?  Does it 
 help you create better code?  SHARE THE LOVE, and help us 
 help YOU!  Click Here: http://sourceforge.net/donate/ 
 ___
 Opensymphony-webwork mailing list 
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
 
  
  
  
  ---
  This SF.net email is sponsored by: SF.net Giveback Program. Does 
  SourceForge.net help you be more productive?  Does it help 
 you create 
  better code?  SHARE THE LOVE, and help us help YOU!  Click Here: 
  http://sourceforge.net/donate/ 
  ___
  Opensymphony-webwork mailing list 
  [EMAIL PROTECTED]
  https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
  
  
  
 
 
 
 
 
 ---
 This SF.net email is sponsored by: SF.net Giveback Program. 
 Does SourceForge.net help you be more productive?  Does it 
 help you create better code?  SHARE THE LOVE, and help us 
 help YOU!  Click Here: http://sourceforge.net/donate/ 
 

Re: Spam:[OS-webwork] Xwork and hot redeploy

2003-12-05 Thread Rickard Öberg
Jason Carreira wrote:
webwork.configuration.xml.reload=true

In your webwork.properties to tell it to check and automatically reload
XML configuration files (this includes the xwork.xml file and any other
included xwork configuration files, validation.xml files, and type
conversion .properties files right now). 

As far as being able to have the one Xwork.jar and have multiple
configurations, that's a good idea... Please add a Jira issue. I've
always hated that Singleton, so we can look at how to get rid of it. In
the meantime, is it possible to have the one xwork.jar file and have
Jboss load it individually in the classloader of each web app (instead
of just once in the server classloader)?
No, but you can have it appear as one singleton while it really is many 
by doing a classloader switch internally.

E.g.:
Map clSettings = new HashMap();
String getFoo(String bar)
{
  Map settings = 
(Map)clSettings.get(Thread.currentThread().getContextClassloader());
  if (settings == null)
...

   return (String)settings.get(bar);
}
This at least gives you one singleton per deployment. If you use a 
WeakHashmap for clSettings you can even have the stated be garbage 
collected properly.

/Rickard



---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


Re: [OS-webwork] in DefaultActionProxy.execute() whats the purpose of the nestedContext and WW-407?

2003-12-05 Thread Francisco Hernandez
I like that idea actually, moving this logic into an interceptor, but i still think 
ActionContext.getContext().getSession() should not be returning null when used in a sitemesh decorator.

Jason Carreira wrote:
You could have it populate this boolean during execution, or pull this
into an Interceptor. I don't think leaving around leftover state in a
ThreadLocal is the way to go, though...

-Original Message-
From: Francisco Hernandez [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 05, 2003 11:23 AM
To: [EMAIL PROTECTED]
Subject: Re: [OS-webwork] in DefaultActionProxy.execute() 
whats the purpose of the nestedContext and WW-407?

the tags work fine in sitemesh decorators as it stands, but 
the problem is that i need to use
ActionContext.getContext().getSession() and that returns null 
when used inside of a sitemesh decorator

Im using ActionContext.getContext().getSession() inside the 
decorator to do the typical checking of the session to see 
if theres a user logged in or not and display the appropriate 
links ie: login, register or logout, edit profile

all of this checking of the user is implemented as a method 
getLoggedInUser in my BaseAction, this is what I was using 
before I started using sitemesh and using ugly includes.

Jason Carreira wrote:

The purpose is for each ActionInvocation to have its own 
ActionContext 

which is only active while the ActionInvocation is being 
executed (as 

managed by the ActionProxy).

If, for instance, you chain to another Action, that nested Action 
should have its own ActionContext which is available while it is 
executing, and which should be reset to the parent 
ActionInvocation's 

ActionContext when the nested Action is done.

The problem you're seeing is probably due to not having 
gone through 

any type of Dispatcher yet to set the request and response into the 
ActionContext. The reason you're seeing 1 of 2 objects is probably 
because your servlet container has just 2 execution threads 
which is 

cycles through, and each one has a default ActionContext 
ThreadLocal 

(which is probably never used, except for in your Sitemesh filters, 
because a new one will be created and associated for the 
ActionInvocation when it gets to the ServletDispatcher to 
execute an 

Action, and then the default set back after it's done executing the 
result, but before the Sitemesh filter activates).

I think the solution to your problem is to use the request 
directly in 

your sitemesh code... I'll let Patrick comment more, since he was 
refactoring the tags and stuff to work with Sitemesh.

Jason



-Original Message-
From: Francisco Hernandez [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 12:22 AM
To: [EMAIL PROTECTED]
Subject: [OS-webwork] in DefaultActionProxy.execute() whats 
the purpose of the nestedContext and WW-407?

the issue:
http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-407
heres the method, whats the purpose of nestedContext?
-
   public String execute() throws Exception {
   ActionContext nestedContext = ActionContext.getContext();
   
ActionContext.setContext(invocation.getInvocationContext());

   String retCode = null;

   try {
   retCode = invocation.invoke();
   } finally {
   ActionContext.setContext(nestedContext);
   }
   return retCode;
   }
--
the problems im having and described and shown in the app
attached for WW-407 go away after i comment out the line:
   ActionContext.setContext(nestedContext);
another thing i've noticed is that with
ActionContext.getContext always returns either one of two 
objects, always 
alternating for every request (this is when used inside a 
sitemesh decorator)





---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it 
help you create better code?  SHARE THE LOVE, and help us 
help YOU!  Click Here: http://sourceforge.net/donate/ 
___
Opensymphony-webwork mailing list 
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



---
This SF.net email is sponsored by: SF.net Giveback Program. Does 
SourceForge.net help you be more productive?  Does it help 
you create 

better code?  SHARE THE LOVE, and help us help YOU!  Click Here: 
http://sourceforge.net/donate/ 
___
Opensymphony-webwork mailing list 
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork







---
This SF.net email is sponsored by: SF.net Giveback Program. 
Does SourceForge.net help you be more productive?  Does it 
help you create better code?  SHARE THE LOVE, and help us 
help YOU!  Click Here: http://sourceforge.net/donate/