Solved

basic servlet container prototype..

Posted on 2007-03-18
8
332 Views
Last Modified: 2013-11-24
Hi,
Can someone give me a 101 on building a basic servlet container that could deliver static web pages or run servlets. I am looking for some pointers that I can follow while writing program for a servlet container.
0
Comment
Question by:bjuneja_2000
  • 4
8 Comments
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
Probably try looking at the source code of the existing open source servlet containers like Tomcat: http://tomcat.apache.org
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
0
 
LVL 30

Accepted Solution

by:
mayankeagle earned 500 total points
Comment Utility
For static web pages, it is fairly simple. You need to create a TCP listener which receives the requests from users and delivers the pages after reading from a directory.

Create server socket - http://www.exampledepot.com/egs/java.net/CreateServerSocket.html

Handle the request in another thread - http://www.exampledepot.com/egs/java.lang/BasicThread.html?l=rel

Reading from a file -
http://www.exampledepot.com/egs/java.io/ReadLinesFromFile.html?l=rel

Sending contents back to the client socket - http://www.exampledepot.com/egs/java.net/WriteTextToSocket.html
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:bjuneja_2000
Comment Utility
Mayankeagle,
I was able to generate static web pages based on your idea.
Any ideas about how to run servlets ?
0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
You need a servlet container for that - look at the source code of one of the open source containers.
0
 
LVL 3

Expert Comment

by:amodmulay
Comment Utility
hey buddy download any of the ide's like eclipse or netbeans..ou will get good examples in that.......if u download you will also get a bundled tomcat with it...so you can figure out how things work...i think as a beginer you should find it out urself
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Understanding @ResponseBody annotation 5 49
map interface methods 3 51
withoutTen challenge 14 87
nested interface 5 36
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now