Powered by Blogger.

How to change Context-root of an application in MyEclipse

>> Sunday, January 19, 2014

Before going to develop a web application, make sure all the settings and properties of MyEclipse, java and tomcat settings. If you have any doubts while Configuring java in MyEclipse or Installing and configuring Tomcat in your local machine or Configure the Tomcat in your MyEclipse to develop your web application take a look at my previous posts.

How to change Context-root of an application_JavabynataraJ
Normally we work on the same project most of the time with the same application name(context-root). When ever we take a new workspace in our local machines we may confuse while deploying the application in Tomcat or any other server. Other wise we have to remove the old deployed project and deploy the latest project. To overcome this problem, we can change the Context-root of our application. So that we can deploy the same web application with different names.

This is our Servlet application. This is running with the Context-root as WebApp . Now we are going to change the context root to WebApplication in myeclipse. Download the application before you are going to start as a test.
How to change Context-root of an application_JavabynataraJ
This is our application Structure.
How to change Context-root of an application_JavabynataraJ
Right click on the application , then click on properties option at the bottom.
How to change Context-root of an application_JavabynataraJ
Select Web option from the left side MyEclipse options from the below window. As shown in number (2) select Context Root tab and change the previous context root(/WebApp) to (/WebApplication), then click ok button.
How to change Context-root of an application_JavabynataraJ

How to change Context-root of an application_JavabynataraJ
Now Click OK
How to change Context-root of an application_JavabynataraJ
click on Finish button.
Note:Once changing the context root of an application you have to remove the old deployed application and stop the server. Now Redeploy the same application to Tomcat Server and start the server. This is the important step to take care.
Now go to the browser and run the application with different context root : http://localhost:8080/WebApplication/
How to change Context-root of an application_JavabynataraJ

Reference Books:

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.