* .do in racks 1.2

I think I know Struts 1.2 well, but still I am confused by the pattern *.do. Could you explain the simple meaning of the template *.do? And why is it just that *.do?

Thanks in advance!

+3
source share
2 answers

This is just a mapping of the action URL of the struts servlets, as shown below (copied from struts doc ). That could be all you want. * .do is the default mapping that I consider.

<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>
+3
source

*.domentioned in the Struts documentation and becomes the defacto standard. But you can choose whatever you want. Another common pattern is /do/*.

0
source

Source: https://habr.com/ru/post/1788916/


All Articles