I am developing a web application using Struts1 as web framework. My url pattern in web.x开发者_开发百科ml is:
<servlet-mapping> 
<servlet-name>action</servlet-name> 
<url-pattern>*.do</url-pattern> 
</servlet-mapping> 
I want to get rid of .do pattern in urls. So if my url is 
http://localhost:38330/MyProject/editFunction.do?function=1
i want it to be like http://localhost:38330/MyProject/editFunction/ . How do I acheive this type of url rewriting ? Thanks for any help
You can use a filter before calling the struts request processor, and this project it's very helpful: http://www.tuckey.org/urlrewrite/
You can map your <url-pattern> to allow prefix, like
<servlet-mapping> 
    <servlet-name>action</servlet-name> 
    <url-pattern>/action/*</url-pattern> 
</servlet-mapping>
Then if you do (e.g.) http://localhost:38330/MyProject/action/editFunction/, your struts action will be called (if mapped correctly on struts-config.xml).
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论