• 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

Not displaying images when using RequestDispatcher.forward() for passing control from

 
Greenhorn
Posts: 23
Firefox Browser Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all...

Here i'm trying to pass control from servlet to jsp using RequestDispatcher.forward(). When i'm trying with sendRedirect it works fine ....but for forward() it doesn't shows images and also not applies the css
.. can anyone help me....?


Thanks......
 
kishukishor patil
Greenhorn
Posts: 23
Firefox Browser Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
code that i implemented is.....

RequestDispatcher dispatch = getServletContext().getRequestDispatcher("/Project/login.jsp");
dispatch.forward(xmlreq, res);


xmlreq is request object and res is response object... it shows login.jsp but without images.....


please suggest if anyone encountered such problem.....
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your URLs are most likely not relative to the root of the web application.
See:
http://faq.javaranch.com/java/RelativeLinks
and/or
http://faq.javaranch.com/java/ResourceUrlProblems
 
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic