Is this possible? One of the solutions to the problem I am trying to solve demands this approach. I want to be able to call some methods in the servlet from JSPs, not just sending HTTP requests via forward, or sendredirect. The only hitch seems to be getting a handle to the instance of the servlet. Can some one please shed some light on how this can be done? Thanks. -Bala
You can do this by having the servlet put itself into the session, but I think it would be a very dangerous and un-intuitive thing to do. Why not create another class which does what you want, and call it both from your servlet and from the JSP?
When I use a servlet, I only use it to handling request and response (collecting inser input to stuff beans, and direct tasks). Servlet can call othe help objects of other classes to perform certain task. My servlets normally only have two methods, doGet/doPost. I think clean servlet is good design. regards, ruilin