can we write servlet engine

can we write servlet engine?if yes How?
LVL 20
chaitu chaituAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.