This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes simple queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "simple queries" Watch "simple queries" New topic
Author

simple queries

Nikita Deshmukh
Ranch Hand

Joined: Jun 08, 2005
Posts: 38
Hi
A few simple queries :

The capacity the doGet can send to the server is 256kb, right?
The types of protocols used in HttpServlet is just HTTP. What about Generic servlet ??
What are the exceptions thrown by Servlets ? Why ?

Thanks in advance,
Nikita
Makarand Parab
Ranch Hand

Joined: Dec 10, 2004
Posts: 121
Hi
The capacity the doGet can send to the server is 256kb, right? Yes

The types of protocols used in HttpServlet is just HTTP. What about Generic servlet ??
Generic servlet are not protocal based. If u see the arguments in the service method, u will see it has Request and Response as compared to HttpRequest and HttpResponse. If u application is non-http protocal based u can go for generic servlet.

What are the exceptions thrown by Servlets ? Why ?
Exception throw by Servlets are IOException and ServletException.
ServletException is a subclass of java.lang.Exception that is specific to servlets--the class is defined in the javax.servlet package. This exception is thrown to indicate a general servlet problem. It has the same constructors as java.lang.Exception: one that takes no arguments and one that takes a single message string. Servers catching this exception may handle it any way they see fit.

For servers that buffer their output, the IOException is thrown when the buffer fills up and its contents are flushed.


Let me know if it makes sense 2 u

Regards
Makarand Parab
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Makarand, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

thanks,
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nikita Deshmukh
Ranch Hand

Joined: Jun 08, 2005
Posts: 38
Hey Makarand

That really helped. Thank you so much for your simple and good explanation.

Regards,
Jyotsna.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

The capacity the doGet can send to the server is 256kb, right?


I doubt about it. I think it is not specific. It depends on browser/server.

Thanks
[ August 04, 2005: Message edited by: Narendra Dhande ]

Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

The HTTP RFC defines that a GET request should support at least 256 characters. I'll find a link. In practice it should be significantly more than this, but that value depends on every server that the request passes through, including proxies. If you send more it may be truncated unexpectedly, and I've even heard of servers that crash when sent more than 10,000 characters in a GET request.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Hmm, [url=http://www.itlab.musc.edu/help/Tutorials/PERL/HTTP_tut.htmlthis page[/url] refers to the 256 character limit with respect to perl and support by environment variables. I haven't been able to find the RFC referrin to the 265 char limit, sorry.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Thanks David,

The Servlet Specs also says that only limited data can be send with get request, but does not specify the exact size.

Regards
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I think the problems are:
1) the initial minimum value specified was so small and
2) it was so long ago

that the value is out of date and in practice could be just about anything. Unfortunately it is all we have to work with, and anyone developing new software and using the RFC may implement the same limit. There is just no way of knowing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple queries