aspose file tools*
The moose likes Servlets and the fly likes Not displaying images when using RequestDispatcher.forward() for passing control from Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Not displaying images when using RequestDispatcher.forward() for passing control from" Watch "Not displaying images when using RequestDispatcher.forward() for passing control from" New topic
Author

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

kishukishor patil
Greenhorn

Joined: Nov 20, 2008
Posts: 23

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

Joined: Nov 20, 2008
Posts: 23

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.....
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not displaying images when using RequestDispatcher.forward() for passing control from
 
Similar Threads
jsp:forward question...
forwarding within the application
RequestDispatcher forward doubt?
difference between sendRedirect and forward of Requestdispatcher
Regarding forwarding and including response from other Servlets