<h:commandButton> tag help

m trying to use the commandbutton tag for my navigation but it is not working.

below is my code and my faces-config navigation rule.

<h:commandButton image="/m-bank/images/about.bmp" action="signin"/>

<navigation-rule>

<from-view-id>/m-bank.jsp</from-view-id>

<navigation-case>

<from-outcome>signin</from-outcome>

<to-view-id>/m-sign.jsp</to-view-id>

</navigation-case>

</navigation-rule>

These are inside an <h:form>.

How do i get the the commandbutton to work and navigate to the next page.

Any help anyone.

Thanks

[726 byte] By [tony81a] at [2007-11-27 2:28:23]
# 1
Why are you posting a new thread instead of continuing the thread which originated this specific problem?
BalusCa at 2007-7-12 2:40:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
pressed enter by accident when updating the typing mistake. Sorry guys
tony81a at 2007-7-12 2:40:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Well, if navigation doesn't work, then the from-view-id is incorrect or there's prolly something wrong in the form (validation or conversion errors, catch them using h:messages).How does the full URL of m-bank.jsp look like and how is the url-pattern of the FacesServlet mapping
BalusCa at 2007-7-12 2:40:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

[nobr]here is the full servlet mapping and code i have used.

<html>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<f:view>

<head>

<title>HOME PAGE FOR WWW.M-WARE.COM </title>

</head>

<body>

<h:form>

<center>

<h:dataTable>

<h:column>

<f:facet name="header">

<h:graphicImage value="/images/m-logo.bmp"/>

</f:facet>

</h:column>

<h:column>

<f:facet name="header">

<h:graphicImage value="/images/title.bmp"/>

</f:facet>

</h:column>

</h:dataTable>

<h:panelGrid columns="6">

<h:graphicImage value="/images/m-line1.bmp"/>

<h:commandButton image="/m-bank/images/about.bmp"/>

<h:commandButton image="/m-bank/images/faqs.bmp"/>

<h:commandButton image="/m-bank/images/contact.bmp"/>

<h:commandButton image="/m-bank/images/sitemap.bmp"/>

<h:graphicImage value="/images/m-line2.bmp"/>

</h:panelGrid>

<table height="500" width="900">

<tr><td valign="top" width="170" background="images/tiles.bmp">

<table cellspacing="1" height="200">

<tr valign="top" height="25">

<td align="center"> <h:commandButton image="/m-bank/images/banklink.bmp"/> </td></tr>

<tr height="25" ><td align="center"> <h:commandButton image="/m-bank/images/resume.bmp"/></td></tr>

<tr height="25" ><td align="center"> <h:commandButton image="/m-bank/images/hire.bmp"/></td></tr>

<tr height="25" ><td align="center" > <h:commandButton image="/m-bank/images/shop.bmp"/></td></tr>

<tr height="25"><td align="center"><h:commandButton image="/m-bank/images/news.bmp"/></td></tr>

</table>

</td>

<td valign="top" width="525">

<h:outputText value="Hallo"/>

</td>

<td align="center">

<h:commandButton image="/m-bank/images/sign-in.bmp" action="signin"/><vr>

<h:commandButton image="/m-bank/images/register.bmp" /><br>

<center>

<table border="1" height="460">

<tr><td valign="top">M-Ware Related Links</td></tr>

<tr><td valign="top">Entertainment</td></tr>

</table>

</center>

</td>

</tr>

<tr><td colspan="3" background="images/bline.bmp" height="5"></td></tr>

<tr height="10">

<td ></td>

<td align="center">

<h:panelGrid columns="4">

<h:commandButton image="/m-bank/images/about.bmp"/>

<h:commandButton image="/m-bank/images/faqs.bmp"/>

<h:commandButton image="/m-bank/images/contact.bmp"/>

<h:commandButton image="/m-bank/images/sitemap.bmp"/>

</h:panelGrid>

</td>

<td></td>

</tr>

</table>

</center>

</table>

</h:form>

</body>

</f:view>

</html>

<?xml version="1.0"?>

<!DOCTYPE webapp PUBLIC

"=//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.faces</url-pattern>

</servlet-mapping>

<welcome-file-list>

<welcome-file>index.html</welcome-file>

</welcome-file-list>

</web-app>

the from-out-come page is just the same as the one above only that it has a different name and its to test the navigation.

Hope that is good enough to help me

Thanks[/nobr]

tony81a at 2007-7-12 2:40:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Please also eleborate "it is not working". If it is showing a blank page, then you have to invoke the facesservlet in the to-view-id. So replace at least<to-view-id>/m-sign.jsp</to-view-id>

by<to-view-id>/m-sign.faces</to-view-id>

If this isn't the case, show the full URL with which you've invoked the m-bank.jsp (you may scramble the domainname if you want, it's all about the path).

BalusCa at 2007-7-12 2:40:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
the page does not get loaded at all.when i check the error in the tomcat server, it says that a public ID is missing.thats another part i dont understand
tony81a at 2007-7-12 2:40:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...