You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Shaun Campbell <ca...@gmail.com> on 2009/04/27 17:34:10 UTC

Navigation problem from within page body.

Not sure whether this is a MyFaces problem or a Tiles problem but I'm
posting here just in case anyone can shed any light on it.

I have a web application using MyFaces 1.2.6, Tiles 2.0.5 and Spring
2.5.5.I'm running it through Netbeans and Tomcat 6.0.18.  I've
developed a small application with a tiles template and a few static
links which bring up my pages okay.  The issue is when I want to
navigate to another page from within the body section of the Tiles
template i.e. my jsp page.  The button or link does not seem to
respond to the action.  Waiting for localhost flashes briefly at the
bottom of the browser and nothing appears to happen. I can't see any
reference to any errors in the Tomcat log files.

Just to prove that the code works I added some code to the working
myfaces-example-tiles-1.1.8 example web app and it works ok. I've
added the following code to my home.jsp:

<h:form>
    <h:commandButton value="Test" action="test"/>
</h:form>

I've put an entry in my faces-config.xml:

<navigation-rule>
    <from-view-id>/home.jsp</from-view-id>
    <navigation-case>
        <from-outcome>test</from-outcome>
        <to-view-id>/jobs.jsp</to-view-id>
    </navigation-case>
</navigation-rule>

I have the following entries in my tiles.xml:

    <definition name="/home.tiles" extends="layout.example" >
        <put-attribute name="body" value="/home.jsp" />
    </definition>
    <definition name="/jobs.tiles" extends="layout.example" >
        <put-attribute name="body" value="/jobs.jsp" />
    </definition>

Anybody got any thoughts on why this is not working?  I know it can
work because of the myfaces-example-tiles-1.1.8.  I've upgraded some
of my components so that I can integrate with Spring JDBC and I think
there may be some incompatibilty there.  Apart from this everything
else appears to be working fine but it's really frustrating because
I've been working on this for days now.

Any help or advice would be greatly appreciated.

Regards
Shaun

Re: Navigation problem from within page body.

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

The source code of tomahawk 1.1.8 is here:

http://svn.apache.org/repos/asf/myfaces/tomahawk/tags/1_1_8/

The latest code is here:

http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/

Just checkout, compile (mvn install) and run the example as described before
(on examples/tiles directory). It should work without problem.

regards

Leonardo Uribe

2009/4/28 Shaun Campbell <ca...@gmail.com>

> Checked that Leonardo and I am using the tomahawk12-1.1.8.jar and it's
> not working.
>
> I'd be interested in trying out your maven solution just in case there
> is some other dependency problem.  If I check out the Tomahawk code
> should I have a maven pom.xml file so that I can run your command? I
> couldn't seem to see it in the download.
>
> Have you got MyFaces and Tiles working with JSF 1.2?
>
> Thanks
> Shaun
>

Re: Navigation problem from within page body.

Posted by Shaun Campbell <ca...@gmail.com>.
Checked that Leonardo and I am using the tomahawk12-1.1.8.jar and it's
not working.

I'd be interested in trying out your maven solution just in case there
is some other dependency problem.  If I check out the Tomahawk code
should I have a maven pom.xml file so that I can run your command? I
couldn't seem to see it in the download.

Have you got MyFaces and Tiles working with JSF 1.2?

Thanks
Shaun

Re: Navigation problem from within page body.

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

Tomahawk 1.2 provides a custom ViewHandler to make work Tiles with jsf 1.2.
The ViewHandler provided in tomahawk for jsf 1.1 does not work with myfaces
core 1.2.x (by some changes between jsf 1.1 and 1.2), so just try change
tomahawk version in your project.

If you checkout the code just try

mvn clean -Djsf=12 -Dtomahawk=12 jetty:run

to run myfaces-example-tiles project.

regards

Leonardo Uribe

2009/4/27 Richard Yee <ri...@gmail.com>

> Shaun,
> From what I've heard, it is not recommended to use Tiles to template
> Faces pages. Facelets are the preferred method for templating.
> Perhaps some others on the list could confirm or refute this.
>
> -Richard
>
> On Mon, Apr 27, 2009 at 8:34 AM, Shaun Campbell
> <ca...@gmail.com> wrote:
> > Not sure whether this is a MyFaces problem or a Tiles problem but I'm
> > posting here just in case anyone can shed any light on it.
> >
> > I have a web application using MyFaces 1.2.6, Tiles 2.0.5 and Spring
> > 2.5.5.I'm running it through Netbeans and Tomcat 6.0.18.  I've
> > developed a small application with a tiles template and a few static
> > links which bring up my pages okay.  The issue is when I want to
> > navigate to another page from within the body section of the Tiles
> > template i.e. my jsp page.  The button or link does not seem to
> > respond to the action.  Waiting for localhost flashes briefly at the
> > bottom of the browser and nothing appears to happen. I can't see any
> > reference to any errors in the Tomcat log files.
> >
> > Just to prove that the code works I added some code to the working
> > myfaces-example-tiles-1.1.8 example web app and it works ok. I've
> > added the following code to my home.jsp:
> >
> > <h:form>
> >    <h:commandButton value="Test" action="test"/>
> > </h:form>
> >
> > I've put an entry in my faces-config.xml:
> >
> > <navigation-rule>
> >    <from-view-id>/home.jsp</from-view-id>
> >    <navigation-case>
> >        <from-outcome>test</from-outcome>
> >        <to-view-id>/jobs.jsp</to-view-id>
> >    </navigation-case>
> > </navigation-rule>
> >
> > I have the following entries in my tiles.xml:
> >
> >    <definition name="/home.tiles" extends="layout.example" >
> >        <put-attribute name="body" value="/home.jsp" />
> >    </definition>
> >    <definition name="/jobs.tiles" extends="layout.example" >
> >        <put-attribute name="body" value="/jobs.jsp" />
> >    </definition>
> >
> > Anybody got any thoughts on why this is not working?  I know it can
> > work because of the myfaces-example-tiles-1.1.8.  I've upgraded some
> > of my components so that I can integrate with Spring JDBC and I think
> > there may be some incompatibilty there.  Apart from this everything
> > else appears to be working fine but it's really frustrating because
> > I've been working on this for days now.
> >
> > Any help or advice would be greatly appreciated.
> >
> > Regards
> > Shaun
> >
>

Re: Navigation problem from within page body.

Posted by Richard Yee <ri...@gmail.com>.
Shaun,
>From what I've heard, it is not recommended to use Tiles to template
Faces pages. Facelets are the preferred method for templating.
Perhaps some others on the list could confirm or refute this.

-Richard

On Mon, Apr 27, 2009 at 8:34 AM, Shaun Campbell
<ca...@gmail.com> wrote:
> Not sure whether this is a MyFaces problem or a Tiles problem but I'm
> posting here just in case anyone can shed any light on it.
>
> I have a web application using MyFaces 1.2.6, Tiles 2.0.5 and Spring
> 2.5.5.I'm running it through Netbeans and Tomcat 6.0.18.  I've
> developed a small application with a tiles template and a few static
> links which bring up my pages okay.  The issue is when I want to
> navigate to another page from within the body section of the Tiles
> template i.e. my jsp page.  The button or link does not seem to
> respond to the action.  Waiting for localhost flashes briefly at the
> bottom of the browser and nothing appears to happen. I can't see any
> reference to any errors in the Tomcat log files.
>
> Just to prove that the code works I added some code to the working
> myfaces-example-tiles-1.1.8 example web app and it works ok. I've
> added the following code to my home.jsp:
>
> <h:form>
>    <h:commandButton value="Test" action="test"/>
> </h:form>
>
> I've put an entry in my faces-config.xml:
>
> <navigation-rule>
>    <from-view-id>/home.jsp</from-view-id>
>    <navigation-case>
>        <from-outcome>test</from-outcome>
>        <to-view-id>/jobs.jsp</to-view-id>
>    </navigation-case>
> </navigation-rule>
>
> I have the following entries in my tiles.xml:
>
>    <definition name="/home.tiles" extends="layout.example" >
>        <put-attribute name="body" value="/home.jsp" />
>    </definition>
>    <definition name="/jobs.tiles" extends="layout.example" >
>        <put-attribute name="body" value="/jobs.jsp" />
>    </definition>
>
> Anybody got any thoughts on why this is not working?  I know it can
> work because of the myfaces-example-tiles-1.1.8.  I've upgraded some
> of my components so that I can integrate with Spring JDBC and I think
> there may be some incompatibilty there.  Apart from this everything
> else appears to be working fine but it's really frustrating because
> I've been working on this for days now.
>
> Any help or advice would be greatly appreciated.
>
> Regards
> Shaun
>