这是前台页面
<a class=”hidden-xs” href=”/Mark/”>首页</a>
<a class=”hidden-xs” href=”/Mark/order/queryorder.do”>订单中心</a>
这是controller:
@Controller
@RequestMapping(value=”order”)
public class MarkOrderController {
@Resource
private OrderMapper orderMapper;
@RequestMapping(value=”queryorder”, method=RequestMethod.GET)
public String queryorder(HttpServletRequest request){
System.out.println(“11111″);
return”orderdetail”;
}
@RequestMapping(value=”queryorder”,method=RequestMethod.POST)//,method=RequestMethod.POST
@ResponseBody
public Page<Order> queryorderGrid(HttpServletRequest request,Model model){
int pageNo=Integer.parseInt(request.getParameter(“page”));
int pageSize=Integer.parseInt(request.getParameter(“rows”));
Page<Order> page=new Page<Order>(pageNo,pageSize);
Map<String,Object> map=new HashMap<String,Object>();
orderMapper.selectOrderByPage(map,page);
return page;
}
}
这是spring—mvc。xml中的配置
<!– 扫描controller(controller层注入) –>
<context:component-scan base-package=”com.tungkong.rfid.*.controller”/>
<!– 对模型视图添加前后缀 –>
<bean id=”viewResolver” class=”org.springframework.web.servlet.view.InternalResourceViewResolver”
p:prefix=”/WEB-INF/views/” p:suffix=”.jsp”/>
本人要跳转的页面就写在views下
<a class=”hidden-xs” href=”/Mark/”>首页</a>
<a class=”hidden-xs” href=”/Mark/order/queryorder.do”>订单中心</a>
这是controller:
@Controller
@RequestMapping(value=”order”)
public class MarkOrderController {
@Resource
private OrderMapper orderMapper;
@RequestMapping(value=”queryorder”, method=RequestMethod.GET)
public String queryorder(HttpServletRequest request){
System.out.println(“11111″);
return”orderdetail”;
}
@RequestMapping(value=”queryorder”,method=RequestMethod.POST)//,method=RequestMethod.POST
@ResponseBody
public Page<Order> queryorderGrid(HttpServletRequest request,Model model){
int pageNo=Integer.parseInt(request.getParameter(“page”));
int pageSize=Integer.parseInt(request.getParameter(“rows”));
Page<Order> page=new Page<Order>(pageNo,pageSize);
Map<String,Object> map=new HashMap<String,Object>();
orderMapper.selectOrderByPage(map,page);
return page;
}
}
这是spring—mvc。xml中的配置
<!– 扫描controller(controller层注入) –>
<context:component-scan base-package=”com.tungkong.rfid.*.controller”/>
<!– 对模型视图添加前后缀 –>
<bean id=”viewResolver” class=”org.springframework.web.servlet.view.InternalResourceViewResolver”
p:prefix=”/WEB-INF/views/” p:suffix=”.jsp”/>
本人要跳转的页面就写在views下
解决方案
40
查看跳转路径及拦截路径