I am trying to set up my web.xml in Tomcat 4.1.3 container to go to one page if letters are entered in last part of url or go to another page if numbers are entered in the last part of a url.
For example if here is how the url would be set up where the url will go to either the all numbers location or the non numbers location:
Any number entry for last part of url which could be something like
343
http://127.0.0.1:8080/theapp/pack/weburl/343
Any non number entry for last part of url which could be something like
abec
http://127.0.0.1:8080/theapp/pack/weburl/abec
My attempt below is not working because it doesnt seem to take the regular expressions. But if I manually put in letters such as:
<url-pattern>/pack/weburl/ab</url-pattern> it would take me to the correct page. How does web.xml work with regular expressions inthe
url-pattern tag??
<servlet>
<servlet-name>Number</servlet-name>
<servlet-class>pack.Number</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Number</servlet-name>
<url-pattern>/pack/weburl/\d*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>NotNumber</servlet-name>
<servlet-class>pack.NotNumber</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>NotNumber</servlet-name>
<url-pattern>/pack/weburl/[A-Za-z]</url-pattern>
</servlet-mapping>