Académique Documents
Professionnel Documents
Culture Documents
Function Description
array ( ) Creates an array
checkdate ( ) Validates a Gregorian date
date ( ) Formats a local time / date
time ( ) Returns the current time as a unix timestamp
getdate ( ) Returns an array that contains date and time
information for a unix time stamp
idate ( ) Formats a local time/date is integer
GET POST
1. It is used to request data from 1. It is used to send data to a
specified resources. server to create or update a
resources.
2. GET request can be cached. 2. POST request are never
cached.
3. They remain in the browser 3. They do not remain in the
history. browser history.
Operator Name
++$x Pre - increment
$x ++ Post-increment
--$x Pre-decrement
$x - - Post-decrement
Operator Name
+ Union
== Equality
=== Identity
!= Inequality
<> Inequality
!== Non – identify
GET POST
1. Get is used to request data from a 1. POST is used to send data to a
specified resources. server to create or update a
resources.
2. GET request can be cached 2. POST requests are never cached.
3. They remain in the browser 3. They do not remain in the
history. browser history.
4. They can be bookmarked. 4. They cannot be bookmarked
5. They have length restrictions 5. They have no restrictions on data
length.
Method Description
Void destroy ( ) Called when the servlet is
unloaded.
ServletConfig Returns a servlet config object
get.ServletConfig ( ) that contains any initialization
parameters.
String getServlet Info ( ) Returns a string describing
the servlet
Void init (ServletConfig Called when the servlet is
sc)throws Servlet Exception initialized.
Void service (Servlet Called to process a request
Request req, from a client. The request
ServletResponse res) from the client can be read
throws ServletException, from req. The response to the
IoException. client can be written to res.
Method Description
Object getAttribute (string Returns the value of the server
attr) attribute the name attr.
String getMimeType Returns the MIME type of file.
(String file)
String getRealPath(String Returns the real path that
Vpath) corresponds to virtual path
String getServerInfo ( ) Returns info about server
Void log (String S) Write S to the servlet log
Void setAttribute (String Sets the attribute specified by
attr, Object val) attr to the value passed in val.
Method Description
ServletContext getServlet Returns the context of servlet
Content ( )
String get Init parameter Returns the value of
(String param) initialization parameter.
Enumeration getInit Returns an enumeration of all
parameter Name ( ) init parameters names.
String getServlet Name ( ) Returns the name of invoking
servlet.
Interfaces Classes
Servlet Servlet InputStream
Servlet Context Servlet Outputstream
Servlet Config Generic Servlet
Servlet Request Servlet Request wrapper
Servlet Response Servlet Response wrapper
Servlet contextlistener Servlet Request Event
RequestDispatcher Servlet content event
SingleThreadModel Servlet Request Attribute
Event
Servlet Requestlistener Servlet Context Attribute
Event
Servlet Exception
Unavailable Exception
Classes Interfaces
HttpServlet Htttp ServletRequest
Cookie Httpsessionattributelistener
HttpServletResponse HttpsessionLister
HttpSession HttpsessionEvent
Applet Servlet
1. It is always executed on the client 1. It is always executed on server side.
side.
2. Packages are 2. Packages are
import java.applet.*; Import javax.servlet.*;
import java.awt .*; Import javax.servlet.http.*
3. Applets user interface classes like 3. No UI required.
AWT and swing
4. Requires Java compatible browser 4. It process the input from client side
for execution. and generates the response in terms
of HTML page, JavaScript, applets.
5. Applets utilizes more network 5. Servlets are executed on the servers
bandwidth as it executes on client and hence require less bandwidth.
machine.
6. More prone to risk as is on the 6. It is under the server security.
client machine.
Applet Servlet
2. It is always executed on the client 3. It is always executed on server side.
side.
4. Packages are 4. Packages are
import java.applet.*; Import javax.servlet.*;
import java.awt .*; Import javax.servlet.http.*
5. Applets user interface classes like 7. No UI required.
AWT and swing
8. Requires Java compatible browser 7. It process the input from client side
for execution. and generates the response in terms
of HTML page, JavaScript, applets.
9. Applets utilizes more network 8. Servlets are executed on the servers
bandwidth as it executes on client and hence require less bandwidth.
machine.
10. More prone to risk as is on the 9. It is under the server security.
client machine.
JSP Servlets
1. JSP is a webpages scripting 1. Servlets re Java programs
language. that are already compiled.
2. JSP run slower compared to 2. Servlets run faster
servlet. compared to JSP.
3. In MVC, JSP act as a view. 3. In MVC, servlet act as a
controller.