Hi all,
My controller looks as follow:
The command-object "MQDetailForm.java" looks as follow:Code:public class TestProvisionController extends MQController { public TestProvisionController() { setCommandClass(MQDetailForm.class); } @Override protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { MQDetailForm mqdDetailForm = (MQDetailForm) command; Map<String, Serializable> model = errors.getModel(); model.put("provision", mqdDetailForm); return new ModelAndView(getSuccessView(), model); } }
And "MQForm.java":Code:public class MQDetailForm extends MQForm implements Serializable { }
And my jsp looks as follow:Code:public class MQForm implements Serializable { protected String request; public String getRequest() { return request; } public void setRequest(String request) { this.request = request; } }
The problem is, the jsp can not show anything.Code:<form:form action="test-detail.html" method="post"> <table> <tr> <td><form:input path="requestStr"/></td> <td rowspan="2"><img src="<c:url value="/images/ampel-gruen-trans.gif"/>" width="50" height="66"/> </td> </tr> <tr> <td>Output: '<c:out value="${provision.requestStr}"></c:out>'</td> </tr> <tr> <td><input type="submit" value="Excecute" /></td> </tr> </table> </form:form>
But if I change the MQDetailForm.java as follow, i.g. not extend MQForm, it will be OK. Can't I use the extends? Why?
Code:public class MQDetailForm implements Serializable { protected String requestStr; public String getRequestStr() { return requestStr; } public void setRequestStr(String requestStr) { this.requestStr = requestStr; } }


Reply With Quote