I am using struts 1 and urlwrite (http://www.tuckey.org/urlrewrite/), and I have the following problem. I want to change the url of an action, and when that new url is called the action should be executed. For doing this is wrote the following configuration in the urlrewrite.xml:
<rule>
<from>/users/create</from>
<to>%{context-path}/createUserAction\.do</to>
</rule>
<outbound-rule >
<from>/createUserAction\.do</from>
<to>/users/create</to>
</outbound-rule>
Then the html:link to prepareCreateUserAction, is changed to /users/create. But, then it uses the rule abve, but it tries to redirect the the action name without the .do ( http://localhost:8008/myapp/createUserAction instead of http://localhost:8008/myapp/createUserAction.do), and no action is found.
Does anyone knows how开发者_开发百科 to solve this?
It looks like for those rules, the <to>
doesn't use regular expressions, so the first rule should actually be:
<rule>
<from>/users/create</from>
<to>%{context-path}/createUserAction.do</to>
</rule>
In other words, remove the \ from before the .do
精彩评论