I have been learning RESTful webservices following this tutorial http://www.vogella.de/articles/REST/article.html. As I understand, the url to access the rest service is
http://your_domain:port/display-name/url-pattern/path_from_rest_class
and that the display-name is configured in web.xml. However the actual url is
http://your_domain:port/**war_fileneme**/url-pattern/path_from_rest_class
Is this correct?
the url would look awkward if war filename also contained version info. So is it possible to override this?
I am using Tomcat 7.0, Jersey and Eclipse IDE.
Thanks.
this is the context path.
since you can have multiple contexts in tomcat, each one has to have its own context path, and by default tomcat uses the war filename prefix, but if you deploy in tomcat’s ROOT webapp directory you can access your webapp at
http://your_domain:port/display-name/url-pattern/path_from_rest_classotherwise it’s always:
http://your_domain:port/context/display-name/url-pattern/path_from_rest_classbut you can alter this value by choosing an apppropriate context path in web.xml:
something like
should yield:
http://your_domain:port/mypath/display-name/url-pattern/path_from_rest_classcheck here for some info:
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Attributes
hope that helped…