Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

Servlet question

Thread view: 
Beatrice Rutger - 27 May 2005 17:12 GMT
Hi ,

Is it possible to have a servlet listen to a specified port?. Any
examples of how to do this (or links to examples) would be great.

I have not had much success having this question answered, or finding
examples when searching via Google.

Thanks
kaeli - 27 May 2005 17:36 GMT
> Hi ,
>
> Is it possible to have a servlet listen to a specified port?.

In general, servlets don't listen to a port. The web server listens, then
passes off the request to the servlet container.
You can set up a web server to run on any port you like. You may even be able
to set up the servlet container separately if you use Tomcat or the like.
As to just setting the servlet to do it all by itself, I don't think you can.
It needs the servlet container to do its job. So at the minimum, the servlet
container would be listening to the specified port.

Perhaps a web service would be more appropriate for your task?

Signature

--
~kaeli~
"No matter what happens, somebody will find a way to take
it too seriously."
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Bryce - 27 May 2005 17:52 GMT
>Hi ,
>
>Is it possible to have a servlet listen to a specified port?. Any
>examples of how to do this (or links to examples) would be great.

Sure. But first tell us what servlet engine you are using.

For tomcat, try here:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html

look for the attribute "port"

>I have not had much success having this question answered, or finding
>examples when searching via Google.

--
now with more cowbell


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.