不同格式网站页面跳转的解决方案

2022-11-09 10:23 行业动态
@RequestMapping(value ="/index.do", method = RequestMethod.GET)

公共字符串toIndex(HttpServletRequestreq,HttpServletResponse res) {

[/div][/div]if(装备判断。JudgeIsMoblie(req)) {

[/div][/div][/div][/div][/div][/div][/div][/div][/div][/div

[/div][/div][/div][/div][/div][/div][/div][/div][/div][/div//重定向到另一个界面(手机界面入口)

[/div]

]else {

[div]

[/div][/div][/div][/div][/div][/div][/div][/div][/div][/div

[/div][/div][/div][/div][/div][/div][/div][/div][/div][/div//跳转到索引页

[/div][/div]]

[/div]}

[div]

1.修改spring-mvc.xml中的视图解析器,如下所示:

[div][div]

[div]

& lt;!-定义HTML文件的位置->:

& lt;豆

class = " org . spring framework . web . servlet . view . internalresourceviewresolver " & gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;财产

[/div]&舟山网站优化照片nbsp[/div][/div]value = " com . ABC . common . html resource view "/& gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;属性值= " 0 "/& gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;属性值= "/we b-INF/view/"/& gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;属性值= "。html "/>;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;property value = " text/html;charset=UTF-8 " >& lt/property & gt;

& lt;/bean & gt;

& lt;!-定义JSP文件的位置->:

& lt;豆

class = " org . spring framework . web . servlet . view . internalresourceviewresolver " & gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;属性值= " 1 "/& gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;属性值= "/we b-INF/JSP/"/& gt;

[/div][/div][/div][/div][/div][/div][/div][/div]& lt;属性值= "。JSP "/>;

& lt;/bean & gt;

[div][div]

微信与项目经理沟通

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流

阅读
上一篇:大型网站建设的优化思路
下一篇:你从哪些角度欣赏优秀的网站?