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

jsp -> Servlet -> jsp

 
Scott Minor
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following problem that I have been working on for several days and I can't find an answer to it anywhere.
I have a JSP page that gets loaded when the user enters the site. Depending on what the user selects it is sent them to a servlet and the servlet processes the request and then forwards to a new JSP. The problem that I have is that when the JSP that is forwarded to I don't get my images or my style sheets.
I am using an include for the header, menu and footer. I get all of the items but not formatted correctly because I am not getting back to the root of the wed server after I call the servlet.
Thanks for the help.
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The root of the Web server may be different from the WEB APPLICATION context or "root".
Usually the style sheets and images etc should be accessible from the application context. Or you can try using fully qualified URLs like http:///www.myserver.com/images/hello.gif. Same for style sheets.
 
Scott Minor
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony,
I have everything in the right directories because I have a default.jsp file that is in the root. It includes all of my other JSP's and images that are needed. This page is displayed correctly when rendered. The page that the servlet forwards to is also in the root. It is actually a copy of index.jsp renamed. I just want to see it work.
I am using IBM WebSphere v3.5.3.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic