简体   繁体   中英

*.do in struts 1.2

I think I know Struts 1.2 very well, but still I am confused about the *.do pattern. Can you please explain the simple meaning of the pattern *.do ? And why it is only *.do ?

Thanks in advance!

This is just a URL mapping of the struts action Servlet as shown below (copied from struts doc ). It can be anything you want. *.do is the default mapping I believe.

<servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>
        org.apache.struts.action.ActionServlet
    </servlet-class>
    <init-param>
        <param-name>config</param-name>
        <param-value>
         /WEB-INF/struts-config.xml
        </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>

*.do is mentioned in the Struts documentation and has become the defacto standard. But you can choose anything you like. Another common pattern is /do/* .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM