File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to show a jsp after bean procesing is done?

 
Liz Brown
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

disp=getServletContext().getRequestDispatcher(address);

I think you mean:

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

you forgot to mention servlet.
 
Shailesh Kini
Ranch Hand
Posts: 153
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getServletContext() is a method available with session. if you are trying to get the servlet context then use request.getSession(false).getServletContext();

cheers
skini
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic