Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

basic servlet container prototype..

Posted on 2007-03-18
8
Medium Priority
?
346 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
8 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 18750345
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:Mayank S
ID: 18751545
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 2000 total points
ID: 18751569
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bjuneja_2000
ID: 18763428
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:Mayank S
ID: 18768860
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
ID: 18798622
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Suggested Courses

636 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