atitit.spring3 mvc url配置最佳实践

本文深入探讨了Spring MVC中的URL配置,包括默认路径、通用星号URL模式问题及优化建议,通过具体代码示例展示了如何实现RESTful风格的URL,并提供了解决通用星号URL模式引发冲突的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

atitit.spring3 mvc url配置最佳实践

 

1. Url-pattern  bp 1

2. 通用星号url pattern的问题 1

3. Other code 1

4. 参考 2

 

1. Url-pattern  bp

 

Default       <url-pattern>/</url-pattern>     

<url-pattern>/*</url-pattern>    

中间容易的冲突....spr十为了restful风格,,才默认中配置的..

 

 

跟个dwr3雅十... <url-pattern>/spr/*</url-pattern>     

 

访问 http://localhost/gialen/spr/process.json

 

 

2. 通用星号url pattern的问题

 

Override zaid cfg  mvc like...

作者:: 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.youkuaiyun.com/attilax

 

3. Other code

 

@Controller

public class FileUploadController

 

Todox  /process.json  jeig zeush startChar match d path.. 

@RequestMapping(value = "/process.json", method = RequestMethod.GET)

@ResponseBody

public Object process(HttpServletRequest request,

HttpServletResponse response) throws Exception {

core.log("=========process.json");

return ( ProcessInfo)request.getSession().getAttribute("proInfo");

}

 

 

4. 参考

paip.spring3 mvc servlet的配置以及使用最佳实践 - attilax的专栏 博客频道 - youkuaiyun.com

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值