这是我的控制器类
public class ScheduleClassController extends SimpleFormController {
public ScheduleClassController() {
setCommandClass(ScheduleClass.class);
setCommandName("scheduleClass");
}
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command) throws Exception {
ScheduleClass wiziqClass = (ScheduleClass) command;
System.out.println(wiziqClass);
return new ModelAndView("classdetail", "ScheduleClass", wiziqClass);
}
}
这是我的 springapp-servelet.xml
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<!-- <property name="prefix" value="/WEB-INF/jsp/" /> -->
<property name="suffix" value=".jsp" />
<property name="order" value="10" />
</bean>
<bean name="/index.htm" class="org.sakaiproject.wiziq.tool.HelloWorldController">
<property name="sakaiProxy" ref="org.sakaiproject.wiziq.logic.SakaiProxy" />
</bean>
<bean name="/schedule.htm" class="org.sakaiproject.wiziq.tool.ScheduleClassController">
<property name="formView" value="schedule" />
<property name="successView" value="classdetail" />
</bean>
这是我的 classdetail.jsp
<jsp:directive.include file="/templates/includes.jsp" />
<jsp:directive.include file="/templates/header.jsp" />
hello there
${wiziqClass.name}
<jsp:directive.include file="/templates/footer.jsp" />
提交表单后,我登陆了这个视图,但没有在这里获取 wiziqClass.name 我已经制作了 Model 并在那里添加了 getter 和 setter。
我做错了什么?想不通。