Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

context root change

 
ravikumar dan
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
 
Peter Johnson
author
Bartender
Posts: 5852
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
Bartender
Posts: 5852
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic