File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes setter method not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "setter method not working" Watch "setter method not working" New topic

setter method not working

Max Ji

Joined: Mar 29, 2006
Posts: 12
Hello, I have a JSP with a value binding expression that binds the value of a selectOneListbox to a backing bean attribute. But the setter method in the bean is apparently never called, so when the selectOneListBox value is changed, the value of the attribute does not change with it. The page and bean are long, but below is part of the code. It works in WebLogic but not in Tomcat 5.5. Thanks for any assistance.


<h:form id="me" >

<h:panelGrid cellpadding="0" columns="5">
<hutputText styleClass="updatelabels" value="3. Select the Type of Document (select one):"/>
<h:selectOneListbox id="iType" value="#{item.itemType}" size="2"
onchange="findEndDate(this);" >
<f:selectItems value="#{itemVals.itemTypes}" />



<jsp:include flush="true" page="/js/update.js"></jsp:include>


package com.sdts.Report;

import java.util.ArrayList;
import java.sql.*;
import javax.naming.*;
import javax.swing.JOptionPane;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlInputText;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlSelectManyListbox;
import javax.faces.component.html.HtmlSelectOneListbox;
import javax.faces.context.FacesContext;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;

public class Item
/* attributes of items */
private String itemType = "Contract"; // the type of item (contract or PO)

public String getItemType() {
return itemType;

public void setItemType(String itemType) {
this.itemType = itemType;


I agree. Here's the link:
subject: setter method not working