简体   繁体   English

* .do in struts 1.2

[英]*.do in struts 1.2

I think I know Struts 1.2 very well, but still I am confused about the *.do pattern. 我想我非常了解Struts 1.2,但我仍然对*.do模式感到困惑。 Can you please explain the simple meaning of the pattern *.do ? 你能解释一下这个模式*.do的简单含义吗? And why it is only *.do ? 为什么它只是*.do

Thanks in advance! 提前致谢!

This is just a URL mapping of the struts action Servlet as shown below (copied from struts doc ). 这只是struts动作Servlet的URL映射,如下所示(从struts doc复制)。 It can be anything you want. 它可以是你想要的任何东西。 *.do is the default mapping I believe. * .do是我认为的默认映射。

<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. Struts文档中提到了*.do ,它已成为事实上的标准。 But you can choose anything you like. 但你可以选择你喜欢的任何东西。 Another common pattern is /do/* . 另一个常见的模式是/do/*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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