• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set context root of an application in JBoss?

 
Rob Jon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys! i need help in addressing issues in a website, which use STRUTS/servlets etc.

My problem is I get duplicate domain while getting into the website e.g www.abc.com/abc.com/view/login.do.

i want to get rid of 2nd abc.com which i believe is root war location.

i have a web.xml and using filter to strip abc.com but its not working.

any body has any idea or went thru same experience.

thanks in advance.

[Edited by Jaikiran : Changed the subject, to be more meaningful]
[ May 23, 2008: Message edited by: Jaikiran Pai ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really feel that "Struts Technology" is a good subject for your question?

If you are trying to remove the context path from the URL displayed from the browser, you are going to be disappointed. There is no way to do this in a filter or otherwise.

If you don't want your web app to have a visible context path, you must make the web app the ROOT web app (which has a context path of /).
 
Rob Jon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response and apologize for odd subject.

Can you please explain how can i make context path to root(\)?

thanks in advance.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Rob Jon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we are using JBOSS
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this configuration is container specific, I'm going to move this thread to our JBoss forum for you.

-ben
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To change the context for a web app on JBossAS, add a WEB-INF/jboss-web.xml file to your WAR file:

<jboss-web>
<context-root>/</context-root>
</jboss-web>

You will also want to remove the root application - server/default/deploy/jboss-web.deploy/ROOT.war (in 4.2.x).
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65125
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Jon:
Thanks for your response and apologize for odd subject.

No need to apologize. But I'd change it to something more appropriate were I you.
 
Rob Jon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanxs Peter and bear. It was wonderful experience as a first time user.
 
Rob Jon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have another problem. The server where we hosted our website has multiple war files or other sites uploaded.

according to our previous discussion if we update jboss-web.xml file with context-root; will it affect other sites?

please let me know. thnax in advance.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changing jboss-web.xml affects only the web application (war file) in which is appears.
 
Rob Jon
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter. Your information is valuable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic