aspose file tools*
The moose likes Servlets and the fly likes Handling the non-HTTP protocol request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Handling the non-HTTP protocol request" Watch "Handling the non-HTTP protocol request" New topic
Author

Handling the non-HTTP protocol request

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
hi all
The servlet class that extends the class javax.servlet.http.HttpServlet will serve the request that is from the HTTP protocol, but will it handle the request from other Protocol.

if it can handle why it is so?

if it can't what changes i need to do to support the request from any other protocols.

And also list some of the non-HTTP protocol.
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
Originally posted by Parameswaran Thangavel:
hi all
The servlet class that extends the class javax.servlet.http.HttpServlet will serve the request that is from the HTTP protocol, but will it handle the request from other Protocol.

if it can handle why it is so?

if it can't what changes i need to do to support the request from any other protocols.

And also list some of the non-HTTP protocol.


I have never seen any requirement in servlets to handle non-http protocol. But the service method can handle other than http protocol.
few Non http protocols are ftp and SNMP.
have any users in this forum have used a servlet for non-http protocol? if yes, on what functional requirement?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41508
    
  53
For different protocols you would extend GenericServlet instead of HttpServlet. Of course, you'd need to have a servlet container that can handle other protocols; I'm not aware that there is one.


Ping & DNS - my free Android networking tools app
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
yes, thats what I meant. Use the service method in GenericServlet. But have any users felt any need to use non-http protocol in Servlet?
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
I searched and found out that when a socket connection uses a servlet, the connection can be other than HTTP, like FTP. If the socket is trying to connect through FTP, then if HTTPServlet is used, it will err out. In that case the servlet has to be using ftp.
Can anyone tell me if this is good enough for a servlet to be supporting other than ftp protocols? or is there is any other instance where servlet needs to handle other than http protocol?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling the non-HTTP protocol request