File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to call a jsp from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to call a jsp from a servlet" Watch "How to call a jsp from a servlet" New topic
Author

How to call a jsp from a servlet

Shivanath Yerra
Greenhorn

Joined: Jul 16, 2001
Posts: 8
can u tell me how to call a jsp from a servlet
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi,
well, just call the location the jsp is located at.
did i get your question right ?
karl
Shivanath Yerra
Greenhorn

Joined: Jul 16, 2001
Posts: 8
no, I Want to Know How to invoke JSP from a Servlet
for example if u want to show a html we use request.redirect(abc.html) similarly how can we invoke a jsp.
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi,
perhaps im stupid and still dont get it....
jsp and html are the same for client. they dont care if it jsp or html since out of the jsp a pure html page is created. so you can call it request.redirect("somejsp.jsp"). right ??? anybody ???
karl
Shivanath Yerra
Greenhorn

Joined: Jul 16, 2001
Posts: 8
Hi
Now i came to Know how to invoke the jsp from a servlet
it is like this

JspFactory jf=JspFactory.getDefaultFactory();
PageContext pc = jf.getPageContext();
pc.include("sample.jsp");

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call a jsp from a servlet