Vous êtes sur la page 1sur 9

Function Description

array ( ) Creates an array


array _products Calculates the products of values in array
array _fill ( ) Fills an array with values
array _ pop ( ) Deletes the last elements of array
array _push ( ) Inserts one or more elements to the end of an array

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 Operator Name


== Equal > Greater than
=== Identical < Less than
!= Not equal >= Greater than or equal to
<> Not equal <= Less than or equal to
!== Not identical

Operator Name
++$x Pre - increment
$x ++ Post-increment
--$x Pre-decrement
$x - - Post-decrement

Operator Name Operator Name


and And && And
or Or || Or
xor Xor ! Not
Operator Name
. Concatenation
.= Concatenation assignment

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.

Include directive Include action


1. Includes the file at 1. Includes the file at run
translation time. time.
2. Syntax : 2. Syntax:
<%@ include <jsp:include
file = “file_name”%> page =”file_name”/>
3. When using include directive, 3. When using include action,
we can’t pass the parameters. we can pass parameters
using param.
Attribute Purpose
Buffer Specifies a buffering model for
the output stream.
autoflush Controls the behavior of the
servlet output buffer.
content Type Defines the character encoding
scheme.
errorpage Defines the URL of another JSP
that reports on Java unchecked
runtime exceptions
isErrorpage Indicates if this JSP page is a
URL specified by another JSP
page's errorPage attribute.
Extends Specifies a superclass that the
generated servlet must extend.
import To import packages for use in
JSP.
Info Defines a string that can be
accessed with the servlet's
getServletInfo( ) method.
isThreadsafe Defines the threading model
for the generated servlet.
Language Defines the programming
language used in the JSP page.
Session Specifies whether or not the
JSP page participates in HTTP
sessions.
IsELignored Specifies whether or not the EL
expression within the JSP page
will be ignored.
isScriptingEnabled Determines if the scripting
elements are allowed for use.
JSP action tags Description
jsp:forward Forwards the request and
response to another resource.
jsp:include Include another resource
jsp:UseBean Cretes or locates bean object
jsp:SetProperty Sets the value of property in
bean object.
jsp:getProperty Prints the value of property of
bean object.
jsp:Plugins Embeds another components
such as applets
jsp:Param Sets the parameter value
jsp:fallback Can be used to print the
message if plugin is working.
It is used in jsp:plugin
Methods Description
setDomain(String pattern) sets the domain for the cookie
String getDomain ( ) gets the domain to which
cookie applies.
SetMaxage (int seconds) Sets how much time in seconds
should elapse before the
cookie expires. By default, the
cookie will last for the current
session.
GetMaxAge ( ) Get Cookie age in second. -1
indicating the cookie will
persist until browser
shutdown.
String getNames ( ) Returns the name of the
cookie, which cannot be
changed after creation.
Setvalue(StringnewValue) Sets the value associated with
the cookie.
String getValue ( ) Gets the value associated with
cookie.
Setpath (String url) Sets the path this cookie
applies. By default, the cookie
is current directory and sub
directories.
String getPath ( ) Gets the path to which this
cookie applies.
Setsecure (Boolean flag) Sets to send cookie over
encrypted
SetComment(String Sets the comment that
purpose) describes a cookie’s purpose
String getConnect ( C ) Gets the comment for the
cookie.

Student ID First Name Last Name Age


150 Nakul Jain 22
151 Ramesh Kumar 20
152 Ajeet Singhal 22
153 Hamza Hussain 22

Vous aimerez peut-être aussi