Argument Error: One or more parameters are null.
I am getting"javax.servlet.jsp.JspException: Argument Error: One or more parameters are null". Following are first two lines of the exception
javax.servlet.jsp.JspException: Argument Error: One or more parameters are null.at com.sun.faces.taglib.html_basic.PanelGridTag.doEndTag(PanelGridTag.java:470)at _empEditById._jspService(_empEditById.java:290)
Can anyone help me out with this.
# 2
I don't know which part of jsp code is giving problem. Here is the complete listing
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<title>Main</title>
</head>
<body><h:form>
<strong>Employee Edit</strong>
<h:messages/>
<h:panelGrid columns="3">
<h:outputLabel value="Employee Id:"/>
<h:inputText id="empId" disabled="true"
value="#{b_empEditById.empId}"/>
<h:panelGroup/>
<h:outputLabel value="First Name:"/>
<h:inputText id="firstName" required="true"
value="#{b_empEditById.firstName}"/>
<h:message for="firstName"/>
<h:outputLabel value="Last Name:"/>
<h:inputText id="lastName" required="true"
value="#{b_empEditById.lastName}"/>
<h:message for="lastName"/>
<h:outputLabel value="Hire Date:"/>
<h:inputText id="hireDate" value="#{b_empEditById.hireDate}">
<f:convertDateTime pattern="dd-MM-yyyy"/>
</h:inputText>
<h:message for="hireDate"/>
<h:outputLabel value="Reports To:"/>
<h:selectOneMenu id="reportsTo"
value="#{b_empEditById.reportsTo}">
<f:selectItems value="#{requestScope.b_empEditById.selectAllEmployees}"/>
</h:selectOneMenu>
<h:message for="reportsTo"/>
<h:commandButton value="Confirm" id="edit"
action="#{b_empEditById.confirm}"/>
<h:commandButton value="Back" type="submit" immediate="true"
action="back"/>
</h:panelGrid>
</h:form></body>
</html>
</f:view>
I am using Oracle jdeveloper 10g but I don't which version of JSF I am using.
# 7
As you said, I cut out the pieces of code one by one and have narrowed to the code snippet that is giving the error. It is h:selectOneMenu. Here is the defination of the code in jsp.
<h:selectOneMenu id="reportsTo"
value="#{b_empEditById.reportsTo}">
<f:selectItems value="#{b_empEditById.selectAllEmployees}"/>
</h:selectOneMenu>
<h:message for="reportsTo"/>
And here is the java code in backing bean.
public Integer getReportsTo(){
reportsTo = empObj.getReportsTo();
return reportsTo;
}
public void setReportsTo(Integer reportsTo){
this.reportsTo = reportsTo;
}
public List getSelectAllEmployees(){
HashMap<Integer,String> reportsToHash;
List selectItems = new ArrayList();
FacesContext ctx = FacesContext.getCurrentInstance();
Object requestObject = ctx.getApplication().getVariableResolver().
resolveVariable(ctx, "EmployeeReg");
EmployeeReg empReg = (EmployeeReg) requestObject;
reportsToHash = empReg.getReportsToHash();
if(reportsToHash == null)
System.out.println("Error in getting reportsTo Hash Map");
selectItems.add(new SelectItem(0,"none"));
for(int i = 1; i < reportsToHash.size(); i++){
selectItems.add(new SelectItem(new Integer(i),reportsToHash.get(new Integer(i))));
}
return selectItems;
}
Is there anything wrong with the code ?