• 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

Conversion Error setting value

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
my JSP code is


<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>


<!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=UTF-8">
<title>Person Information</title>
</head>
<body>

<h1>Person Information</h1>
<f:view>
<h:form binding="#{UserBean.form1}" id="form1" >
<p> Name : <h:inputText value="#{UserBean.name}" /></p>
<p> Birthday : <h:inputText value="#{UserBean.birthday}" /></p>

<h:commandButton value="commandButton1"

action="#{UserBean.commandButton1_action}" />
</h:form>
</f:view>

</body>
</html>


MY BEAN code is


/*
* UserBean.java
*
* Created on April 20, 2007, 2:43 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package astrologer.user;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlForm;
import javax.faces.component.html.HtmlInputText;

/**
*
* @author suneelkumarr
*/
public class UserBean {

/** Creates a new instance of UserBean */
public UserBean() {

}
// private String name;
// private String birthday;
// private String email;

private HtmlForm form1;
private HtmlInputText name;
private HtmlInputText birthday;
private HtmlCommandButton commandButton1;

public void setForm1(HtmlForm form1) {
this.form1 = form1;
}

public HtmlInputText getName() {
return name;
}

public void setName(HtmlInputText name) {
this.name = name;
}

public HtmlInputText getBirthday() {
return birthday;
}

public void setBirthday(HtmlInputText birthday) {
this.birthday = birthday;
}

public HtmlCommandButton getCommandButton1() {
return commandButton1;
}

public void setCommandButton1(HtmlCommandButton commandButton1) {
this.commandButton1 = commandButton1;
}
public String commandButton1_action(){
String user=(String)name.getValue();
String pass=(String)birthday.getValue();
String temp;
System.out.println("**** In side commandButton() ");
if(user.equalsIgnoreCase("test")&&pass.equalsIgnoreCase("test123"))
{
//return "success";
temp="success";
System.out.println("****1*****");
return temp;
}
else
{
// return "failure";
temp="failure";
System.out.println("****2****");
return temp;
}
}
}


When i am running this program i am getting the error like conversion value to null.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic