Hello Michael,
        Not sure if this is of any help, but
Mr Ted Husted has written a MailReader application
That uses Struts and Common Chains, 
When I checked it out (last april) it was at this link

http://svn.apache.org/viewcvs.cgi/struts/sandbox/trunk/?root=Apache-SVN

I have followed that app in writing my own that uses commands defined
In a spring config file..

Business logic is done in the command, Actions behave exactly like
Before..

I'll try to answer some of your question (anyone pls correct me if I am
Wrong...) ... based on what I have done using samples & articles around,
& advices from Joe et other 1.3 guys..
Keep in mind that what I am referring is to an application like MailReader,
I have used Commands just for moving logic out of Actions,not for modifying
The chain used by struts itself..


> (1) The first one is where to check 1.3 out from? Ok, I might have not
>been following the list, but http://struts.apache.org does not have
>links to 1.3 source code nor it explains how to set up Subversion. I
>

Last time I checked (April) jars were at this link
http://svn.apache.org/builds/struts/maven/nightly/


beware though that Struts 1.3 does not include by default taglibs & tiles,
so you need to download a separate jar for that

>Also, I would like to get all sources in a jar file with a build
>script. I do not really want to check out file by file from repository
>unless this is really justified.

At same location there should be a zip file for sources (which includes
Also build.xml)


>(2) How tight is integration between commands from chain-config.xml
>and actions from struts-config.xml ? Should not it be possible to
>define actions in chain-config.xml as commands? I know that actions
>have more attributes and they have <forward> elements, but tighter
>integration would be a great thing.

This answer is from my point of view.... Following Ted's example,
All my business logic is now in the Command.. all action does Is simply
To build context and pass it to the command.. so code in action is really
very simple..


>Command returns true or false, Action returns ActionForward. How does
>this work? Where the action forward is returned to? Is it set into the
>context?

ActionForward will be selected depending on what the command return.
Normally if the command return false, you will go to original page..


>(4) Neither Bill's article nor Vic's example stress out the scope of
>the Context. Is it filled out for each request? 

Yes in my opinion..

>Can I set up the scope
>for the Context? Considering that Context has accessors for request,
>session and servletcontext, it should be a long-term object. Whom it
>belongs to? Should access to it be synchronized?

If I am right, context is the only way to pass data from Action to Commands.
Again, following ted's example, my Action build a context and populates with
What the Command needs to do its logic. So, for example, get that username &
password from request, put it into the Context and pass the Context to the
command, which will use what is in the context to do a login operation for
example

>(5) It is nice that process() is changed into a chain, but what are
>the relations and dependencies between the commands? How do they
>affect each other? 

They will affect each other when a command is itself a chain of commands..
Sorry I don't know how to explain it better, maybe joe or other 1.3
committers could make a case (I didn't find one for my needs)..


>What do they store in the context and what do they
>expect?

What do they store: the data resulted from the operation the command
executed, which could be needed by an Action or other commands

What do they expect: the data needed for performing the operation
That the command does.. for example logging in, querying a database,
inserting data etc..

> What would be the effect of removing a standard command or
>adding a new one? This question does not require immediate answer,
>rather a reminder for better docs ;-)

Are you talking about the chain used by Struts itself? Well If you
Remove a command out of the struts chain, I think things are going
To be pretty difficult :)
Adding/overriding commands will result in your commands being executed, and
as long as the existing commands can find in the context what they need,
There shouldn't be any problems..

If you check StrutsWS_Struts1.3 app at this link

http://cvs.sourceforge.net/viewcvs.py/strutsws/

it overrides struts default chain to add additional processing..


hope I haven't confused you more.... :)

HTH
        marco









(6) Bill's article [2] shows a login interceptor implemented as
command, but all it does is displays 403 error. Well, it reminds that
request and response objects did not go nowhere, and can be used, but
what I would like to see is not short-circuiting the chain, but
redirecting to a login action. I am not sure how this is going to work
in the chain. Should I somehow preselect the interceptor action (login
action) before SelectAction command? Or exactly in this command? What
about other commands like PopulateActionForm or ValidateActionForm? I
do not need to execute them, but I need to execute CreateAction and
ExecuteAction, which are in the end of the chain. How do I jump to
them across other commands that I do not need? Or this use case should
be handled by creating a new small chain specifically for login
action, which would include only SelectAction, CreateAction and
ExecuteAction, and then short-circuiting?

References:
[1] A Look at Commons Chain, Part 1: http://www.onjava.com/lpt/a/5671
[2] A Look at Commons Chain, Part 2: http://www.onjava.com/lpt/a/5693
[3] Better Code With Struts 1.3:
http://www.infonoia.com/en/content.jsp?d=inf.05.06&pr=1

Michael.

On 9/8/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> Thanks, Joe.
> 
> I jumped a gun a little, since the articles at OnJava give pretty good
> understanding of Struts chains:
> 
> http://www.onjava.com/lpt/a/5671
> http://www.onjava.com/lpt/a/5693
> 
> I need to play with it a bit. Seems that I will be able to use
> ActionForm only (or whatever other class I decide to use) for
> collecting request paramaters as well as for event handling, and to
> throw Action away altogether ;-)
> 
> Michael.
> 
> On 9/8/05, Joe Germuska <[EMAIL PROTECTED]> wrote:
> > >Considering that 1.3 is on the radar, there should be better docs for
> > >this crucial feature, should not it?
> >
> > Indeed it should.  Alas, last time I set out to write docs, I instead
> > realized a bunch of things that had to be changed (rather than write
> > doc thinking "it should be like this, but it's really like that"...).
> >
> > Since then, I've had only enough time for Struts as needed to keep up
> > with stuff at work.  I will gladly try to answer questions on the
> > lists, and all the better if those answers help to support
> > documentation.
> >
> > >I would contribute writing it,
> > >but I don't know how to use it yet ;-)
> >
> > It's actually pretty straightforward; if you have time and interest,
> > dive in and let us know what your questions are.
> >
> > Joe
> >
> > --
> > Joe Germuska
> > [EMAIL PROTECTED]
> > http://blog.germuska.com
> > "Narrow minds are weapons made for mass destruction"  -The Ex

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


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

Reply via email to