"SiddharthaChandurkar (EHPT)" wrote:
>
> I want to simulate an http and https request in my java application and then
> invoke a Servlet without the
> servlet Engine.
> Queries:
> 1) Is it possible? - how???.
> 2) Can Anyone please tell me where can i find specs for developing a servlet
> engine.
Sure it's possible. Invoking a servlet is exactly what a servlet engine does.
You don't need to simulate an http request, you just need to simulate a servlet
engine. Of course, that's simpler said than done:
- Write classes that implement the HttpServletRequest, HttpServletResponse, and
ServletConfig interface and any other interfaces needed
- Instantiate an instance of your class that implements ServletConfig
- Instantiate an instance of the servlet class
- Call the servlet instance's init method
- Instantiate instances of the classes that implement the HttpServletRequest and
HttpServletResponse interfaces
- Call the servlet instance's doGet or doPost methods
It might be easier to just reimplement the servlet so that it can be used as a
'regular' java class without all the servlet classes or interfaces.
For information on writing a servlet engine, check Sun's servlet pages:
http://java.sun.com/products/servlet/download.html
Kevin Mukhar
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html