It's not a secret anymore!*
The moose likes Servlets and the fly likes How to call JSp from Servlet?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to call JSp from Servlet??" Watch "How to call JSp from Servlet??" New topic
Author

How to call JSp from Servlet??

Anjali Sen
Greenhorn

Joined: Feb 26, 2003
Posts: 15
Hello,
I want to call JSP page from servlet.I am using Visual Age For java 3.4. What is wrong in my code??
if (userExists) {
f.setErrors("userName","Duplicate User: Try a different username");
getServletConfig().getServletContext().
getRequestDispatcher("/jsp/forms/retry.jsp").
forward(request, response);
}
I am not able to get the o/p. Pls help.
Ivan Tamayo
Ranch Hand

Joined: Aug 13, 2001
Posts: 49
I don�t think the getSevletConfig().
Besides that, the getRequestDispatcher() can returns null.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

I am not able to get the o/p. Pls help.

A slightly better description of what is actually happening would probably help.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call JSp from Servlet??