在我的应用程序的 webapp 文件夹下,我有一个名为 meetingroom 的文件夹,在该文件夹中我有一个名为viewrooms.jsp 的 jsp 页面
- DispatcherServlet配置如下:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/config/applicationContext.xml
</param-value>
</context-param>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/config/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/meetingroom/*</url-pattern>
</servlet-mapping>
- InternalResourceViewResolver bean:
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"/>
<property name="suffix" value=".jsp"/>
</bean>
- 控制器:
@Controller
@RequestMapping("/viewrooms.jsp")
public class ViewRooms {
@RequestMapping(method = RequestMethod.GET)
public String get() {
log.debug("######## GET METHOD FOR VIEW ROOMS ########");
return "meetingroom/viewrooms";
}
}
- 我如何访问该页面:
http://localhost:8081/MyAPP/meetingroom/viewrooms.jsp
ISSUE:在无限循环中调用控制器 get 方法并且页面未呈现。
请告知为什么它不起作用,谢谢。