webtier@glassfish.java.net

Please help - JSF newbie question

From: <webtier_at_javadesktop.org>
Date: Thu, 15 Jul 2010 05:21:53 PDT

I am working on an online tutorial where in my POJO I am trying to acquire the userID value to display on my webpage. I am working in Eclipse and I put a breakpoint in my bean but I never get there. Here is the code I'm using and any help/direction would be greatly appreciated:

package org.texashealth.transfer.user;

import javax.servlet.http.HttpServletRequest;
import javax.faces.bean.*;

@ManagedBean
public class User {
        
        private String userID;
        
        public String getUserID() {
                return userID;
        }

        public void setUserID(String userID) {
                this.userID = userID;
        }
        
        public String authenticate(HttpServletRequest request) {
                userID = request.getRemoteUser().substring(6);
                return userID;
        }
}

In the JSP page I have the following:

<fieldset>
<legend>JSF Test Form</legend>
<h:form>
  Here is the userID: [b]<h:outputText value="#{user.userID}" />[/b]<br/>
  Some random data: <h:inputText/><br/> <!-- Textfield ignored -->
  Some other data: <h:inputText/><br/> <!-- Textfield ignored -->
  <h:commandButton value="Go to Page B"
                   action="page-b"/> <!-- Navigates to page-b.jsf -->
</h:form>
</fieldset>
[Message sent by forum member 'savoym']

http://forums.java.net/jive/thread.jspa?messageID=477726