0

我正在尝试在我的项目中使用显示标签库。

JSP:

<display:table name="rooms" class="table table-striped" pagesize="5">
    <display:column property="name" titleKey="crs.admin.room.roomName" sortable="true" />
    <display:column property="capacity" />
</display:table>

控制器:

@Controller
public class RoomController {
....
@RequestMapping(value = "/roomManagement*", method = RequestMethod.GET)
public ModelAndView get() {
    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("roomManagement");
    modelAndView.addObject("rooms", roomService.findAll());
    return modelAndView;
}

查看解析器:

<bean id="jspViewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass"
              value="org.springframework.web.servlet.view.JstlView"/>
    <property name="prefix" value=""/>
    <property name="suffix" value=".jsp"/>
</bean>

当我用它打开页面时,我的链接如下所示:

http://localhost:8081/roomManagement

但点击分页/排序链接后,它看起来像:

http://localhost:8081/roomManagement.jsp?d-49653-s=0&d-49653-o=2

由于“.jsp”后缀,我的控制器没有处理这个请求,也没有将房间列表放入视图中。我应该如何处理?

4

1 回答 1

2

好的,这真的很简单,我添加了

 requestURI="/roomManagement"

要显示的参数:table 标记

于 2013-04-20T10:01:02.803 回答