• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to remove the Context name from the URL

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi All,

In My project I would like to remove the context name from the URL.

The URL is " http://localhost:8081/myproduct " . Here I have to remove the context name '/myproduct' . My project is running inside webapps folder.

Kindly help me......

Thanks,

Aby
 
Ranch Hand
Posts: 56
Netbeans IDE Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
adding the following in your context.xml can be one of the solution.

open your project and goto META-INF/Context.xml.

open the file and add the following, you may be able to acheive what you are asking,


<Context path=”" debug=”0″ reloadable=”true”>
</Context>

best of luck.
 
Aby Arackal peter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thank you Sachin.

In our project we are not using context.xml in META-INF.Would you please suggest some other solution or please tell how can I use this context.xml.

Thanks,

Aby
 
Sachin Pachari
Ranch Hand
Posts: 56
Netbeans IDE Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May i know what type of project you are dealing with ?

what type of framework you are using ?
 
Aby Arackal peter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sachin,

Actually it is not a project it is one product.Its a consulting business software, we are using this software but one requirement is to remove the Context name from the URL(http://localhost:8081/myproduct)

we are using Struts - Hibernate -Spring technology. I have tried in server.xml (tomcat/conf) but there we need to map the source in docBase.

(<Context path="" reloadable="true" docBase="C:\Users\admin\Workspaces\myproduct"></Context>) and it is not recommended.The product is running from webapps.

This is the actual situation.Now would you please suggest any idea?

Thanks,

Aby
 
Sachin Pachari
Ranch Hand
Posts: 56
Netbeans IDE Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok so it is a War deployment ?

In that case, Extract the War and then check the xml files to get a better idea. i might suggest you to check(or)Search the xml files for the "myproduct" as in http://localhost:8081/myproduct.

So you might get to know where they have defined the "context", i believe that the context must be defined for all project,

These are the bright ideas i can come up with, hope this helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic