关于urlrewriter的疑问,求教!!!
最近在学习伪静态的东东,但由于正则表达式不是很熟,所以有些问题感觉比较棘手,想请教一下大家
http://localhost:8080/project/hello
http://localhost:8080/project/hello/world
如上地址
第一个地址 实际对应的 是 http://localhost:8080/project/user_load.action?username=hello
那个hello 其实只是用户名,例如有个叫 sunny 的用户
http://localhost:8080/project/sunny
http://localhost:8080/project/user_load.action?username=sunny
<rule>
<from>^/(\w)</from>
<to>/user_load.action?username=$1</to>
</rule>
这个是可以的
但是 对于第二个地址 hello/world
其实这个world也是个动态的值
对应的其实 是
http://localhost:8080/project/sunny/world
http://localhost:8080/project/user_load.action?username=sunny¶=world
http://localhost:8080/project/sunny/hello
http://localhost:8080/project/user_load.action?username=sunny¶=hello
对于第二种的 正则 应该怎么写啊?
谢谢大家