Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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
  • 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
  • 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
  • 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
 
That new kid is a freak. Show him this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!