struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: question about DWR integration
Date Wed, 25 Oct 2006 14:07:56 GMT
Yes, I think its possible... you'd have to remap the URL for the legacy
servlet to ActionServlet, then, to keep things simple, have at minimum 1
Action mapping that uses ActionForward to the servlet (could have your own
Action in there if you wanted to do some processing in it).

This would introduce overhead to every request bound for that servlet,
(it's one servlet forwarding to another at the end of the day), and would
also throw Struts into the mix without really using anything it has to
offer.

So, while you could do it, I wouldn't :)  Getting the common code out into
a filter would likely work out better, certainly it would be cleaner. 
Alternatively, maybe you could take that legacy servlet and make it an
Action?  That probably wouldn't be a huge refactor either... Then you
could leave your custom RP in place if you wanted, continue using Struts
entirely... would also simplify your web.xml a bit.  6 of 1, half dozen of
another I suppose.

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 Wed, October 25, 2006 8:36 am, Ilya Liubovich wrote:
> Thanks Frank!
> It's a great idea. I'll give it a try.
> But to generalize a bit on my question.
> Let's say you have a legacy servlet, which is mapped to a certain url
> pattern.
> Now, you'd to use only  a single controller ( the struts' controller), and
> do some processing on all of the requests, before control gets to the
> servlet.
> Is it possible, without modifying the URL, and the servlet?
>
> Thanks much, Lig
>
>>From: "Frank W. Zammetti" <fzlists@omnytex.com>
>>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>>To: Struts Users Mailing List <user@struts.apache.org>
>>Subject: Re: question about DWR integration
>>Date: Wed, 25 Oct 2006 00:01:05 -0400
>>
>>Hi Lig,
>>
>>I think you would want to do two things... first, abstract out your
>>authorization code from the RP into a filter... you should be able to
>> slap
>>this in front of vanilla Struts and get the same effect (perhaps with a
>>little tweaking, since I'm not familiar with your implementation).
>>
>>Next, map this filter to ActionServlet, as well as DWRServlet... DWR and
>>Struts are really two different things (existing integration aside), and
>> I
>>don't think it would make much sense to run requests through Struts and
>>then DWR... I can see why you'd think that with the auth code in the RP,
>>but once its externalized, I think everything becomes quite a bit
>> cleaner.
>>
>>Frank
>>
>>Ilya Liubovich wrote:
>>>Hi,
>>>I've asked this on the DWR mailing list, but never got a response.
>>>May you be you can help.
>>>The issue is the following:
>>>
>>>I have an extension to requestProcessor which deals with authorizing
>>>requests based on request parameteres. I'd like to do the same to the
>>>requests directed to the DWR servlet.
>>>My thinking was first, map url /dwr* to the ActionServlet, do the
>>> required
>>>checks in the
>>>processMapping() of the extension of RequestProcessor, and then forward
>>>the request to the
>>>DWR servlet.
>>>
>>>Is this a right approach?
>>>If so, could somebody advice how to do it?
>>>Thanks, Lig
>>>
>>>_________________________________________________________________
>>>Stay in touch with old friends and meet new ones with Windows Live
>>> Spaces
>>>http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>
>>--
>>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!
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Find a local pizza place, music store, museum and moreĀ…then map the best
> route!  http://local.live.com?FORM=MGA001
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message