How to call method in Jsp from servlet

Showing Answers 1 - 5 of 5 Answers

Pankaj

  • Dec 13th, 2005
 

I think through jspAction and Custom Tag.

  Was this answer useful?  Yes

Pankaj

  • Dec 13th, 2005
 

I think through jspAction and Custom Tag.

  Was this answer useful?  Yes

Subrahmanyam Mamidi

  • Feb 20th, 2006
 

RequestDispatcher reqDis = request.getRequestDispatcher("Jspfile.jsp");

reqDis.forward(request, response);

This will work ... :)

You can get RequestDispatcher from ServletConetext object, then you should give the path to resouce with reference to context path, as

RequestDispatcher reqDis  = getServletContext().getRequestDispatcher("/Jspfile.jsp");

//Observer '/' infront of the filename.  It is must!!

Celabrate Coding

  Was this answer useful?  Yes

sekhar

  • Apr 24th, 2006
 

Even though we call a jsp page from servlet through request dispatcher,we can not call a perticular method of a jsp from servlet.there is no such mechanism in servlet API.but iam not sure.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions