D Sheth

Greenhorn
+ Follow
since May 22, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by D Sheth

Hi all:

I am working on a Struts 1.2.9/Hibernate 3.1.3 Application on Weblogic 8.1.5. I am trying to use Named Queries, but running into an exception mentioned above.

Code is:


This, when executed throws following exception:


I have been trying to resolve it for a while. But cannot find way out. Any help will be appreciated.

[ June 30, 2006: Message edited by: D Sheth ]

[ June 30, 2006: Message edited by: D Sheth ]

[ June 30, 2006: Message edited by: D Sheth ]
[ June 30, 2006: Message edited by: D Sheth ]
Hi,

I have done the exactly what you provided. I think I am missing something though.

I am getting an error - [ServletException in:/jsp/searchBySystem.jsp] Cannot retrieve definition for form bean null'

Form is:
public final class SearchBySystemForm extends ActionForm {

private ArrayList systems;
private int systemId;

public int getSystemId() {
return systemId;
}

public ArrayList getSystems() {
return systems;
}

public void setSystemId(int i) {
systemId = i;
}

public void setSystems(ArrayList list) {
systems = list;
}

}

My Bean is:
public class System implements java.io.Serializable {
private int systemId;
private String systemName;
/**
* @return
*/
public int getSystemId() {
return systemId;
}

/**
* @return
*/
public String getSystemName() {
return systemName;
}

/**
* @param i
*/
public void setSystemId(int i) {
systemId = i;
}

/**
* @param string
*/
public void setSystemName(String string) {
systemName = string;
}

}

My Action Class is:
public class SearchBySystemAction extends Action {

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {

String forward = "error";

ArrayList systemList = new ArrayList();
SearchBySystemForm systemForm;
systemForm = new SearchBySystemForm();

System system = new System();
system.setSystemId(1);
system.setSystemName("MARS");
systemList.add(system);

system = new System();
system.setSystemId(2);
system.setSystemName("JUPITER");
systemList.add(system);

systemForm.setSystems(systemList);

request.getSession().setAttribute("SYSTEMFORM",systemForm);
forward = "showSystemList";

return (mapping.findForward(forward));

}

My jsp is:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html>
<title>System List</title>
</head>
<body>
<html:errors/>
<html:form action="/searchBySystem">
<table>
<tr>
<td>System:</td>
<td>
<html:select name="SYSTEMFORM" property="systemId">
<html ptionsCollection property="systemList" value="systemId" label="systemName"/>
</html:select>
</td>
<td><html:submit>Ok</html:submit></td>
<td><html:cancel>Cancel</html:cancel></td>
</tr>

</table>
</html:form>
</body>
</html>
17 years ago