Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Tutorial issue - name doesnt appear on welcome.jsp
Tutorial issue - name doesnt appear on welcome.jsp [message #475330] Mon, 19 November 2007 15:01 Go to next message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Hi after my last posting I hesitated but here I am again.

Ok I've finished the tutorial and found it very easy to follow - excellent
stuff.

Just one thing. When I run it and enter a user name and user password this
does not appear on the welcome.sjp an indicated by the tutorial.

I ran in debug mode and the setter for userName is never called. Thus I
guess the variable is never set.

Any clues?

Here is the faces-config.xml and login.,jsp
<?xml version="1.0" encoding="UTF-8"?>

<faces-config

xmlns="http://java.sun.com/xml/ns/javaee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"

version="1.2">

<managed-bean>

<managed-bean-name>

loginBean</managed-bean-name>

<managed-bean-class>

com.tutorial.LoginBean</managed-bean-class>

<managed-bean-scope>

session</managed-bean-scope>

</managed-bean>

<navigation-rule>

<from-view-id>

/login.jsp</from-view-id>

<navigation-case>

<from-outcome>login</from-outcome>

<to-view-id>

/welcome.jsp</to-view-id>

</navigation-case>

</navigation-rule>

<navigation-rule>

<display-name>

login</display-name>

<from-view-id>

/login.jsp</from-view-id>

<navigation-case>

<from-outcome>leave</from-outcome>

<to-view-id>

/leave.jsp</to-view-id>

</navigation-case>

</navigation-rule>

<validator>

<description>

</description>

<display-name>

Validate Password</display-name>

<validator-id>

com.tutorial.validatePassword</validator-id>

<validator-class>

com.tutorial.ValidatePassword</validator-class>

</validator>

</faces-config>





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

uri="http://java.sun.com/jsf/core" prefix="f"%><%@ page language="java"
contentType="text/html; charset=ISO-8859-1"

pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Login</title>

</head>

<body>


<f:view>


<f:loadBundle basename="com.tutorial.messages" var="msg"/>

<h:panelGrid border="1" columns="2">

<h:outputText id="userNameLabel" value="#{msg.name}" ></h:outputText>

<h:inputText id="userNameInputText"
value="#{loginBean.userName}"></h:inputText>

<h:outputText id="passwordLabel" value="#{msg.password}"></h:outputText>

<h:inputSecret id="passwordInputField" value="#{loginBean.userPassword }">

<f:validator validatorId="com.tutorial.validatePassword"/>

</h:inputSecret>

</h:panelGrid>

<h:form>

<h:commandButton id="loginButton" value="Login"
action="login"></h:commandButton>

<h:commandButton id="leaveButton" value="Leave"
action="leave"></h:commandButton>

</h:form></f:view></body>

</html>
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #475332 is a reply to message #475330] Mon, 19 November 2007 17:31 Go to previous messageGo to next message
Gerry Kessler is currently offline Gerry KesslerFriend
Messages: 125
Registered: July 2009
Senior Member
Hi Stu,

You did not post your welcome.jsp page for inspection. Do you navigate to
the welcome page? What is being displayed?

I am glad that you found the tutorial useful.

Regards,
Gerry Kessler
WTP JSF Tools Team
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #475335 is a reply to message #475332] Mon, 19 November 2007 22:37 Go to previous messageGo to next message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Thanks for the reponse.

Yes I did the navigation by adding the two pages then drawing a link between
them as described.

The pages is displaying "welcome! " and a blank/empty userName after that.


"Gerry Kessler" <gerry.kessler@oracle.com> wrote in message
news:f632553eae41cbe106ac73c21086027f$1@www.eclipse.org...
> Hi Stu,
>
> You did not post your welcome.jsp page for inspection. Do you navigate to
> the welcome page? What is being displayed?
> I am glad that you found the tutorial useful.
>
> Regards,
> Gerry Kessler
> WTP JSF Tools Team
>
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #475336 is a reply to message #475335] Tue, 20 November 2007 17:56 Go to previous messageGo to next message
Ian Trimble is currently offline Ian TrimbleFriend
Messages: 137
Registered: July 2009
Senior Member
Could we see the contents of this welcome JSP, please, just to rule out
anything obvious?

Thanks,
- Ian
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #475337 is a reply to message #475335] Tue, 20 November 2007 18:15 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
Also, try placing the h:panelGrid inside the h:form. The tool has an
issue here where sometimes it adds h:form's in bad places. I believe the
inputText with the name and password in it must be inside the form so the
data gets received on the postback.


--Cam
FIXED Re: Tutorial issue - name doesnt appear on welcome.jsp [message #475338 is a reply to message #475337] Wed, 21 November 2007 00:34 Go to previous messageGo to next message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Well done, that was it.
My weak HTML skills didnt help there.

Seems a shame that doesnt get picked up or a warning displayed.

Stu


"Cameron Bateman" <cameron.bateman@oracle.com> wrote in message
news:3b55bca89872801f78874921950eb586$1@www.eclipse.org...
> Also, try placing the h:panelGrid inside the h:form. The tool has an
> issue here where sometimes it adds h:form's in bad places. I believe the
> inputText with the name and password in it must be inside the form so the
> data gets received on the postback.
>
>
> --Cam
>
Re: FIXED Re: Tutorial issue - name doesnt appear on welcome.jsp [message #475339 is a reply to message #475338] Wed, 21 November 2007 14:47 Go to previous message
Yury Kats is currently offline Yury KatsFriend
Messages: 104
Registered: July 2009
Senior Member
On 11/20/2007 7:34 PM, Stu wrote:
> Well done, that was it.
> My weak HTML skills didnt help there.
>
> Seems a shame that doesnt get picked up or a warning displayed.

I brought up this issue here a while ago [1]. I suggest you open a bug
for validation framework.

[1] http://dev.eclipse.org/newslists/news.eclipse.webtools.jsf/m sg00498.html
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #615717 is a reply to message #475330] Mon, 19 November 2007 17:31 Go to previous message
Gerry Kessler is currently offline Gerry KesslerFriend
Messages: 125
Registered: July 2009
Senior Member
Hi Stu,

You did not post your welcome.jsp page for inspection. Do you navigate to
the welcome page? What is being displayed?

I am glad that you found the tutorial useful.

Regards,
Gerry Kessler
WTP JSF Tools Team
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #615723 is a reply to message #475332] Mon, 19 November 2007 22:37 Go to previous message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Thanks for the reponse.

Yes I did the navigation by adding the two pages then drawing a link between
them as described.

The pages is displaying "welcome! " and a blank/empty userName after that.


"Gerry Kessler" <gerry.kessler@oracle.com> wrote in message
news:f632553eae41cbe106ac73c21086027f$1@www.eclipse.org...
> Hi Stu,
>
> You did not post your welcome.jsp page for inspection. Do you navigate to
> the welcome page? What is being displayed?
> I am glad that you found the tutorial useful.
>
> Regards,
> Gerry Kessler
> WTP JSF Tools Team
>
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #615724 is a reply to message #475335] Tue, 20 November 2007 17:56 Go to previous message
Ian Trimble is currently offline Ian TrimbleFriend
Messages: 137
Registered: July 2009
Senior Member
Could we see the contents of this welcome JSP, please, just to rule out
anything obvious?

Thanks,
- Ian
Re: Tutorial issue - name doesnt appear on welcome.jsp [message #615726 is a reply to message #475335] Tue, 20 November 2007 18:15 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
Also, try placing the h:panelGrid inside the h:form. The tool has an
issue here where sometimes it adds h:form's in bad places. I believe the
inputText with the name and password in it must be inside the form so the
data gets received on the postback.


--Cam
FIXED Re: Tutorial issue - name doesnt appear on welcome.jsp [message #615728 is a reply to message #475337] Wed, 21 November 2007 00:34 Go to previous message
Stu Plu is currently offline Stu PluFriend
Messages: 44
Registered: July 2009
Member
Well done, that was it.
My weak HTML skills didnt help there.

Seems a shame that doesnt get picked up or a warning displayed.

Stu


"Cameron Bateman" <cameron.bateman@oracle.com> wrote in message
news:3b55bca89872801f78874921950eb586$1@www.eclipse.org...
> Also, try placing the h:panelGrid inside the h:form. The tool has an
> issue here where sometimes it adds h:form's in bad places. I believe the
> inputText with the name and password in it must be inside the form so the
> data gets received on the postback.
>
>
> --Cam
>
Re: FIXED Re: Tutorial issue - name doesnt appear on welcome.jsp [message #615729 is a reply to message #475338] Wed, 21 November 2007 14:47 Go to previous message
Yury Kats is currently offline Yury KatsFriend
Messages: 104
Registered: July 2009
Senior Member
On 11/20/2007 7:34 PM, Stu wrote:
> Well done, that was it.
> My weak HTML skills didnt help there.
>
> Seems a shame that doesnt get picked up or a warning displayed.

I brought up this issue here a while ago [1]. I suggest you open a bug
for validation framework.

[1] http://dev.eclipse.org/newslists/news.eclipse.webtools.jsf/m sg00498.html
Previous Topic:Taglibs not getting bound / executed properly - PLEASE HELP
Next Topic:SelectOneRadioButton problem
Goto Forum:
  


Current Time: Thu Apr 18 07:05:56 GMT 2024

Powered by FUDForum. Page generated in 0.02307 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top