You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sean Schofield <se...@gmail.com> on 2004/10/26 19:44:29 UTC

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

Re: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Sean Schofield <se...@gmail.com>.
<snip>
> I guess you are meaning the clazzes:
> org.apache.myfaces.webapp.webxml.ServletMapping;
> org.apache.myfaces.webapp.webxml.WebXml;
</snip>

Specifically I am referring to
n.s.m.webapp.StartupServletContextListener.  I configure this listener
in web.xml.  It seems to be doing a whole bunch of setup stuff
specific to myfaces (and that requires more than the components jar).
I could be wrong on that though.

It seems like  n.s.m.application.jsp.JspTilesViewHandlerImpl requires
the StartupServletContextListener which requires more than the struts
components jar.  If it does, then this rules out using the reference
(or any other implementation.)

No big deal if it does, although its obviously more flexible if it doesn't.

> Matthias

sean

Re: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Sean Schofield <se...@gmail.com>.
On Tue, 26 Oct 2004 23:11:31 +0200, Mark Lowe <ma...@boxstuff.it> wrote:
> 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.

Ahhh.  Craig warned me of this same issue.  Damn portlets!  (Well I
know nothing about them actually but they keep foiling me!)

> 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.

I hadn't thought about TilesContext (which I don't really use other
than for the insert attributes.)

> 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.

OK I'm oficially giving up on the idea!  Its not worth it really.  But
I do remain interested in whether or not I can do this without the
myfaces implementation jars (without new code.)  If anyone can answer
that question I would be interested.

Thanks for your feedback

> Mark
sean

Re: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Mark Lowe <ma...@boxstuff.it>.
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 <ma...@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
>>>>>
>>
>>


Re: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Sean Schofield <se...@gmail.com>.
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!)

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.

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.
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.  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.)

sean


On Tue, 26 Oct 2004 20:18:53 +0200, Mark Lowe <ma...@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
> >>>
> 
>

Re: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Mark Lowe <ma...@boxstuff.it>.
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
>>>


Re: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Mark Lowe <ma...@boxstuff.it>.
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
>>


RE: Is there a way to integrate with Tiles using just the "component" jar file

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
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
>