2

I am using Struts 1.2.7 and have the standard servlet mapping that uses *.do for my URLs.

<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
</servlet-mapping>

I need to have a few custom URLs that do not use .do at the end, e.g., /monitor/lb-healthcheck. Is there a way to override the mapping, or add these specific paths to the web.xml file to map to specific Actions? This is a mature application, and it's not feasible at this point to change the mapping to / as the url-pattern.

barclay
  • 4,362
  • 9
  • 48
  • 68
  • Have you try adding a mapping just before that action mapping? ` monitor /monitor/lb-healthcheck ` – Jasonw Mar 23 '12 at 02:07
  • This totally works. Thank you! I would love to give you credit for providing the right answer, if you want to come back and add it to the question in the right place. – barclay Mar 26 '12 at 17:48
  • Thanks, added comment as the answer. :) – Jasonw Mar 26 '12 at 17:52

1 Answers1

2

Have you try adding a mapping just before that action mapping?

<servlet-mapping>
   <servlet-name>monitor</servlet-name>
   <url-pattern>/monitor/lb-healthcheck</url-pattern>
</servlet-mapping>
Jasonw
  • 5,054
  • 7
  • 43
  • 48