You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dimitrios Christodoulakis <di...@gmail.com> on 2009/07/22 23:05:56 UTC

studying struts2 framework, ActionInvocation question

Hello,

According to the XWork feature description,
http://www.opensymphony.com/xwork/wikidocs/XWork%20Features.html, the
ActionInvocation represents the execution state of an action holding
the action instance and the interceptors.

I have been looking at
http://struts.apache.org/2.1.6/struts2-core/apidocs and examining an
implementation of the ActionInvocation interface:
DefaultActionInvocation and was wondering how does this class gets a
hold of the action instance and the interceptors? It has relevant
fields like action, interceptors and proxy with getters for the action
and the proxy. But it is not straightforward to me how the action
instance (and the interceptors) are injected to it.. I didn't see
setter methods for the action.

My motivation for this question comes also from wanting to unit test
an interceptor's intercept(ActionInvocation actionInvocation) method.
I will need to pass an ActionInvocation as a parameter, which then the
interceptor will use to extract the actual action instance from.
(Among other things, like the InvocationContext to get the session).

So I was also wondering how to provide a mock-type of an
ActionInvocation which will contain a mock action, a mock session etc.
I mean I understand how to create a mock action and a mock session map
with some parameters in it, but how do I bind those to a mock
ActionInvocation? Would I need perhaps to start with a mock
ActionProxy?

Thanks for your advice. This will help me design the test case and
also learn more about the struts2 mechanics.
Regards!

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
Yes, I figured doing a trace and see how things happen would answer a
lot of questions. So, I'll try that.

>From looking at the DefaultActionProxy constructor, it does make sense
to start with the actionproxy. The proxy gets an action invocation as
a constructor parameter. So the invocation instantiation should be
coming shortly after that.

On Wed, Jul 22, 2009 at 4:17 PM, Musachy Barroso<mu...@gmail.com> wrote:
> The best way to find out all these things is to put breakpoints in the
> constructor and/or the setter methods.
>
> musachy
>
> On Wed, Jul 22, 2009 at 2:05 PM, Dimitrios
> Christodoulakis<di...@gmail.com> wrote:
>> Hello,
>>
>> According to the XWork feature description,
>> http://www.opensymphony.com/xwork/wikidocs/XWork%20Features.html, the
>> ActionInvocation represents the execution state of an action holding
>> the action instance and the interceptors.
>>
>> I have been looking at
>> http://struts.apache.org/2.1.6/struts2-core/apidocs and examining an
>> implementation of the ActionInvocation interface:
>> DefaultActionInvocation and was wondering how does this class gets a
>> hold of the action instance and the interceptors? It has relevant
>> fields like action, interceptors and proxy with getters for the action
>> and the proxy. But it is not straightforward to me how the action
>> instance (and the interceptors) are injected to it.. I didn't see
>> setter methods for the action.
>>
>> My motivation for this question comes also from wanting to unit test
>> an interceptor's intercept(ActionInvocation actionInvocation) method.
>> I will need to pass an ActionInvocation as a parameter, which then the
>> interceptor will use to extract the actual action instance from.
>> (Among other things, like the InvocationContext to get the session).
>>
>> So I was also wondering how to provide a mock-type of an
>> ActionInvocation which will contain a mock action, a mock session etc.
>> I mean I understand how to create a mock action and a mock session map
>> with some parameters in it, but how do I bind those to a mock
>> ActionInvocation? Would I need perhaps to start with a mock
>> ActionProxy?
>>
>> Thanks for your advice. This will help me design the test case and
>> also learn more about the struts2 mechanics.
>> Regards!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: studying struts2 framework, ActionInvocation question

Posted by Musachy Barroso <mu...@gmail.com>.
using any of the 35,000 mocking frameworks available, that would be
pretty easy :)

musachy

On Fri, Jul 24, 2009 at 9:14 AM, Dimitrios
Christodoulakis<di...@gmail.com> wrote:
> I plan to unit test the interceptor on its own. I am more interested
> in testing its logic, not necessarily within the framework.
>
> First step would be to mock an ActionInvocation object which is what
> is passed to the Interceptor's intercept method. The action invocation
> would need a mock action, and a mock session which will be holding the
> user credentials. In order to have a session I would need to first
> have an invocation object to get the session from:
> actionInvocation.getInvocationContext().getSession()
>
> On Fri, Jul 24, 2009 at 10:52 AM, Musachy Barroso<mu...@gmail.com> wrote:
>> You don't need to create mock objects for the framework, you onlt need
>> to mock the objects passed to the interceptor and invoke the
>> interceptor directly, unless you really want to test the interceptor
>> running inside struts (there is a long thread about that so i wont get
>> into it)
>>
>> musachy
>>
>> On Fri, Jul 24, 2009 at 6:31 AM, Dimitrios
>> Christodoulakis<di...@gmail.com> wrote:
>>> I tried to logically trace the flow within the framework and wanted to
>>> check if my thoughts are correct here, while at the same time asking a
>>> few more questions:
>>>
>>> As a start I take DefaultActionProxyFactory. DefaultActionProxyFactory
>>> instantiates DefaultActionProxy, but also gives us
>>> DefaultActionInvocation via its createActionProxy methods, using the
>>> "new" operator.
>>>
>>> The DefaultActionProxy constructor takes ActionInvocation as parameter
>>> and sets the ActionInvocation interface field by means of a
>>> DefaultActionInvocation implementation.
>>>
>>> Next, DefaultActionInvocation takes extraContext and a boolean as
>>> constructor params. It also has a reference to the ActionProxy which I
>>> believe sets via its init method?
>>>
>>> DefaultActionInvocation also creates the actions with its
>>> createAction(Map<String, Object> contextMap) method, letting an
>>> objectFactory take care of the actual creation with information taken
>>> from the ActionProxy (like action name, name space, config, etc).
>>>
>>> Then DefaultActionInvocation also invokes the action by calling
>>> invokeAction(action, actionConfig).
>>>
>>> This is more to help me understand the basic workflow at a higher
>>> level at first. Are my above statements correct?
>>>
>>> One thing that I find confusing (at this time) is the use of so many
>>> "contexts": extraContext, actionContext, invocationContext, etc. What
>>> is the primary use of the context? Is it similar to the configuration
>>> object?
>>>
>>> I still have as a short term objective to unit test my
>>> intercept(actionInvocation) method of my custom Interceptor, but is it
>>> true to assume that to prepare for the test I'd probably need to
>>> create a lot of dependencies manually? i.e. Create mock objects all
>>> the way deep to DefaultActionProxyFactory?
>>>
>>> Many thanks again for your help.
>>>
>>>
>>>
>>>
>>> On Thu, Jul 23, 2009 at 5:37 PM, Dave Newton<ne...@yahoo.com> wrote:
>>>> Dimitrios Christodoulakis wrote:
>>>>>
>>>>> By the way I noticed that when I downloaded the s2 source code, it
>>>>> didn't come with the opensymphony packages... Does the xwork source
>>>>> has to be downloaded separately?
>>>>
>>>> Yes.
>>>>
>>>> Dave
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
Let me correct an error below, I meant: "... I would need to first
have an invocation *context* to get the session from..."

I still have difficulty grasping the idea of all the different
contexts, and their general use, but should be able to go ahead with
the unit test.

On Fri, Jul 24, 2009 at 11:14 AM, Dimitrios
Christodoulakis<di...@gmail.com> wrote:
> I plan to unit test the interceptor on its own. I am more interested
> in testing its logic, not necessarily within the framework.
>
> First step would be to mock an ActionInvocation object which is what
> is passed to the Interceptor's intercept method. The action invocation
> would need a mock action, and a mock session which will be holding the
> user credentials. In order to have a session I would need to first
> have an invocation object to get the session from:
> actionInvocation.getInvocationContext().getSession()
>
> On Fri, Jul 24, 2009 at 10:52 AM, Musachy Barroso<mu...@gmail.com> wrote:
>> You don't need to create mock objects for the framework, you onlt need
>> to mock the objects passed to the interceptor and invoke the
>> interceptor directly, unless you really want to test the interceptor
>> running inside struts (there is a long thread about that so i wont get
>> into it)
>>
>> musachy
>>
>> On Fri, Jul 24, 2009 at 6:31 AM, Dimitrios
>> Christodoulakis<di...@gmail.com> wrote:
>>> I tried to logically trace the flow within the framework and wanted to
>>> check if my thoughts are correct here, while at the same time asking a
>>> few more questions:
>>>
>>> As a start I take DefaultActionProxyFactory. DefaultActionProxyFactory
>>> instantiates DefaultActionProxy, but also gives us
>>> DefaultActionInvocation via its createActionProxy methods, using the
>>> "new" operator.
>>>
>>> The DefaultActionProxy constructor takes ActionInvocation as parameter
>>> and sets the ActionInvocation interface field by means of a
>>> DefaultActionInvocation implementation.
>>>
>>> Next, DefaultActionInvocation takes extraContext and a boolean as
>>> constructor params. It also has a reference to the ActionProxy which I
>>> believe sets via its init method?
>>>
>>> DefaultActionInvocation also creates the actions with its
>>> createAction(Map<String, Object> contextMap) method, letting an
>>> objectFactory take care of the actual creation with information taken
>>> from the ActionProxy (like action name, name space, config, etc).
>>>
>>> Then DefaultActionInvocation also invokes the action by calling
>>> invokeAction(action, actionConfig).
>>>
>>> This is more to help me understand the basic workflow at a higher
>>> level at first. Are my above statements correct?
>>>
>>> One thing that I find confusing (at this time) is the use of so many
>>> "contexts": extraContext, actionContext, invocationContext, etc. What
>>> is the primary use of the context? Is it similar to the configuration
>>> object?
>>>
>>> I still have as a short term objective to unit test my
>>> intercept(actionInvocation) method of my custom Interceptor, but is it
>>> true to assume that to prepare for the test I'd probably need to
>>> create a lot of dependencies manually? i.e. Create mock objects all
>>> the way deep to DefaultActionProxyFactory?
>>>
>>> Many thanks again for your help.
>>>
>>>
>>>
>>>
>>> On Thu, Jul 23, 2009 at 5:37 PM, Dave Newton<ne...@yahoo.com> wrote:
>>>> Dimitrios Christodoulakis wrote:
>>>>>
>>>>> By the way I noticed that when I downloaded the s2 source code, it
>>>>> didn't come with the opensymphony packages... Does the xwork source
>>>>> has to be downloaded separately?
>>>>
>>>> Yes.
>>>>
>>>> Dave
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
I plan to unit test the interceptor on its own. I am more interested
in testing its logic, not necessarily within the framework.

First step would be to mock an ActionInvocation object which is what
is passed to the Interceptor's intercept method. The action invocation
would need a mock action, and a mock session which will be holding the
user credentials. In order to have a session I would need to first
have an invocation object to get the session from:
actionInvocation.getInvocationContext().getSession()

On Fri, Jul 24, 2009 at 10:52 AM, Musachy Barroso<mu...@gmail.com> wrote:
> You don't need to create mock objects for the framework, you onlt need
> to mock the objects passed to the interceptor and invoke the
> interceptor directly, unless you really want to test the interceptor
> running inside struts (there is a long thread about that so i wont get
> into it)
>
> musachy
>
> On Fri, Jul 24, 2009 at 6:31 AM, Dimitrios
> Christodoulakis<di...@gmail.com> wrote:
>> I tried to logically trace the flow within the framework and wanted to
>> check if my thoughts are correct here, while at the same time asking a
>> few more questions:
>>
>> As a start I take DefaultActionProxyFactory. DefaultActionProxyFactory
>> instantiates DefaultActionProxy, but also gives us
>> DefaultActionInvocation via its createActionProxy methods, using the
>> "new" operator.
>>
>> The DefaultActionProxy constructor takes ActionInvocation as parameter
>> and sets the ActionInvocation interface field by means of a
>> DefaultActionInvocation implementation.
>>
>> Next, DefaultActionInvocation takes extraContext and a boolean as
>> constructor params. It also has a reference to the ActionProxy which I
>> believe sets via its init method?
>>
>> DefaultActionInvocation also creates the actions with its
>> createAction(Map<String, Object> contextMap) method, letting an
>> objectFactory take care of the actual creation with information taken
>> from the ActionProxy (like action name, name space, config, etc).
>>
>> Then DefaultActionInvocation also invokes the action by calling
>> invokeAction(action, actionConfig).
>>
>> This is more to help me understand the basic workflow at a higher
>> level at first. Are my above statements correct?
>>
>> One thing that I find confusing (at this time) is the use of so many
>> "contexts": extraContext, actionContext, invocationContext, etc. What
>> is the primary use of the context? Is it similar to the configuration
>> object?
>>
>> I still have as a short term objective to unit test my
>> intercept(actionInvocation) method of my custom Interceptor, but is it
>> true to assume that to prepare for the test I'd probably need to
>> create a lot of dependencies manually? i.e. Create mock objects all
>> the way deep to DefaultActionProxyFactory?
>>
>> Many thanks again for your help.
>>
>>
>>
>>
>> On Thu, Jul 23, 2009 at 5:37 PM, Dave Newton<ne...@yahoo.com> wrote:
>>> Dimitrios Christodoulakis wrote:
>>>>
>>>> By the way I noticed that when I downloaded the s2 source code, it
>>>> didn't come with the opensymphony packages... Does the xwork source
>>>> has to be downloaded separately?
>>>
>>> Yes.
>>>
>>> Dave
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: studying struts2 framework, ActionInvocation question

Posted by Musachy Barroso <mu...@gmail.com>.
You don't need to create mock objects for the framework, you onlt need
to mock the objects passed to the interceptor and invoke the
interceptor directly, unless you really want to test the interceptor
running inside struts (there is a long thread about that so i wont get
into it)

musachy

On Fri, Jul 24, 2009 at 6:31 AM, Dimitrios
Christodoulakis<di...@gmail.com> wrote:
> I tried to logically trace the flow within the framework and wanted to
> check if my thoughts are correct here, while at the same time asking a
> few more questions:
>
> As a start I take DefaultActionProxyFactory. DefaultActionProxyFactory
> instantiates DefaultActionProxy, but also gives us
> DefaultActionInvocation via its createActionProxy methods, using the
> "new" operator.
>
> The DefaultActionProxy constructor takes ActionInvocation as parameter
> and sets the ActionInvocation interface field by means of a
> DefaultActionInvocation implementation.
>
> Next, DefaultActionInvocation takes extraContext and a boolean as
> constructor params. It also has a reference to the ActionProxy which I
> believe sets via its init method?
>
> DefaultActionInvocation also creates the actions with its
> createAction(Map<String, Object> contextMap) method, letting an
> objectFactory take care of the actual creation with information taken
> from the ActionProxy (like action name, name space, config, etc).
>
> Then DefaultActionInvocation also invokes the action by calling
> invokeAction(action, actionConfig).
>
> This is more to help me understand the basic workflow at a higher
> level at first. Are my above statements correct?
>
> One thing that I find confusing (at this time) is the use of so many
> "contexts": extraContext, actionContext, invocationContext, etc. What
> is the primary use of the context? Is it similar to the configuration
> object?
>
> I still have as a short term objective to unit test my
> intercept(actionInvocation) method of my custom Interceptor, but is it
> true to assume that to prepare for the test I'd probably need to
> create a lot of dependencies manually? i.e. Create mock objects all
> the way deep to DefaultActionProxyFactory?
>
> Many thanks again for your help.
>
>
>
>
> On Thu, Jul 23, 2009 at 5:37 PM, Dave Newton<ne...@yahoo.com> wrote:
>> Dimitrios Christodoulakis wrote:
>>>
>>> By the way I noticed that when I downloaded the s2 source code, it
>>> didn't come with the opensymphony packages... Does the xwork source
>>> has to be downloaded separately?
>>
>> Yes.
>>
>> Dave
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
I tried to logically trace the flow within the framework and wanted to
check if my thoughts are correct here, while at the same time asking a
few more questions:

As a start I take DefaultActionProxyFactory. DefaultActionProxyFactory
instantiates DefaultActionProxy, but also gives us
DefaultActionInvocation via its createActionProxy methods, using the
"new" operator.

The DefaultActionProxy constructor takes ActionInvocation as parameter
and sets the ActionInvocation interface field by means of a
DefaultActionInvocation implementation.

Next, DefaultActionInvocation takes extraContext and a boolean as
constructor params. It also has a reference to the ActionProxy which I
believe sets via its init method?

DefaultActionInvocation also creates the actions with its
createAction(Map<String, Object> contextMap) method, letting an
objectFactory take care of the actual creation with information taken
from the ActionProxy (like action name, name space, config, etc).

Then DefaultActionInvocation also invokes the action by calling
invokeAction(action, actionConfig).

This is more to help me understand the basic workflow at a higher
level at first. Are my above statements correct?

One thing that I find confusing (at this time) is the use of so many
"contexts": extraContext, actionContext, invocationContext, etc. What
is the primary use of the context? Is it similar to the configuration
object?

I still have as a short term objective to unit test my
intercept(actionInvocation) method of my custom Interceptor, but is it
true to assume that to prepare for the test I'd probably need to
create a lot of dependencies manually? i.e. Create mock objects all
the way deep to DefaultActionProxyFactory?

Many thanks again for your help.




On Thu, Jul 23, 2009 at 5:37 PM, Dave Newton<ne...@yahoo.com> wrote:
> Dimitrios Christodoulakis wrote:
>>
>> By the way I noticed that when I downloaded the s2 source code, it
>> didn't come with the opensymphony packages... Does the xwork source
>> has to be downloaded separately?
>
> Yes.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dave Newton <ne...@yahoo.com>.
Dimitrios Christodoulakis wrote:
> By the way I noticed that when I downloaded the s2 source code, it
> didn't come with the opensymphony packages... Does the xwork source
> has to be downloaded separately?

Yes.

Dave

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
Actually I was speaking of my own custom interceptor (Authentiaction
interceptor) which I add on top of the default package.

Originally, I wanted to unit test my interceptor class and
particularly its intercept method which takes an ActionInvocation as a
parameter. My concern was how to create and instantiate a mock
ActionInvocation implementation and bind a dummy action to it.

This is leading me through the struts2 and xwork source code, which I
am thinking of running using breakpoints to see how the
ActionInvocation is intantiated. And at least follow the basic
workflow of the framework when it is trying to execute an action.

By the way I noticed that when I downloaded the s2 source code, it
didn't come with the opensymphony packages... Does the xwork source
has to be downloaded separately?

On Thu, Jul 23, 2009 at 11:11 AM, Martin Gainty<mg...@hotmail.com> wrote:
>
> you're speaking of org.apache.struts2.s1.ActionFormValidationInterceptor?
> which is an Interceptor class contained within Struts2-Struts1-plugin
>
> an excellent step by step tutorial on Struts2-Struts1-plugin is available at
> http://www.slideshare.net/mraible/migrating-from-struts-1-to-struts-2-presentation
>
> Maven is a build environment which outputs distros based on version specific plugins
> although l/t you'll want to use it for development it can be a bit daunting to setup properly
> HINT: I use localRepository always to avoid disconnect probs with main maven plugin remoteRepositories
>
> fairly intuitive tutorial is located at
> http://maven.apache.org/guides/getting-started/index.html
>
> hth
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Thu, 23 Jul 2009 07:51:37 -0500
>> Subject: Re: studying struts2 framework, ActionInvocation question
>> From: dimi.chr@gmail.com
>> To: user@struts.apache.org
>>
>> Just another thought I had this morning.
>>
>> Usually the framework is rather transparent to the struts user who
>> only creates actions with their corresponding results and run the
>> application on a server. I mean if the user doesn't have to customize
>> anything, create an interceptor, or even bother with session objects,
>> they might not encounter Proxy, Action Invocation, or Invocation
>> Context at all in their own code.
>>
>> But, of course, those objects are part of the framework, and they must
>> be instantiated and initialized without such user even knowing about
>> it. Which means that initialization happens within the framework
>> itself, and not in the user's code necessarily, right?
>>
>> So putting a breakpoint in the constructor of my
>> intercept(ActionInvocation actionInvocation) method, possibly won't
>> show me much, right? I have yet to try it, but this was just a
>> thought.
>>
>> On Wed, Jul 22, 2009 at 8:59 PM, Musachy Barroso<mu...@gmail.com> wrote:
>> > an easier way, is to install the maven plugin for eclipse, and then
>> > checkout the struts 2 code, and import apps/blank/pom.xml as a maven
>> > project. Then you can run and debug it from eclipse without having to
>> > download any code.
>> >
>> > musachy
>> >
>> > On Wed, Jul 22, 2009 at 6:23 PM, Dimitrios
>> > Christodoulakis<di...@gmail.com> wrote:
>> >> Thanks Dave and Martin. I learn something new every time!
>> >>
>> >> I was able to attach the source to struts2-core-2.1.6.jar and
>> >> xwork-2.1.2.jar by first downloading the source code and pointing to
>> >> the it from within eclipse.
>> >>
>> >> project->right click->properties->Java build path->Libraries->select
>> >> jar->Source Attachment->edit
>> >>
>> >> I will try the breakpoint next. I hope eclipse can trace a breakpoint
>> >> all the way to at least classes within those jars. Attaching code to
>> >> each and every jar in the project sounds a bit tedious. I mean I
>> >> manually downloaded the source and attached it. So for all other jars,
>> >> spring, hibernate, commons, etc -- should take a long time. Unless it
>> >> could be done automatically by eclipse, but I am not sure. Probably
>> >> not
>> >>
>> >> On Wed, Jul 22, 2009 at 8:11 PM, Martin Gainty<mg...@hotmail.com> wrote:
>> >>>
>> >>> unless someone redesigned Eclipse breakpoint wont be able to see a class packaged in the jar *at least with ganymede*
>> >>> stick with debug algorithm's mentioned earlier
>> >>> (main focus would be to debug action initialisation as dave mentioned)
>> >>> ...
>> >>> Martin
>> >>> ______________________________________________
>> >>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>> >>>
>> >>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> >>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>> Date: Wed, 22 Jul 2009 19:49:23 -0500
>> >>>> Subject: Re: studying struts2 framework, ActionInvocation question
>> >>>> From: dimi.chr@gmail.com
>> >>>> To: user@struts.apache.org
>> >>>>
>> >>>> Dave Newton wrote:
>> >>>> >
>> >>>> > Won't help track action invocation initialization, methinks.
>> >>>> >
>> >>>>
>> >>>> Is there a particular way you would recommend to go about doing it
>> >>>> actually? I am using eclipse for my ide, but I am not sure if
>> >>>> breakpoints can trace through the compiled classes in the jars.
>> >>>>
>> >>>> Much appreciate the advice.
>> >>>>
>> >>>> On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
>> >>>> > Martin Gainty wrote:
>> >>>> >>
>> >>>> >> does vi have breakpoints.. am i missing something?
>> >>>> >
>> >>>> > ....
>> >>>> >
>> >>>> > In this case you actually saw something nobody else did--a vi reference.
>> >>>> >
>> >>>> >> or debug
>> >>>> >> before craig and ted left (i wished they both stayed but thats another
>> >>>> >> topic)
>> >>>> >> a DebuggingInterceptor was coded and is activated by
>> >>>> >> struts.devMode = true
>> >>>> >> http://struts.apache.org/2.0.14/docs/debugging.html
>> >>>> >>
>> >>>> >> then address would contain ?debug=<parameter> in url should specifies
>> >>>> >> either
>> >>>> >> ?debug=xml or ?debug=console to the URL.
>> >>>> >
>> >>>> > Won't help track action invocation initialization, methinks.
>> >>>> >
>> >>>> > Dave
>> >>>> >
>> >>>> > ---------------------------------------------------------------------
>> >>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >>>> > For additional commands, e-mail: user-help@struts.apache.org
>> >>>> >
>> >>>> >
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >>>> For additional commands, e-mail: user-help@struts.apache.org
>> >>>>
>> >>>
>> >>> _________________________________________________________________
>> >>> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
>> >>> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

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


RE: studying struts2 framework, ActionInvocation question

Posted by Martin Gainty <mg...@hotmail.com>.
you're speaking of org.apache.struts2.s1.ActionFormValidationInterceptor?
which is an Interceptor class contained within Struts2-Struts1-plugin

an excellent step by step tutorial on Struts2-Struts1-plugin is available at
http://www.slideshare.net/mraible/migrating-from-struts-1-to-struts-2-presentation

Maven is a build environment which outputs distros based on version specific plugins
although l/t you'll want to use it for development it can be a bit daunting to setup properly
HINT: I use localRepository always to avoid disconnect probs with main maven plugin remoteRepositories

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




> Date: Thu, 23 Jul 2009 07:51:37 -0500
> Subject: Re: studying struts2 framework, ActionInvocation question
> From: dimi.chr@gmail.com
> To: user@struts.apache.org
> 
> Just another thought I had this morning.
> 
> Usually the framework is rather transparent to the struts user who
> only creates actions with their corresponding results and run the
> application on a server. I mean if the user doesn't have to customize
> anything, create an interceptor, or even bother with session objects,
> they might not encounter Proxy, Action Invocation, or Invocation
> Context at all in their own code.
> 
> But, of course, those objects are part of the framework, and they must
> be instantiated and initialized without such user even knowing about
> it. Which means that initialization happens within the framework
> itself, and not in the user's code necessarily, right?
> 
> So putting a breakpoint in the constructor of my
> intercept(ActionInvocation actionInvocation) method, possibly won't
> show me much, right? I have yet to try it, but this was just a
> thought.
> 
> On Wed, Jul 22, 2009 at 8:59 PM, Musachy Barroso<mu...@gmail.com> wrote:
> > an easier way, is to install the maven plugin for eclipse, and then
> > checkout the struts 2 code, and import apps/blank/pom.xml as a maven
> > project. Then you can run and debug it from eclipse without having to
> > download any code.
> >
> > musachy
> >
> > On Wed, Jul 22, 2009 at 6:23 PM, Dimitrios
> > Christodoulakis<di...@gmail.com> wrote:
> >> Thanks Dave and Martin. I learn something new every time!
> >>
> >> I was able to attach the source to struts2-core-2.1.6.jar and
> >> xwork-2.1.2.jar by first downloading the source code and pointing to
> >> the it from within eclipse.
> >>
> >> project->right click->properties->Java build path->Libraries->select
> >> jar->Source Attachment->edit
> >>
> >> I will try the breakpoint next. I hope eclipse can trace a breakpoint
> >> all the way to at least classes within those jars. Attaching code to
> >> each and every jar in the project sounds a bit tedious. I mean I
> >> manually downloaded the source and attached it. So for all other jars,
> >> spring, hibernate, commons, etc -- should take a long time. Unless it
> >> could be done automatically by eclipse, but I am not sure. Probably
> >> not
> >>
> >> On Wed, Jul 22, 2009 at 8:11 PM, Martin Gainty<mg...@hotmail.com> wrote:
> >>>
> >>> unless someone redesigned Eclipse breakpoint wont be able to see a class packaged in the jar *at least with ganymede*
> >>> stick with debug algorithm's mentioned earlier
> >>> (main focus would be to debug action initialisation as dave mentioned)
> >>> ...
> >>> Martin
> >>> ______________________________________________
> >>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >>>
> >>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> >>>
> >>>
> >>>
> >>>
> >>>> Date: Wed, 22 Jul 2009 19:49:23 -0500
> >>>> Subject: Re: studying struts2 framework, ActionInvocation question
> >>>> From: dimi.chr@gmail.com
> >>>> To: user@struts.apache.org
> >>>>
> >>>> Dave Newton wrote:
> >>>> >
> >>>> > Won't help track action invocation initialization, methinks.
> >>>> >
> >>>>
> >>>> Is there a particular way you would recommend to go about doing it
> >>>> actually? I am using eclipse for my ide, but I am not sure if
> >>>> breakpoints can trace through the compiled classes in the jars.
> >>>>
> >>>> Much appreciate the advice.
> >>>>
> >>>> On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
> >>>> > Martin Gainty wrote:
> >>>> >>
> >>>> >> does vi have breakpoints.. am i missing something?
> >>>> >
> >>>> > ....
> >>>> >
> >>>> > In this case you actually saw something nobody else did--a vi reference.
> >>>> >
> >>>> >> or debug
> >>>> >> before craig and ted left (i wished they both stayed but thats another
> >>>> >> topic)
> >>>> >> a DebuggingInterceptor was coded and is activated by
> >>>> >> struts.devMode = true
> >>>> >> http://struts.apache.org/2.0.14/docs/debugging.html
> >>>> >>
> >>>> >> then address would contain ?debug=<parameter> in url should specifies
> >>>> >> either
> >>>> >> ?debug=xml or ?debug=console to the URL.
> >>>> >
> >>>> > Won't help track action invocation initialization, methinks.
> >>>> >
> >>>> > Dave
> >>>> >
> >>>> > ---------------------------------------------------------------------
> >>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>> > For additional commands, e-mail: user-help@struts.apache.org
> >>>> >
> >>>> >
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>
> >>>
> >>> _________________________________________________________________
> >>> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
> >>> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
Just another thought I had this morning.

Usually the framework is rather transparent to the struts user who
only creates actions with their corresponding results and run the
application on a server. I mean if the user doesn't have to customize
anything, create an interceptor, or even bother with session objects,
they might not encounter Proxy, Action Invocation, or Invocation
Context at all in their own code.

But, of course, those objects are part of the framework, and they must
be instantiated and initialized without such user even knowing about
it. Which means that initialization happens within the framework
itself, and not in the user's code necessarily, right?

So putting a breakpoint in the constructor of my
intercept(ActionInvocation actionInvocation) method, possibly won't
show me much, right? I have yet to try it, but this was just a
thought.

On Wed, Jul 22, 2009 at 8:59 PM, Musachy Barroso<mu...@gmail.com> wrote:
> an easier way, is to install the maven plugin for eclipse, and then
> checkout the struts 2 code, and import apps/blank/pom.xml as a maven
> project. Then you can run and debug it from eclipse without having to
> download any code.
>
> musachy
>
> On Wed, Jul 22, 2009 at 6:23 PM, Dimitrios
> Christodoulakis<di...@gmail.com> wrote:
>> Thanks Dave and Martin. I learn something new every time!
>>
>> I was able to attach the source to struts2-core-2.1.6.jar and
>> xwork-2.1.2.jar by first downloading the source code and pointing to
>> the it from within eclipse.
>>
>> project->right click->properties->Java build path->Libraries->select
>> jar->Source Attachment->edit
>>
>> I will try the breakpoint next. I hope eclipse can trace a breakpoint
>> all the way to at least classes within those jars. Attaching code to
>> each and every jar in the project sounds a bit tedious. I mean I
>> manually downloaded the source and attached it. So for all other jars,
>> spring, hibernate, commons, etc -- should take a long time. Unless it
>> could be done automatically by eclipse, but I am not sure. Probably
>> not
>>
>> On Wed, Jul 22, 2009 at 8:11 PM, Martin Gainty<mg...@hotmail.com> wrote:
>>>
>>> unless someone redesigned Eclipse breakpoint wont be able to see a class packaged in the jar *at least with ganymede*
>>> stick with debug algorithm's mentioned earlier
>>> (main focus would be to debug action initialisation as dave mentioned)
>>> ...
>>> Martin
>>> ______________________________________________
>>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>>>
>>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>>>
>>>
>>>
>>>
>>>> Date: Wed, 22 Jul 2009 19:49:23 -0500
>>>> Subject: Re: studying struts2 framework, ActionInvocation question
>>>> From: dimi.chr@gmail.com
>>>> To: user@struts.apache.org
>>>>
>>>> Dave Newton wrote:
>>>> >
>>>> > Won't help track action invocation initialization, methinks.
>>>> >
>>>>
>>>> Is there a particular way you would recommend to go about doing it
>>>> actually? I am using eclipse for my ide, but I am not sure if
>>>> breakpoints can trace through the compiled classes in the jars.
>>>>
>>>> Much appreciate the advice.
>>>>
>>>> On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
>>>> > Martin Gainty wrote:
>>>> >>
>>>> >> does vi have breakpoints.. am i missing something?
>>>> >
>>>> > ....
>>>> >
>>>> > In this case you actually saw something nobody else did--a vi reference.
>>>> >
>>>> >> or debug
>>>> >> before craig and ted left (i wished they both stayed but thats another
>>>> >> topic)
>>>> >> a DebuggingInterceptor was coded and is activated by
>>>> >> struts.devMode = true
>>>> >> http://struts.apache.org/2.0.14/docs/debugging.html
>>>> >>
>>>> >> then address would contain ?debug=<parameter> in url should specifies
>>>> >> either
>>>> >> ?debug=xml or ?debug=console to the URL.
>>>> >
>>>> > Won't help track action invocation initialization, methinks.
>>>> >
>>>> > Dave
>>>> >
>>>> > ---------------------------------------------------------------------
>>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> > For additional commands, e-mail: user-help@struts.apache.org
>>>> >
>>>> >
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>> _________________________________________________________________
>>> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
>>> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: studying struts2 framework, ActionInvocation question

Posted by Musachy Barroso <mu...@gmail.com>.
an easier way, is to install the maven plugin for eclipse, and then
checkout the struts 2 code, and import apps/blank/pom.xml as a maven
project. Then you can run and debug it from eclipse without having to
download any code.

musachy

On Wed, Jul 22, 2009 at 6:23 PM, Dimitrios
Christodoulakis<di...@gmail.com> wrote:
> Thanks Dave and Martin. I learn something new every time!
>
> I was able to attach the source to struts2-core-2.1.6.jar and
> xwork-2.1.2.jar by first downloading the source code and pointing to
> the it from within eclipse.
>
> project->right click->properties->Java build path->Libraries->select
> jar->Source Attachment->edit
>
> I will try the breakpoint next. I hope eclipse can trace a breakpoint
> all the way to at least classes within those jars. Attaching code to
> each and every jar in the project sounds a bit tedious. I mean I
> manually downloaded the source and attached it. So for all other jars,
> spring, hibernate, commons, etc -- should take a long time. Unless it
> could be done automatically by eclipse, but I am not sure. Probably
> not
>
> On Wed, Jul 22, 2009 at 8:11 PM, Martin Gainty<mg...@hotmail.com> wrote:
>>
>> unless someone redesigned Eclipse breakpoint wont be able to see a class packaged in the jar *at least with ganymede*
>> stick with debug algorithm's mentioned earlier
>> (main focus would be to debug action initialisation as dave mentioned)
>> ...
>> Martin
>> ______________________________________________
>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>>
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>>
>>
>>
>>
>>> Date: Wed, 22 Jul 2009 19:49:23 -0500
>>> Subject: Re: studying struts2 framework, ActionInvocation question
>>> From: dimi.chr@gmail.com
>>> To: user@struts.apache.org
>>>
>>> Dave Newton wrote:
>>> >
>>> > Won't help track action invocation initialization, methinks.
>>> >
>>>
>>> Is there a particular way you would recommend to go about doing it
>>> actually? I am using eclipse for my ide, but I am not sure if
>>> breakpoints can trace through the compiled classes in the jars.
>>>
>>> Much appreciate the advice.
>>>
>>> On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
>>> > Martin Gainty wrote:
>>> >>
>>> >> does vi have breakpoints.. am i missing something?
>>> >
>>> > ....
>>> >
>>> > In this case you actually saw something nobody else did--a vi reference.
>>> >
>>> >> or debug
>>> >> before craig and ted left (i wished they both stayed but thats another
>>> >> topic)
>>> >> a DebuggingInterceptor was coded and is activated by
>>> >> struts.devMode = true
>>> >> http://struts.apache.org/2.0.14/docs/debugging.html
>>> >>
>>> >> then address would contain ?debug=<parameter> in url should specifies
>>> >> either
>>> >> ?debug=xml or ?debug=console to the URL.
>>> >
>>> > Won't help track action invocation initialization, methinks.
>>> >
>>> > Dave
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> > For additional commands, e-mail: user-help@struts.apache.org
>>> >
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>> _________________________________________________________________
>> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
>> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
Thanks Dave and Martin. I learn something new every time!

I was able to attach the source to struts2-core-2.1.6.jar and
xwork-2.1.2.jar by first downloading the source code and pointing to
the it from within eclipse.

project->right click->properties->Java build path->Libraries->select
jar->Source Attachment->edit

I will try the breakpoint next. I hope eclipse can trace a breakpoint
all the way to at least classes within those jars. Attaching code to
each and every jar in the project sounds a bit tedious. I mean I
manually downloaded the source and attached it. So for all other jars,
spring, hibernate, commons, etc -- should take a long time. Unless it
could be done automatically by eclipse, but I am not sure. Probably
not

On Wed, Jul 22, 2009 at 8:11 PM, Martin Gainty<mg...@hotmail.com> wrote:
>
> unless someone redesigned Eclipse breakpoint wont be able to see a class packaged in the jar *at least with ganymede*
> stick with debug algorithm's mentioned earlier
> (main focus would be to debug action initialisation as dave mentioned)
> ...
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Wed, 22 Jul 2009 19:49:23 -0500
>> Subject: Re: studying struts2 framework, ActionInvocation question
>> From: dimi.chr@gmail.com
>> To: user@struts.apache.org
>>
>> Dave Newton wrote:
>> >
>> > Won't help track action invocation initialization, methinks.
>> >
>>
>> Is there a particular way you would recommend to go about doing it
>> actually? I am using eclipse for my ide, but I am not sure if
>> breakpoints can trace through the compiled classes in the jars.
>>
>> Much appreciate the advice.
>>
>> On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
>> > Martin Gainty wrote:
>> >>
>> >> does vi have breakpoints.. am i missing something?
>> >
>> > ....
>> >
>> > In this case you actually saw something nobody else did--a vi reference.
>> >
>> >> or debug
>> >> before craig and ted left (i wished they both stayed but thats another
>> >> topic)
>> >> a DebuggingInterceptor was coded and is activated by
>> >> struts.devMode = true
>> >> http://struts.apache.org/2.0.14/docs/debugging.html
>> >>
>> >> then address would contain ?debug=<parameter> in url should specifies
>> >> either
>> >> ?debug=xml or ?debug=console to the URL.
>> >
>> > Won't help track action invocation initialization, methinks.
>> >
>> > Dave
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

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


RE: studying struts2 framework, ActionInvocation question

Posted by Martin Gainty <mg...@hotmail.com>.
unless someone redesigned Eclipse breakpoint wont be able to see a class packaged in the jar *at least with ganymede*
stick with debug algorithm's mentioned earlier
(main focus would be to debug action initialisation as dave mentioned)
...
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Wed, 22 Jul 2009 19:49:23 -0500
> Subject: Re: studying struts2 framework, ActionInvocation question
> From: dimi.chr@gmail.com
> To: user@struts.apache.org
> 
> Dave Newton wrote:
> >
> > Won't help track action invocation initialization, methinks.
> >
> 
> Is there a particular way you would recommend to go about doing it
> actually? I am using eclipse for my ide, but I am not sure if
> breakpoints can trace through the compiled classes in the jars.
> 
> Much appreciate the advice.
> 
> On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
> > Martin Gainty wrote:
> >>
> >> does vi have breakpoints.. am i missing something?
> >
> > ....
> >
> > In this case you actually saw something nobody else did--a vi reference.
> >
> >> or debug
> >> before craig and ted left (i wished they both stayed but thats another
> >> topic)
> >> a DebuggingInterceptor was coded and is activated by
> >> struts.devMode = true
> >> http://struts.apache.org/2.0.14/docs/debugging.html
> >>
> >> then address would contain ?debug=<parameter> in url should specifies
> >> either
> >> ?debug=xml or ?debug=console to the URL.
> >
> > Won't help track action invocation initialization, methinks.
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Re: studying struts2 framework, ActionInvocation question

Posted by Dave Newton <ne...@yahoo.com>.
Dimitrios Christodoulakis wrote:
> Dave Newton wrote:
>> Won't help track action invocation initialization, methinks.
>>
> 
> Is there a particular way you would recommend to go about doing it
> actually? I am using eclipse for my ide, but I am not sure if
> breakpoints can trace through the compiled classes in the jars.

You should be able to attach the source to the XW/S2 jars; IIRC if you 
right-click on the jar in the project view's "Referenced Libraries" thing.

Dave

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dimitrios Christodoulakis <di...@gmail.com>.
Dave Newton wrote:
>
> Won't help track action invocation initialization, methinks.
>

Is there a particular way you would recommend to go about doing it
actually? I am using eclipse for my ide, but I am not sure if
breakpoints can trace through the compiled classes in the jars.

Much appreciate the advice.

On Wed, Jul 22, 2009 at 7:44 PM, Dave Newton<ne...@yahoo.com> wrote:
> Martin Gainty wrote:
>>
>> does vi have breakpoints.. am i missing something?
>
> ....
>
> In this case you actually saw something nobody else did--a vi reference.
>
>> or debug
>> before craig and ted left (i wished they both stayed but thats another
>> topic)
>> a DebuggingInterceptor was coded and is activated by
>> struts.devMode = true
>> http://struts.apache.org/2.0.14/docs/debugging.html
>>
>> then address would contain ?debug=<parameter> in url should specifies
>> either
>> ?debug=xml or ?debug=console to the URL.
>
> Won't help track action invocation initialization, methinks.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: studying struts2 framework, ActionInvocation question

Posted by Dave Newton <ne...@yahoo.com>.
Martin Gainty wrote:
> does vi have breakpoints.. am i missing something?

....

In this case you actually saw something nobody else did--a vi reference.

> or debug
> before craig and ted left (i wished they both stayed but thats another topic)
> a DebuggingInterceptor was coded and is activated by
> struts.devMode = true
> http://struts.apache.org/2.0.14/docs/debugging.html
> 
> then address would contain ?debug=<parameter> in url should specifies either
> ?debug=xml or ?debug=console to the URL.

Won't help track action invocation initialization, methinks.

Dave

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


RE: studying struts2 framework, ActionInvocation question

Posted by Martin Gainty <mg...@hotmail.com>.
does vi have breakpoints.. am i missing something?

if you need to run this outside of an ide either use Logger.debug(variable);
http://www.oracle.com/technology/products/jdev/tips/mills/Struts-logging.html

or debug
before craig and ted left (i wished they both stayed but thats another topic)
a DebuggingInterceptor was coded and is activated by
struts.devMode = true
http://struts.apache.org/2.0.14/docs/debugging.html

then address would contain ?debug=<parameter> in url should specifies either
?debug=xml or ?debug=console to the URL.

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




> Date: Wed, 22 Jul 2009 14:17:50 -0700
> Subject: Re: studying struts2 framework, ActionInvocation question
> From: musachy@gmail.com
> To: user@struts.apache.org
> 
> The best way to find out all these things is to put breakpoints in the
> constructor and/or the setter methods.
> 
> musachy
> 
> On Wed, Jul 22, 2009 at 2:05 PM, Dimitrios
> Christodoulakis<di...@gmail.com> wrote:
> > Hello,
> >
> > According to the XWork feature description,
> > http://www.opensymphony.com/xwork/wikidocs/XWork%20Features.html, the
> > ActionInvocation represents the execution state of an action holding
> > the action instance and the interceptors.
> >
> > I have been looking at
> > http://struts.apache.org/2.1.6/struts2-core/apidocs and examining an
> > implementation of the ActionInvocation interface:
> > DefaultActionInvocation and was wondering how does this class gets a
> > hold of the action instance and the interceptors? It has relevant
> > fields like action, interceptors and proxy with getters for the action
> > and the proxy. But it is not straightforward to me how the action
> > instance (and the interceptors) are injected to it.. I didn't see
> > setter methods for the action.
> >
> > My motivation for this question comes also from wanting to unit test
> > an interceptor's intercept(ActionInvocation actionInvocation) method.
> > I will need to pass an ActionInvocation as a parameter, which then the
> > interceptor will use to extract the actual action instance from.
> > (Among other things, like the InvocationContext to get the session).
> >
> > So I was also wondering how to provide a mock-type of an
> > ActionInvocation which will contain a mock action, a mock session etc.
> > I mean I understand how to create a mock action and a mock session map
> > with some parameters in it, but how do I bind those to a mock
> > ActionInvocation? Would I need perhaps to start with a mock
> > ActionProxy?
> >
> > Thanks for your advice. This will help me design the test case and
> > also learn more about the struts2 mechanics.
> > Regards!
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1

Re: studying struts2 framework, ActionInvocation question

Posted by Musachy Barroso <mu...@gmail.com>.
The best way to find out all these things is to put breakpoints in the
constructor and/or the setter methods.

musachy

On Wed, Jul 22, 2009 at 2:05 PM, Dimitrios
Christodoulakis<di...@gmail.com> wrote:
> Hello,
>
> According to the XWork feature description,
> http://www.opensymphony.com/xwork/wikidocs/XWork%20Features.html, the
> ActionInvocation represents the execution state of an action holding
> the action instance and the interceptors.
>
> I have been looking at
> http://struts.apache.org/2.1.6/struts2-core/apidocs and examining an
> implementation of the ActionInvocation interface:
> DefaultActionInvocation and was wondering how does this class gets a
> hold of the action instance and the interceptors? It has relevant
> fields like action, interceptors and proxy with getters for the action
> and the proxy. But it is not straightforward to me how the action
> instance (and the interceptors) are injected to it.. I didn't see
> setter methods for the action.
>
> My motivation for this question comes also from wanting to unit test
> an interceptor's intercept(ActionInvocation actionInvocation) method.
> I will need to pass an ActionInvocation as a parameter, which then the
> interceptor will use to extract the actual action instance from.
> (Among other things, like the InvocationContext to get the session).
>
> So I was also wondering how to provide a mock-type of an
> ActionInvocation which will contain a mock action, a mock session etc.
> I mean I understand how to create a mock action and a mock session map
> with some parameters in it, but how do I bind those to a mock
> ActionInvocation? Would I need perhaps to start with a mock
> ActionProxy?
>
> Thanks for your advice. This will help me design the test case and
> also learn more about the struts2 mechanics.
> Regards!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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