[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

can we write servlet engine

can we write servlet engine?if yes How?
0
chaitu chaitu
Asked:
chaitu chaitu
2 Solutions
 
tbone343Commented:
you don't need to write one.  download tomcat and run some examples to better understand it:

http://jakarta.apache.org/tomcat/index.html
0
 
TimYatesCommented:
http://www.onjava.com/pub/a/onjava/2003/05/14/java_webserver.html

shows you the principals of it...

Though it will be a LOT of work (to include security, etc), and you are probably better off using Tomcat (which is free)

http://jakarta.apache.org/tomcat

it also has the full source code :-)

There are also smoe other open source alternatives you could look at:

http://jetty.mortbay.org/jetty/index.html
http://tjws.sourceforge.net/
0
 
chaitu chaituAuthor Commented:
i know i dont need to write servlet engine i can sue any of servlet engine currently available;

but if  i want to write a simple servlet engine(leave security etc aspects) who can handle my request and response;how can i write

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
TimYatesCommented:
Have a look at tjws...

That seems to be a 50k java implementation of a servlet container...  You should be able to learn a lot from the source code...
0
 
TimYatesCommented:
Basically, the flow goes something like this:

setup:

1) Create Servlet instance
2) call init(), passing ServletConfig (if any)
3) map servlet to url pattern

then, when you get a connection on a socket

1) build up request object
2) create response object
3) call servlet.service with request and response
4) check error codes in response
0
 
TimYatesCommented:
any help?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now