aspose file tools*
The moose likes JSF and the fly likes Simple Login faces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Simple Login faces" Watch "Simple Login faces" New topic
Author

Simple Login faces

chandra chatterjee
Greenhorn

Joined: May 13, 2009
Posts: 18
Hello I want to create a very simple and basic login screen

Username : Textbox

Password : Textbox

Submit. on submit i want to show the welcome below the submit and make Username and Password textboxes as un editable.

Can you please help me ..i am very new to jsf. I am able to get the values displayed in next page but not below the sbumit button of the same page.

Thanks in advance

Kalam.
chandra chatterjee
Greenhorn

Joined: May 13, 2009
Posts: 18
My Code

jsf

%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<!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>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<tutputText value="Username" />
<t:inputText value="#{loginBean.name}" />
<tutputText value="Password"/>
<h:inputSecret value="#{loginBean.pass}"></h:inputSecret>
<h:commandButton value="Submit" >
</h:commandButton>
<hutputText value = "#{loginBean.name}" />
</h:form>
</f:view>
</body>
</html>


Bean



public class LoginBean {

public String name;
public String pass;


public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}


public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}

Error


description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Base is null: loginBean
javax.faces.webapp.FacesServlet.service(FacesServlet.java:218)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


root cause

javax.faces.el.PropertyNotFoundException: Base is null: loginBean
org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:463)
org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingImpl.java:175)
org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:58)
org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:311)
org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:606)
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTextRendererBase.getConvertedValue(HtmlTextRendererBase.java:191)
javax.faces.component.UIInput.getConvertedValue(UIInput.java:733)
javax.faces.component.UIInput.validate(UIInput.java:658)
javax.faces.component.UIInput.executeValidate(UIInput.java:869)
javax.faces.component.UIInput.processValidators(UIInput.java:432)
javax.faces.component.UIForm.processValidators(UIForm.java:190)
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:932)
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:362)
org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

Ganeshram Nagarathinam
Greenhorn

Joined: Nov 01, 2007
Posts: 1
Have you added your LoginBean in Faces-config.xml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Login faces
 
Similar Threads
Authentication over ssl in jsp
not showing the message
Need to send message to struts JSP after creating PDF
Simple Question About JavaScript
how can generate view without controller in spring