myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mark.l...@boxstuff.it>
Subject Re: Is there a way to integrate with Tiles using just the "component" jar file
Date Tue, 26 Oct 2004 21:11:31 GMT

On 26 Oct 2004, at 22:47, Sean Schofield wrote:

> I know what you've been through.  I've tried to struggle with this
> using various approaches (actually, now that I think about it, you and
> I have talked on the struts user list about this issue!)

Never the twain shall meet :o)

>
> So far, using myfaces for implementation (as well as tiles extras)
> seems like the best option.  The main problem I've run into is the
> "action" that form's that are included post to.  They keep showing the
> layout page instead of the original calling page.
>
> I worked on decorating the default ViewHandler's getActionURL method,
> but there is still the problem of how to communicate the actual URL to
> the ViewHandler.  MyFaces seems to be doing this through the
> ExternalContext but I must confess I don't JSF enough to follow all of
> it just yet.

Matthias mentioned that re-dispatching the external context could be 
not very friendly to portlets, and thus against the JSF spec. Guess 
you'll have to see what he and the spec have to say on the issue.

>
> IMHO the ideal solution comprises four classes.
>
> 1.) A servlet context listener to read the tiles stuff
> 2.) A filter to intercept requests with '.tiles' (or whatever) in
> them.  The filter would apply to redirects, etc. too which I believe
> is now possible with latest servlet spec.

I dont think a filter will work, sitemesh uses this approach and I cant 
see how it will work with JSF's view subview demarcation. I could be 
wrong but i don't see everything could be worked out and sent back to 
the browser/client.

> 3.) A custom ViewHandler which can finesse the actionURL and any other
> tiles-specific issues.
>
> The trick seems to be in how to get all three to communicate.

i haven't had much time to look to far into it yet, but my gut feeling 
is that something can be configured in the faces-config, but I doubt a 
solution will involve tiles contexts and other such things, even if it 
follows tiles it would need to be something that sits in faces. I still 
dont have a good enough grasp on the faces config options to know 
exactly how it would work.

>  If
> someone is willing to explore this with me, then I'm game.  But I must
> admit that I'm on the verge of giving up on this as well (since the
> combined myfaces solution works.)

Again you'll need to keep an eye on what the myfaces folk are doing as 
they are aiming to get it to spec. Its not just myfaces but also using 
JSF with the spring tiles handler throws the same guru mediation 
messages.

I'd be interested in the idea of developing ideas on developing a 
templating mechanism, perhaps based on tiles. But less interested in 
thinking about getting tiles working with JSF.

Mark

>
> sean
>
>
> On Tue, 26 Oct 2004 20:18:53 +0200, Mark Lowe <mark.lowe@boxstuff.it> 
> wrote:
>> Sorry I should have said what problem there was, in case someone wants
>> to have a go (I cant see how though). So I took teh code, botched my
>> own methods to return  the same values as WebXml thingy and
>> ServletMapping, and tested with myfaces to ensure that i'd done what i
>> needed.
>>
>> At the end of the renderView method this happens
>>
>> viewId = definition.getPage();
>> externalContext.dispatch(viewId);
>>
>> After the tiles have been read/created and places in the context. The
>> layout page is grabbed and then re-dispatched to that jsp. This is
>> great with myfaces, but sun's version has none of it.
>>
>> At this point I gave up. I'd say if you like tiles that much then 
>> using
>> Myfaces is your solution.
>>
>>
>>
>> Mark
>>
>> On 26 Oct 2004, at 20:07, Mark Lowe wrote:
>>
>>> I adapted the code for the Tiles handler to work without these. It
>>> wont work with sun's implementation. Spring's tiles thingy has the
>>> same problem.
>>>
>>> Mark
>>>
>>> On 26 Oct 2004, at 19:51, Matthias Wessendorf wrote:
>>>
>>>> Sean,
>>>>
>>>> thanks for your interesst in MyFaces.
>>>>
>>>> I guess you are meaning the clazzes:
>>>> org.apache.myfaces.webapp.webxml.ServletMapping;
>>>> org.apache.myfaces.webapp.webxml.WebXml;
>>>>
>>>> but they are included in components-jar as well.
>>>>
>>>> Or am I missing something ... now?
>>>>
>>>> Regards,
>>>> Matthias
>>>>
>>>>> -----Original Message-----
>>>>> From: Sean Schofield [mailto:sean.schofield@gmail.com]
>>>>> Sent: Tuesday, October 26, 2004 7:44 PM
>>>>> To: myfaces-user@incubator.apache.org
>>>>> Subject: Is there a way to integrate with Tiles using just
>>>>> the "component" jar file
>>>>>
>>>>>
>>>>> I got things working with the myfaces implementation, but it
>>>>> doesn't seem like its possible to use only the component jar
>>>>> file (which contains the custom ViewHandler.)
>>>>>
>>>>> From looking at the source, it seems like the custom view
>>>>> handler relies on some preprocessing which is done by the
>>>>> myfaces implementation.  Is this correct?  If so, how hard
>>>>> would it be to accomplish the faces integration without using
>>>>> the myfaces implementation?
>>>>>
>>>>> TIA,
>>>>> sean
>>>>>
>>
>>


Mime
View raw message