File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doPost() & doGet()

 
Ann Toh
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
as im new in servlet, can anybody tell me what is the difference between doPost() and doGet(), can when to use which method??
Thanx in advance...
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
 
Ann Toh
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anybody tell me how to import a jar file into a servlet??
Thanx in advance...
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set CLASSPATH=path_to_jar_file
In the servlet import the necessary classes using import statment
 
Chad McGowan
Ranch Hand
Posts: 265
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend putting the jar under WEB-INF/lib directory and then referencing the classes from you servlet import statements.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition, all classes that you place under the WEB-INF/classes directory are automatically added to your classpath
the same happens when you add jar files to your WEB-INF/lib directory.
 
Ann Toh
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can anybody tell me where to set the classpath??
Thanx in advance...
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can you tell me classpath for what?
-Sainudheen
 
Ann Toh
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sainudheen Mydeen,
i wan to import a jar file, some of them said need to set the classpath. so now i wan to know whether where to set the classpath?? if i don't want to set classpath, then how do i import the jar file??
thanx in advance...
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ann
As explained before you can keep your jar file in WEB-INF\lib folder and import the required class in your file.
-Sainudheen
 
Ramakrishnan thiyagarajan
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
doGet(), dopost() methods are the httpservlets method.both have some restrictions.in doGet() method we send a request it appended to the url
in query strings.but u post the second method it can send viaa socket.
in doGet() method we send some limited request but dopost() are not.
it have unlimited length to send a req.
 
Tim Baker
Ranch Hand
Posts: 541
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for tomcat and something general like a database driver put the .jar file in tomcat/commond/lib so that all your web applications can use it
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic