On 7/15/07, Charles Goddard <[email protected]> wrote:
Alex,
You hit it on the head when saying "or are used to determine what
Magnolia pages will be displayed". That is the purpose of this
redirect.
In order to bypass Magnolia's filters, you need to add an excluded URI
as directed in step 1. However, doing this removes requests from the
request management system used by Magnolia. Therefore, once all the
Struts interaction is done, either after multiple requests, or after a
single request, if that is your need, then a request should be made
that the Magnolia system "understands", and for which access to other
Magnolia resources proceeds.
I know I may have oversimplified your meaning as quote above, and do
understand your intent. Your reasoning is another perfect example of
what Struts could be used for if integrated with Magnolia.
Regarding "all the work performed in that action will be lost (due to
the redirect)", this is true if your request is a single request to
Struts and you need objects to exist across multiple requests. If
this is the case, and to use the example of auditing, you need to
audit across multiple requests, why not place this object in the
session?
Sessions are not thread safe... so going this way is more error prone
than trying to use normal forwards and so have the possibility to use
request attributes. Indeed configuring forwards may not be the easiest
job, though.
I present this only as a proof. The praticality of it will differ by use.
My app (www.infoq.com) is actually using a complete WW based UI on top
of some Magnolia services; so my comments here are just for the other
users interested in this topic.
bests,
./alex
--
.w( the_mindstorm )p.
Regards,
Charles Goddard
On 7/15/07, Alexandru Popescu ☀ <[email protected]> wrote:
> On 7/9/07, Charles Goddard <[email protected]> wrote:
> > To All Magnolians,
> >
> > I've come across a situation it seems that many of you out there have.
> > I wanted to integrate Struts and Magnolia.
> >
> > After trolling the wiki and mailing list for an hour or so, it seemed
> > to me that there has been no definitive approach posted on this topic.
> > A few people seemed to have been able to get it working, but had not
> > presented how.
> >
> > So how does one integrate Struts with Magnolia?
> >
> > The solution I used is actually extremely simple. There are 2 step to
> > resolving this.
> >
> > 1. Setup a small URI to bypass Magnolia's filter by opening server
> > --> filters --> cms --> config, and appending to bypass "/1", or
> > whatever URI fits your need
> > 2. In the JSPs of your action forwards, redirect back to a page
> > managed by Magnolia
> >
> > That's it! simple enough.
> >
> > Note that you may notice in the catalina.out log, a message stating
> > that your Struts pattern is not recognized. If this annoys you, you
> > can add the pattern you are using to the Magnolia mime-types by
> > following the steps at
> > http://www.magnolia.info/wiki/Wiki.jsp?page=configdocsupport.
>
> Hi Charles!
>
> I think you should be additing more explanations to this setup up. IMO
> using redirects is usefull only when you Struts actions are performing
> an audit-like functionality or are used to determine what Magnolia
> pages will be displayed, otherwise all the work performed in that
> action will be lost (due to the redirect). So, what do you use this
> integration pattern for?
>
> bests,
>
> ./alex
> --
> .w( the_mindstorm )p.
>
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------