Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Conversion Error setting value  RSS feed

suneel kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • 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="" %>
<%@ taglib prefix="h" uri="" %>

<!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="#{}" /></p>
<p> Birthday : <h:inputText value="#{UserBean.birthday}" /></p>

<h:commandButton value="commandButton1"

action="#{UserBean.commandButton1_action}" />


MY BEAN code is

* 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) { = 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!