| Author |
Help me with SelectOneMenu
|
Min Chen
Greenhorn
Joined: Jun 06, 2006
Posts: 2
|
|
Hi All, I have a question about selectOneMenu. I still have error 6/6/06 17:21:16:699 EDT] 0000002a ServletWrappe E SRVE0014E: Uncaught service() exception root cause Faces Servlet: Cannot forward. Response already committed. [6/6/06 17:21:16:808 EDT] 0000002a LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called. [6/6/06 17:21:16:824 EDT] 0000002a WebApp E SRVE0026E: [Servlet Error]-[Faces Servlet]: java.lang.IllegalStateException: Cannot forward. Response already committed. I don't know what i did wrong. Please help me. This is what I have this on my JSF page <h:selectOneMenu styleClass="selectOneMenu" id="location" value="#{selectOneMenu.TEAMMEMBER}" <f:selectItems value="#{IsCodeValuesOne.codeSetValues}" /> </h:selectOneMenu> It called my managed bean IsCodeValuesOne, getCodeSetvalues method /* * Created on Jun 2, 2006 */ package org.emory.executiveRound; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import javax.ejb.CreateException; import javax.faces.model.SelectItem; import org.reference.codeset.CodeSetService; import org.reference.codeset.CodeSetServiceHome; import org.reference.codeset.CodeValue; /** * TODO: <Add type description here> * * Project : ExecutiveRound * @author <a href="mailto:min.chen@yahoo.com">Minh Tran</a> * @version 1.0 */ public class IsCodeValuesOne { private ArrayList m_selecttypes = null; public IsCodeValuesOne() {} public ArrayList getCodeSetValues() throws CodeSetNotFound, ReviewsServiceException, RemoteException, CreateException { Collection codesetvalues = null; Collection displayDropDownMenu = null; CodeSetService css; CodeSetServiceHome codesetservice = (CodeSetServiceHome) ReviewsServiceLocator.getInstance().getCodeSetServiceHome(); css = codesetservice.create(); codesetvalues = css.getEffectiveCodeValues("MRRSERVICE"); Iterator i = codesetvalues.iterator(); while (i.hasNext()) { CodeValue cv = (CodeValue) i.next(); String codeval = cv.getCodeValue().toString(); String meaning = cv.getMeaning(); System.out.println ("Codeval is " + codeval + " ; Meaning is " + meaning + "<br>"); m_selecttypes.add(new SelectItem(codeval,meaning)); } // setcodesetvalues; return m_selecttypes; } } Thanks alot, Minh
|
 |
Manish Sridharan
Ranch Hand
Joined: Jul 19, 2005
Posts: 62
|
|
Hi ! In My opinion , Your Error is not because of select menu... instead because of "setRollbackOnly()" .. this method is called after the response is committed.. check where u make this call and which field is binded to it... Regards Gaurav Nigam
|
Manish S.
|
 |
Manish Sridharan
Ranch Hand
Joined: Jul 19, 2005
Posts: 62
|
|
One more thing u mite have used the FacesContext.RenderResponse() method and make some method call after that which will throw error... because u can not call anything after response complete method.. Regards Gaurav Nigam
|
 |
Min Chen
Greenhorn
Joined: Jun 06, 2006
Posts: 2
|
|
Hi, I am using rational developer 6.01. I don't know where those method would be called. I don't have setrool ack in my method.
|
 |
 |
|
|
subject: Help me with SelectOneMenu
|
|
|