• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

context root change

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
I am new to JBOSS. I have a requirement to add the context root of our url like http://localhost:8080/myapp/Test previously it used to like http://localhost:8080/Test. For this requirement I added the jboss-web.xml file in the WEBINF folder . in that I added the context root like <contextroot>/myapp</contextroot> for my war file. After deploying In my application images and CSS and java script files are not loading . the images and java script files are referencing old path like (files/images/spacer.gif) how can i redirect to new path (/myapp/files/images/spacer.gif) with out changing all references . can you please suggest me a solution

Thanks in advance,
Ravi
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravikummar, welcome to Java Ranch!

1) Which version of JBoss AS?

2) Where are your image, CSS and JavaScript files located? Within your WAR file or elsewhere?

3) I assume that your JSPs and servlets are working fine with the new URL, especially as you move from page to page, but could you confirm that...

4) Are you using any particular web application framework, such as Struts 2, Spring MVC, Stripes, JSF, etc?
 
ravikumar dan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Johnson,


My Version of Jboss AS is 5.1 . We are using Spring frame work(MVC,WEB flow). The images, CSS and Java script folders are included in the WAR file. You are very correct. MY JSP's and servlets are working fine.Can you please tell me where i did mistake. Thanks for you response.

Thanks,
Ravi
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What URLs are used by the references within your generated HTML pages? For example, pick an image that is not showing up, what is the contents of the tag? Same question for the links for CSS and .js files.
 
What are you doing? You are supposed to be reading this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic