Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Raphael Crivelli
Change application context path in Tomcat
November 8, 2013 2:23 AM
Answer

Raphael Crivelli

Rank: Junior Member

Posts: 27

Join Date: May 14, 2012

Recent Posts

Hi

We deployed a webservice on Tomcat. This webservice is currently available under http://localhost:8080/war-file-name, but it should be available as http://localhost:8080/webservice.

How can i change the application context path?
I tried to add a context.xml file in the WEB-INF Folder, with the following Content. But it not works.

1<?xml version='1.0' encoding='utf-8'?>
2<Context path="/webservice" docBase="webapps/war-file-name" ></Context>


How can i change the context path of this application?

Thank you.

Greetz
Raphael
Meera Prince
RE: Change application context path in Tomcat
November 8, 2013 2:33 AM
Answer

Meera Prince

Rank: Liferay Legend

Posts: 1110

Join Date: February 8, 2011

Recent Posts

Hi What is meaning of
Webservice on tomacat


Generally application warfile name is itself contenxt path.

Example:

MyFrstWebapp.war is yor war file then ypu context path is MyFrstWebapp i.e http://localhost:8080/MyFrstWebapp

if you change war file name

MyFirstWebAppNew.war then your new context path is http://localhost:8080/MyFirstWebAppNew


generally in liferay
Portlet name is itself context path

Test-portlet is name then Test-portlet-6.1.war is you war file your context path http://localhost:8080/Test-portlet

see portlet build.xml file there you can change context path..

<project name="CorporateNews-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
</project>


in above if you change name then you context path will be change
Raphael Crivelli
RE: Change application context path in Tomcat
November 11, 2013 2:43 AM
Answer

Raphael Crivelli

Rank: Junior Member

Posts: 27

Join Date: May 14, 2012

Recent Posts

Hi

Thank you very much.
I renamed now quick & dirty the war filename.

I will try your hint with the context path in the build.xml. I think this will be the cleanest solution.

Best regards
Raffi