struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil Kumar T" <anilkum...@infics.com>
Subject RE: Preprocessing of request
Date Thu, 14 Dec 2006 07:32:06 GMT

Hi Frank,

Referring to your response..
you might also be able
to have a base Action that all your Actions extend from, and the base
action does the transformation before the real work happens.  This might
work if you don't need the transformation to happen before that point.

How does this works ? Theoretically I understand this, but how to
implement this? I mean where do we mention our CustomizedBaseAction
class name? some where in properties ? Can you tell me..?

Anil.



-----Original Message-----
From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
Sent: Wednesday, December 13, 2006 1:03 AM
To: Struts Users Mailing List
Cc: 'user@struts.apache.org'
Subject: Re: Preprocessing of request

Your best bet most likely is a servlet filter.  Do the transformation
and
stuff the transformed content in request as an attribute, then grab it
later in your Actions.

Which version of Struts are you using?  If pre-1.3, modifying the RP is
one of the few other options as Dave mentioned... you might also be able
to have a base Action that all your Actions extend from, and the base
action does the transformation before the real work happens.  This might
work if you don't need the transformation to happen before that point.

If using 1.3.x, you could write a command to do it and modify the RP
chain.

If 2.x, an interceptor is probably the right answer.

However, in all these cases, a servlet filter would work, and would keep
your transformation logic abstracted out of Struts itself, so one less
thing to worry about if you upgrade versions later :)

Frank


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Tue, December 12, 2006 1:17 pm, O'Toole, Joe wrote:
> Hi
>
> My application receieves an xml request. I need to perform some
> transformation of this xml before performing business logic etc.
>
> Is there anyway I can configure through struts that I can invoke a
java
> class that does this task as I don't want to perform it in the action
or
> the
> model. Something like the plug-in element in the struts-config.xml
that
> invokes a java class that adheres to correct interface for performing
> tasks
> when the app is starting/stopping.
>
> I cannot see where I can do this and I would really to make this task
> configurable and push it out from the action or model
>
> Thanks
>
> Joe
>
>
>


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


Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and /
or its Customers and is intended for use only by the individual or the entity to which it
is addressed, and may contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you are not the intended recipient or it appears that
this mail has been forwarded to you without proper authority, you are notified that any use
or dissemination of this information in any manner is strictly prohibited. In such cases,
please notify us immediately at info.in@infics.com and delete this email from your records.

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


Mime
View raw message