• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple Login faces

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
<t:outputText value="Username" />
<t:inputText value="#{loginBean.name}" />
<t:outputText value="Password"/>
<h:inputSecret value="#{loginBean.pass}"></h:inputSecret>
<h:commandButton value="Submit" >
</h:commandButton>
<h:outputText 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)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you added your LoginBean in Faces-config.xml
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic