You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gurram, Srinivas" <sr...@logicacmg.com> on 2007/04/20 14:59:51 UTC

How to change the Context Root of a webapplication

Hi 

I am new to struts. Currently my application url is like this
http://www.site.com/contextname/Home.do  I want to change this url to
http://www.site.com/Home.do

I need to remove the contextname. It refers to the application name
under webapps.

Could any one suggest the solution.



Thanks in Advance

Regards
Srinivas.


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to change the Context Root of a webapplication

Posted by David Conrad <dr...@gmail.com>.
On 4/20/07, Gurram, Srinivas <sr...@logicacmg.com> wrote:
> I am new to struts. Currently my application url is like this
> http://www.site.com/contextname/Home.do  I want to change this url to
> http://www.site.com/Home.do
>
> I need to remove the contextname.
>

You need to change the contextroot in your application.xml file, and
if you're using WebSphere 6 with RAD 6 as your IDE, in the
.websettings file for the web project. We recently did this on the
project I'm working on. Set it to "/"; I think you can also set it to
the empty string, but I'm not certain.

We did not have to make any changes to our web.xml file, and since
this doesn't really concern Struts, no changes to struts-config.xml
should be needed. One thing you would have to change, though, are any
places in your app where the context root is currently used, perhaps
in links or menus.

If all your links and menus use relative URLs, then you will be fine.
If, like the app I'm working on, the context root was never changed
since its inception and many programmers over the years worked on it,
creating a sprawling codebase, you may find that it is hardcoded in a
number of places.

Good luck,
David Conrad

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to change the Context Root of a webapplication

Posted by Mark Shifman <ma...@yale.edu>.
I don't think this is a struts issue.

Look in the tomcat wiki
http://wiki.apache.org/tomcat/HowTo#head-e82228c43a0ce77f71ebe64fc99ced33c9506ffe
How do I override the default home page loaded by Tomcat?

mas
Gurram, Srinivas wrote:
> Hi 
>
> I am new to struts. Currently my application url is like this
> http://www.site.com/contextname/Home.do  I want to change this url to
> http://www.site.com/Home.do
>
> I need to remove the contextname. It refers to the application name
> under webapps.
>
> Could any one suggest the solution.
>
>
>
> Thanks in Advance
>
> Regards
> Srinivas.
>
>
> This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shifman@yale.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org