• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

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
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"

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Person Information</title>

<h1>Person Information</h1>
<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}" />


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() ");
//return "success";
return temp;
// return "failure";
return temp;

When i am running this program i am getting the error like conversion value to null.
Would you like to try a free sample? Today we are featuring tiny ads:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic