How to remove the extensions from url

 ̄綄美尐妖づ 提交于 2019-12-08 07:42:47

问题


I have designed an application using struts2, and need to remove the extensions for example

www.myweb.com/register.action

How to remove the .action so when I click on register it call www.myweb.com/register without action extension?

I use the following

 <a href="<s:url action="register"/>">Register</a> 

回答1:


I've found the answer. I should change the struts configuration as following:

<struts>



    <constant name="struts.action.extension" value=""/>



    <package name="default" extends="struts-default">

        <action name="register">
            <result type="tiles">register</result>
        </action>
    </package>


</struts>


来源:https://stackoverflow.com/questions/14764090/how-to-remove-the-extensions-from-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!