| Author |
Displaying servlet content in a jsp including images
|
Avinash venna
Greenhorn
Joined: Jun 10, 2010
Posts: 15
|
|
Hello,
I have developed a servlet and it shows some reports (including images). Now I need to display the content of this servlet in a jsp and I am using <jsp:include page="/MyServlet"></jsp:include> to do so. I can see the full report if I run my servlet directly but when I run jsp, the images are missing. Please some one help me out in resolving this. Thanks in advance.
Regards,
Avinash V
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
why cant you move all display content to jsp rather than <jsp:include page="/MyServlet">? server is a controller, should not contain display/business logic in it directly.
and how you embedded images? show us the tag.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
The most likely cause of "broken" images is being sloppy with the URLs. See the JspFaq for information on properly addressing resources using server-relative URLs that begin weigh the context path.
And yes -- including servlet output in a JSP is a less-than-stellar practice.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Avinash venna
Greenhorn
Joined: Jun 10, 2010
Posts: 15
|
|
|
Actually I am connecting to a remote server and getting a java melody report and writing it to a servlet. Now, I need to display this report on a liferay portlet where I can display it in a jsp. So I am including the servlet in portlet's view.jsp
|
 |
 |
|
|
subject: Displaying servlet content in a jsp including images
|
|
|