This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes doPost() & doGet() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "doPost() & doGet()" Watch "doPost() & doGet()" New topic
Author

doPost() & doGet()

Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
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

Joined: Feb 27, 2002
Posts: 8904

http://www.coderanch.com/t/347534/Servlets/java/POST-Method-Diferences


Groovy
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi,
Can anybody tell me how to import a jar file into a servlet??
Thanx in advance...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

set CLASSPATH=path_to_jar_file
In the servlet import the necessary classes using import statment
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
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

Joined: Nov 27, 2001
Posts: 1561
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.


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi,
can anybody tell me where to set the classpath??
Thanx in advance...
Sainudheen Mydeen
Ranch Hand

Joined: Aug 18, 2003
Posts: 218
Hi
Can you tell me classpath for what?
-Sainudheen
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
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

Joined: Aug 18, 2003
Posts: 218
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

Joined: Oct 07, 2003
Posts: 57
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

Joined: Oct 04, 2003
Posts: 541
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


Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doPost() & doGet()
 
Similar Threads
POST or GET
Servlet Forward
can we call a doPost() inside a doGet(). ?
doPost and doGet
service() in HttpServlet