view plaincopy to clipboardprint?
<servlet-mapping>
<servlet-name>FCExporter</servlet-name>
<url-pattern>*/FCExporter</url-pattern>
</servlet-mapping>
seems inappropriate.
Basically i want to hit this servlet whenever the last token is /FCExporter.
Why it seems inappropriate?
You would have configured <servlet> tag with <servlet-name> & <servlet-class>. And everytime whenever the request is from "/FCExporter", your servlet class (configured in <servlet-class>) will be called,provided you have correctly configured it.
yes as kunal said <servlet-name> which is configured in web.xml is used during object creation of your servlet component/program by the container..
you can see it practically when you execute your web application,just look the log files or tomcat.exe console application.... you can know each and every activity done on your servlet program by the container even you can see the exceptions also.. when encountered...
1)exact match.. example:
here the url pattern starts with "/" can have any charactters except *,where * include , .extension etc
<url-pattern>/myurlpattern</url-pattern>
2)extension-match:
<url-pattern>*.extension</url-pattern>//*-->can be abc,123or even abc/123/a/b
(so on) ...
example:
<url-pattern>/abc.c</url-pattern>//here .c is the extension and must be at last
<url-pattern>/a/b/c.do/123.x</url-pattern>//
3)directory match:
must begin with "/" and end with "*",multiple words or characters must be seperated by "/'
example:
<url-pattern>/abc/x/y/z.c</url-pattern>
if you write any url-pattern other than the above (not as in examples) url patterns that is exact match,extension match,directory match) then container doesn't recognize the url pattern mentioned in web.xml more over you get exception...
Post by:autobot
pie. tiny ad:
a bit of art, as a gift, the permaculture playing cards