It is possible to call a servlet from a Java class?
Posted
by Renan Mozone
on Stack Overflow
See other posts from Stack Overflow
or by Renan Mozone
Published on 2010-06-10T14:01:16Z
Indexed on
2010/06/10
14:12 UTC
Read the original article
Hit count: 432
I'm using IBM WebSphere as my servlet container. My application has several servlets and Java classes. My intent is to call one of those servlets directly from a Java class. Doing some research I figured out that is possible to use the RequestDispatcher interface to achieve this. But it is necessary to pass the objects ServletRequest and ServletResponse as arguments to the method forward(). There is some way to bypass this safely and "nicely"? By "nicely" I meant to say preserving good programming and design patterns.
© Stack Overflow or respective owner