hello,
I have a action form operForm and List operMenus field. operMenu is an
other class that has some field.
I am listing all of the operMenu objects and their fields.
At the end of the each row I have an edit link that sends, its row's primary
key to an action.
operMenu class has two primary key and I instantiate a hashmap and put the
primary keys into hashmap.
In action class I want to get the hashmap but I am taking null pointer
exception.
<logic:iterate id="omenu" indexId = "count" name="operForm"
property="operMenus">
<tr >
<td class ='row<%=count.intValue() %2 %>'> <bean:write name="omenu" property
=" compositeId.projectname"/></td>
<td class ='row<%=count.intValue() %2 %>'> <bean:write name="omenu" property
="compositeId.seqno"/></td>
<td class ='row<%= count.intValue() %2 %>'> <bean:write name="omenu"
property ="parentseqno"/></td>
<td class ='row<%=count.intValue() %2 %>'> <bean:write name="omenu" property
="groupseqno"/></td>
<bean:define id="projectName" name="omenu" property="compositeId.projectname
"/>
<bean:define id="seqNo" name="omenu" property="compositeId.seqno "/>
<%java.util.HashMap key = new java.util.HashMap();
key.put("projectname", projectName);
key.put("seqno", seqNo);
pageContext.setAttribute("key",key);%>
<td class = 'row<%=count.intValue() %2 %>'><html:link action ="edit"
paramId="index" paramName="key">Edit</html:link></td>
</tr>
</logic:iterate>
-*************************************************************
editAction:::::::::::::::
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
java.util.HashMap keymap = (java.util.HashMap)request.getAttribute("key");
String projectname = (String)keymap.get("projectname");
String seqno = (String)keymap.get("seqno");
System.out.println(projectname);
return mapping.findForward(FORWARD_detail);
}
And the error message:
java.lang.NullPointerException
at actions.editAction.execute(editAction.java:26)
What is the problem??