File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes how to show a jsp after bean procesing is done? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to show a jsp after bean procesing is done?" Watch "how to show a jsp after bean procesing is done?" New topic
Author

how to show a jsp after bean procesing is done?

Liz Brown
Ranch Hand

Joined: Oct 22, 2002
Posts: 112
Hi,
I am sending some data to database. After it's done I want to show a jsp page from the bean. How can i do it? I am using struts.

i tried this-
String address=("a.jsp");
RequestDispatcher disp;
disp=getServletContext().getRequestDispatcher(address);

but it gives error that..undefined getServletContext()
what's problem here?
arnel nicolas
Ranch Hand

Joined: Dec 16, 2003
Posts: 149

disp=getServletContext().getRequestDispatcher(address);

I think you mean:

disp=servlet.getServletContext().getRequestDispatcher(address);

you forgot to mention servlet.
Shailesh Kini
Ranch Hand

Joined: Oct 17, 2001
Posts: 153
getServletContext() is a method available with session. if you are trying to get the servlet context then use request.getSession(false).getServletContext();

cheers
skini


Shailesh Kini.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to show a jsp after bean procesing is done?
 
Similar Threads
Casting subclass to superclass type
Mapping Beans to Servlets
multiple connections with URLConnection
GarbageCollector
how to pass arraylist from jsp to java bean