java servlet development kit 2.3 documentation by f.allimant · notes la documentation ......
TRANSCRIPT
English
AproposdecedocumentCedocumentaétéconstruitautomatiquementàpartirdeladocumentationHTMLdisponiblesurjava.sun.com.Ilestpériodiquementremisàjour,lorsquedenouvellesversionsdesdocumentationsoriginalesdeviennentdisponibles.Pourtéléchargerlibrementetgratuitementcesmisesàjour,maisaussid''autresdocumentsJavaauformatHTMLHelpouWinHelp,visitezlesitedeFranckAllimant:
http://www.confluent.fr/javadoc(enFrançais)
http://www.confluent.fr/javadoc/indexe.html(enAnglais)
Bonneutilisation!
Contact
Lesremarquesetlessuggestionssontlesbienvenues.MercidelesfaireparveniràFranckAllimant.
Notes
LadocumentationHTMLoriginaleestdisponiblesurjava.sun.com.Mercidelaconsultersivousavezdesincertitudesàproposlesinformationsprésentéesdanscedocument.
LaversionHTMLHelpdecettedocumentationdiffèreparquelquespointsdelaversionHTML,àcausedecertaineslimitationsdeHTMLHelp.
1.AppletsJava
LesappletsJava1fonctionnentcorrectementdansHTMLHelp,pourvuquelesclassesJavanesoientpasembarquéesdanslefichierd'aide(chm)lui-même.Ellessontstockéesdanslerépertoireapplets,quisetrouveaumêmeendroitquelefichierd'aide.Cerépertoiren'estpasnécessaireaufonctionnementdel'aide:s'ilestabsent,lesappletsneserontpasaffichées.
LepluginJavan'estpassupportéparHTMLHelp.LesappletsnécessitantunemachinevirtuelleJava2nepeuventpasêtreexécutées.
2.Fichiersnécessitantunplugin
Lesupportdespluginsn'estpascompletdansHTMLHelp.Enfonctiondelaconfigurationdevotremachine,certainsproblèmespeuventsurvenirlorsdelavisualisationdecesfichiers,enparticulierlesdocumentsPDF.
3.Occurrencesmultiplesd'unmot-clefdel'index
Siunmotclefdel'indexpointeversplusieursdocuments,unepagelistanttouteslesoccurrencestrouvéesestaffichée.Cettepagefournitletitredesdocumentsdanslequellemotclefapparaît,ets'ils'agitd'uneméthode,lesparamètresdecetteméthode.Cemoded'affichagetrèsdétailléaétépréféréàlaboîtededialogue"RubriquesTrouvées"proposéesenstandardparHTMLHelp,pourpermettreunenavigationplusefficaceetplusrapidedansungrandnombrededocuments.
Mercià...
a.doConsulting,pouroffrirgratuitementunparserHTMLécritenJavaaussicompactetefficace.
DougKramer,deSun,quiaautoriséladistributiondesdocumentationsJavapourWinHelpetHTMLHelp.
Distribution
Celogicielestgratuit.IlnepeutêtrediffusésurInternetoudupliquéquedansdesbutsnoncommerciaux,pourusageprivéexclusivement.ToutedistributionparCD-ROMestsoumiseàuneautorisationpréalable[contact].
TouteslesrestrictionsdedistributionimposéesparSunàladocumentationoriginalesontapplicablesauprésentdocument.Consultezcettepage(enanglais)pourenprendreconnaissance.
Copyright©1997-2002,FranckAllimant
French
AboutthisdocumentThisdocumentisbuiltfromtheHTMLdocumentationsavailableatjava.sun.com.Itisregularlyupdated,whennewversionsoforiginaldocumentationsbecomeavailable.TodownloadupdatesandmanyotherWinHelpandHTMLHelpJavadocumentationsforfree,visitFranckAllimant'swebsite:
http://www.confluent.fr/javadoc/indexe.html(inEnglish)
http://www.confluent.fr/javadoc(inFrench)
Contact
Commentsandsuggestionsarewelcome.FeelfreetosendthemtoFranckAllimant.
Notes
TheoriginalHTMLdocumentationisavailableatjava.sun.com.Pleaserefertothisoriginaldocumentationifyou'renotconfidentwiththepresentdocument.
DuetosomeHTMLHelplimitations,therearesomedifferencesbetweenthishelpfileandtheoriginalHTMLversionofthedocumentation.
1.JavaApplets
Inmostcases,Java1appletsarerunninginsidetheHTMLHelpviewer,providedthey'renotembeddedinthehelp(chm)file.Theyarestoredintheappletsdirectory,locatedatthesamelevelasthehelpfile.Thisfolderisnotrequiredforbrowsinghelp,butifitismissing,appletswillnotbedisplayed.
Java2appletsrequiretheJavaPlugin,whichisnotsupportedbytheHTMLHelpviewer.Theseappletswillnotbedisplayed.
2.Documentsthatrequireaplugin
PluginsarenotfullysupportedbytheHTMLHelpviewer.Dependingontheconfigurationofyourmachine,someproblemsmayoccurwhenviewingthesefiles,forexamplePDFdocuments.
3.Multipleoccurrencesofanindexkeyword
Ifanindexkeywordpointstomorethanonedocument,apagethatlistsallfoundoccurrencesisdisplayed.Thispageshowsthetitleofeverydocumentinwhichthekeyword
appears,andifthiskeywordisamethod,theparametersofthismethod.ThisdetaileddisplayhasbeenpreferredtothestandardHTMLHelp"TopicsFound"dialogbox,toprovideafasterandmoreefficientbrowsingofalargenumberofdocuments.
Thanksto...
a.doConsulting,forHtmlStreamTokenizer™,acompact,efficientandfreeHTMLparserwritteninJava.
DougKrameratSun,whoauthorizedthedistributionofthisdocument.
Distribution
Thissoftwareisfree.Permissiontouse,copy,anddistributethissoftwarefornon-commercialpurposesviatheInternetwithoutfeeisherebygranted.PermissionisnotgrantedforanydistributionintheformofCD-ROM[contact].
Sun'sdocumentationredistributionpolicyisapplicabletothisdocument.Pleaseseethispagefordetails.
Copyright©1997-2002,FranckAllimant
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
SerializedForm
Packagejavax.servlet
Classjavax.servlet.GenericServletimplementsSerializable
Classjavax.servlet.ServletContextAttributeEventimplementsSerializable
SerializedFields
name
java.lang.Stringname
value
java.lang.Objectvalue
Classjavax.servlet.ServletContextEventimplementsSerializable
Classjavax.servlet.ServletExceptionimplementsSerializable
SerializedFields
rootCause
java.lang.ThrowablerootCause
Classjavax.servlet.UnavailableExceptionimplementsSerializable
SerializedFields
permanent
booleanpermanent
seconds
intseconds
servlet
Servletservlet
Packagejavax.servlet.http
Classjavax.servlet.http.HttpServletimplementsSerializable
Classjavax.servlet.http.HttpSessionBindingEventimplementsSerializable
SerializedFields
name
java.lang.Stringname
value
java.lang.Objectvalue
Classjavax.servlet.http.HttpSessionEventimplementsSerializable
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated Index HelpPREVNEXT FRAMESNOFRAMES
HowThisAPIDocumentIsOrganized
ThisAPI(ApplicationProgrammingInterface)documenthaspagescorrespondingtotheitemsinthenavigationbar,describedasfollows.
Overview
TheOverviewpageisthefrontpageofthisAPIdocumentandprovidesalistofallpackageswithasummaryforeach.Thispagecanalsocontainanoveralldescriptionofthesetofpackages.
Package
Eachpackagehasapagethatcontainsalistofitsclassesandinterfaces,withasummaryforeach.Thispagecancontainfourcategories:
Interfaces(italic)ClassesExceptionsErrors
Class/Interface
Eachclass,interface,innerclassandinnerinterfacehasitsownseparatepage.Eachofthesepageshasthreesectionsconsistingofaclass/interfacedescription,summarytables,anddetailedmemberdescriptions:
ClassinheritancediagramDirectSubclassesAllKnownSubinterfacesAllKnownImplementingClassesClass/interfacedeclarationClass/interfacedescription
InnerClassSummaryFieldSummaryConstructorSummaryMethodSummary
FieldDetailConstructorDetailMethodDetail
Eachsummaryentrycontainsthefirstsentencefromthedetaileddescriptionforthatitem.Thesummaryentriesarealphabetical,whilethedetaileddescriptionsareintheordertheyappearinthesourcecode.Thispreservesthelogicalgroupingsestablishedbytheprogrammer.
Tree(ClassHierarchy)
ThereisaClassHierarchypageforallpackages,plusahierarchyforeachpackage.Eachhierarchypagecontainsalistofclassesandalistofinterfaces.Theclassesareorganizedbyinheritancestructurestartingwithjava.lang.Object.Theinterfacesdonotinheritfromjava.lang.Object.
WhenviewingtheOverviewpage,clickingon"Tree"displaysthehierarchyforallpackages.Whenviewingaparticularpackage,classorinterfacepage,clicking"Tree"displaysthehierarchyforonlythatpackage.
DeprecatedAPI
TheDeprecatedAPIpagelistsalloftheAPIthathavebeendeprecated.AdeprecatedAPIisnotrecommendedforuse,generallyduetoimprovements,andareplacementAPIisusuallygiven.DeprecatedAPIsmayberemovedinfutureimplementations.
Index
TheIndexcontainsanalphabeticlistofallclasses,interfaces,constructors,methods,andfields.
Prev/Next
Theselinkstakeyoutothenextorpreviousclass,interface,package,orrelatedpage.
Frames/NoFrames
TheselinksshowandhidetheHTMLframes.Allpagesareavailablewithorwithoutframes.
SerializedForm
Eachserializableorexternalizableclasshasadescriptionofitsserializationfieldsandmethods.Thisinformationisofinteresttore-implementors,nottodevelopersusingtheAPI.Whilethereisnolinkinthenavigationbar,youcangettothisinformationbygoingtoanyserializedclassandclicking"SerializedForm"inthe"Seealso"sectionoftheclassdescription.
ThishelpfileappliestoAPIdocumentationgeneratedusingthestandarddoclet.
Overview Package Class Tree Deprecated Index HelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
HierarchyForAllPackages
PackageHierarchies:javax.servlet,javax.servlet.http
ClassHierarchy
classjava.lang.Objectclassjavax.servlet.http.Cookie(implementsjava.lang.Cloneable)classjava.util.EventObject(implementsjava.io.Serializable)
classjavax.servlet.http.HttpSessionEventclassjavax.servlet.http.HttpSessionBindingEvent
classjavax.servlet.ServletContextEventclassjavax.servlet.ServletContextAttributeEvent
classjavax.servlet.GenericServlet(implementsjava.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig)
classjavax.servlet.http.HttpServlet(implementsjava.io.Serializable)
classjavax.servlet.http.HttpUtilsclassjava.io.InputStream
classjavax.servlet.ServletInputStreamclassjava.io.OutputStream
classjavax.servlet.ServletOutputStreamclassjavax.servlet.ServletRequestWrapper(implementsjavax.servlet.ServletRequest)
classjavax.servlet.http.HttpServletRequestWrapper(implementsjavax.servlet.http.HttpServletRequest)
classjavax.servlet.ServletResponseWrapper(implementsjavax.servlet.ServletResponse)
classjavax.servlet.http.HttpServletResponseWrapper(implementsjavax.servlet.http.HttpServletResponse)
classjava.lang.Throwable(implementsjava.io.Serializable)classjava.lang.Exception
classjavax.servlet.ServletExceptionclassjavax.servlet.UnavailableException
InterfaceHierarchy
interfacejava.util.EventListenerinterfacejavax.servlet.http.HttpSessionActivationListenerinterfacejavax.servlet.http.HttpSessionAttributeListenerinterfacejavax.servlet.http.HttpSessionBindingListenerinterfacejavax.servlet.http.HttpSessionListenerinterfacejavax.servlet.ServletContextAttributeListenerinterfacejavax.servlet.ServletContextListener
interfacejavax.servlet.Filterinterfacejavax.servlet.FilterChaininterfacejavax.servlet.FilterConfiginterfacejavax.servlet.http.HttpSessioninterfacejavax.servlet.http.HttpSessionContextinterfacejavax.servlet.RequestDispatcherinterfacejavax.servlet.Servletinterfacejavax.servlet.ServletConfiginterfacejavax.servlet.ServletContextinterfacejavax.servlet.ServletRequest
interfacejavax.servlet.http.HttpServletRequestinterfacejavax.servlet.ServletResponse
interfacejavax.servlet.http.HttpServletResponseinterfacejavax.servlet.SingleThreadModel
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
ABCDEFGHIJLPRSUV
A
addCookie(Cookie)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocalladdCookie(Cookiecookie)onthewrappedresponseobject.
addCookie(Cookie)-Methodininterfacejavax.servlet.http.HttpServletResponse
Addsthespecifiedcookietotheresponse.addDateHeader(String,long)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocalladdDateHeader(Stringname,longdate)onthewrappedresponseobject.
addDateHeader(String,long)-Methodininterfacejavax.servlet.http.HttpServletResponse
Addsaresponseheaderwiththegivennameanddate-value.addHeader(String,String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistoreturnaddHeader(Stringname,Stringvalue)onthewrappedresponseobject.
addHeader(String,String)-Methodininterfacejavax.servlet.http.HttpServletResponse
Addsaresponseheaderwiththegivennameandvalue.addIntHeader(String,int)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocalladdIntHeader(Stringname,intvalue)onthewrappedresponseobject.
addIntHeader(String,int)-Methodininterfacejavax.servlet.http.HttpServletResponse
Addsaresponseheaderwiththegivennameandintegervalue.attributeAdded(HttpSessionBindingEvent)-Methodininterfacejavax.servlet.http.HttpSessionAttributeListener
Notificationthatanattributehasbeenaddedtoasession.attributeAdded(ServletContextAttributeEvent)-Methodininterfacejavax.servlet.ServletContextAttributeListener
Notificationthatanewattributewasaddedtotheservletcontext.attributeRemoved(HttpSessionBindingEvent)-Methodininterface
javax.servlet.http.HttpSessionAttributeListenerNotificationthatanattributehasbeenremovedfromasession.
attributeRemoved(ServletContextAttributeEvent)-Methodininterfacejavax.servlet.ServletContextAttributeListener
Notificationthatanexistingattributehasbeenremvedfromtheservletcontext.
attributeReplaced(HttpSessionBindingEvent)-Methodininterfacejavax.servlet.http.HttpSessionAttributeListener
Notificationthatanattributehasbeenreplacedinasession.attributeReplaced(ServletContextAttributeEvent)-Methodininterfacejavax.servlet.ServletContextAttributeListener
Notificationthatanattributeontheservletcontexthasbeenreplaced.
B
BASIC_AUTH-Staticvariableininterfacejavax.servlet.http.HttpServletRequest
StringidentifierforBasicauthentication.
C
CLIENT_CERT_AUTH-Staticvariableininterfacejavax.servlet.http.HttpServletRequest
StringidentifierforBasicauthentication.clone()-Methodinclassjavax.servlet.http.Cookie
Overridesthestandardjava.lang.Object.clonemethodtoreturnacopyofthiscookie.
containsHeader(String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallcontainsHeader(Stringname)onthewrappedresponseobject.
containsHeader(String)-Methodininterfacejavax.servlet.http.HttpServletResponse
Returnsabooleanindicatingwhetherthenamedresponseheaderhasalreadybeenset.
contextDestroyed(ServletContextEvent)-Methodininterfacejavax.servlet.ServletContextListener
Notificationthattheservletcontextisabouttobeshutdown.contextInitialized(ServletContextEvent)-Methodininterfacejavax.servlet.ServletContextListener
Notificationthatthewebapplicationisreadytoprocessrequests.Cookie-classjavax.servlet.http.Cookie.
Createsacookie,asmallamountofinformationsentbyaservlettoaWebbrowser,savedbythebrowser,andlatersentbacktotheserver.
Cookie(String,String)-Constructorforclassjavax.servlet.http.CookieConstructsacookiewithaspecifiednameandvalue.
D
destroy()-Methodininterfacejavax.servlet.FilterCalledbythewebcontainertoindicatetoafilterthatitisbeingtakenoutofservice.
destroy()-Methodininterfacejavax.servlet.ServletCalledbytheservletcontainertoindicatetoaservletthattheservletisbeingtakenoutofservice.
destroy()-Methodinclassjavax.servlet.GenericServletCalledbytheservletcontainertoindicatetoaservletthattheservletisbeingtakenoutofservice.
DIGEST_AUTH-Staticvariableininterfacejavax.servlet.http.HttpServletRequest
StringidentifierforBasicauthentication.doDelete(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaDELETErequest.
doFilter(ServletRequest,ServletResponse)-Methodininterfacejavax.servlet.FilterChain
Causesthenextfilterinthechaintobeinvoked,orifthecallingfilteristhelastfilterinthechain,causestheresourceattheendofthechaintobeinvoked.
doFilter(ServletRequest,ServletResponse,FilterChain)-Methodininterfacejavax.servlet.Filter
ThedoFiltermethodoftheFilteriscalledbythecontainereachtimearequest/responsepairispassedthroughthechainduetoaclientrequestforaresourceattheendofthechain.
doGet(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaGETrequest.
doHead(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
ReceivesanHTTPHEADrequestfromtheprotectedservicemethodandhandlestherequest.
doOptions(HttpServletRequest,HttpServletResponse)-Methodinclass
javax.servlet.http.HttpServletCalledbytheserver(viatheservicemethod)toallowaservlettohandleaOPTIONSrequest.
doPost(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaPOSTrequest.
doPut(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaPUTrequest.
doTrace(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaTRACErequest.
E
encodeRedirectUrl(String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistoreturnencodeRedirectUrl(Stringurl)onthewrappedresponseobject.
encodeRedirectUrl(String)-Methodininterfacejavax.servlet.http.HttpServletResponse
Deprecated.Asofversion2.1,useencodeRedirectURL(Stringurl)insteadencodeRedirectURL(String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistoreturnencodeRedirectURL(Stringurl)onthewrappedresponseobject.
encodeRedirectURL(String)-Methodininterfacejavax.servlet.http.HttpServletResponse
EncodesthespecifiedURLforuseinthesendRedirectmethodor,ifencodingisnotneeded,returnstheURLunchanged.
encodeUrl(String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallencodeUrl(Stringurl)onthewrappedresponseobject.
encodeUrl(String)-Methodininterfacejavax.servlet.http.HttpServletResponseDeprecated.Asofversion2.1,useencodeURL(Stringurl)instead
encodeURL(String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallencodeURL(Stringurl)onthewrappedresponseobject.
encodeURL(String)-Methodininterfacejavax.servlet.http.HttpServletResponse
EncodesthespecifiedURLbyincludingthesessionIDinit,or,ifencodingisnotneeded,returnstheURLunchanged.
F
Filter-interfacejavax.servlet.Filter.Afilterisanobjectthanperformfilteringtasksoneithertherequesttoaresource(aservletorstaticcontent),orontheresponsefromaresource,orboth.
FiltersperformfilteringinthedoFiltermethod.FilterChain-interfacejavax.servlet.FilterChain.
AFilterChainisanobjectprovidedbytheservletcontainertothedevelopergivingaviewintotheinvocationchainofafilteredrequestforaresource.
FilterConfig-interfacejavax.servlet.FilterConfig.Afilterconfigurationobjectusedbyaservletcontainerusedtopassinformationtoafilterduringinitialization.
flushBuffer()-Methodininterfacejavax.servlet.ServletResponseForcesanycontentinthebuffertobewrittentotheclient.
flushBuffer()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistocallflushBuffer()onthewrappedresponseobject.
FORM_AUTH-Staticvariableininterfacejavax.servlet.http.HttpServletRequest
StringidentifierforBasicauthentication.forward(ServletRequest,ServletResponse)-Methodininterfacejavax.servlet.RequestDispatcher
Forwardsarequestfromaservlettoanotherresource(servlet,JSPfile,orHTMLfile)ontheserver.
G
GenericServlet-classjavax.servlet.GenericServlet.Definesageneric,protocol-independentservlet.
GenericServlet()-Constructorforclassjavax.servlet.GenericServletDoesnothing.
getAttribute(String)-Methodininterfacejavax.servlet.ServletContextReturnstheservletcontainerattributewiththegivenname,ornullifthereisnoattributebythatname.
getAttribute(String)-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistocallgetAttribute(Stringname)onthewrappedrequestobject.
getAttribute(String)-Methodininterfacejavax.servlet.ServletRequestReturnsthevalueofthenamedattributeasanObject,ornullifnoattributeofthegivennameexists.
getAttribute(String)-Methodininterfacejavax.servlet.http.HttpSessionReturnstheobjectboundwiththespecifiednameinthissession,ornullifnoobjectisboundunderthename.
getAttributeNames()-Methodininterfacejavax.servlet.ServletContextReturnsanEnumerationcontainingtheattributenamesavailablewithinthisservletcontext.
getAttributeNames()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetAttributeNames()onthewrappedrequestobject.
getAttributeNames()-Methodininterfacejavax.servlet.ServletRequestReturnsanEnumerationcontainingthenamesoftheattributesavailabletothisrequest.
getAttributeNames()-Methodininterfacejavax.servlet.http.HttpSessionReturnsanEnumerationofStringobjectscontainingthenamesofalltheobjectsboundtothissession.
getAuthType()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthenameoftheauthenticationschemeusedtoprotecttheservlet.
getAuthType()-Methodinclassjavax.servlet.http.HttpServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetAuthType()onthewrappedrequestobject.
getBufferSize()-Methodininterfacejavax.servlet.ServletResponseReturnstheactualbuffersizeusedfortheresponse.
getBufferSize()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistoreturngetBufferSize()onthewrappedresponseobject.
getCharacterEncoding()-Methodininterfacejavax.servlet.ServletResponseReturnsthenameofthecharsetusedfortheMIMEbodysentinthisresponse.
getCharacterEncoding()-Methodinclassjavax.servlet.ServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetCharacterEncoding()onthewrappedrequestobject.
getCharacterEncoding()-Methodininterfacejavax.servlet.ServletRequestReturnsthenameofthecharacterencodingusedinthebodyofthisrequest.
getCharacterEncoding()-Methodinclassjavax.servlet.ServletResponseWrapper
ThedefaultbehaviorofthismethodistoreturngetCharacterEncoding()onthewrappedresponseobject.
getComment()-Methodinclassjavax.servlet.http.CookieReturnsthecommentdescribingthepurposeofthiscookie,ornullifthecookiehasnocomment.
getContentLength()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetContentLength()onthewrappedrequestobject.
getContentLength()-Methodininterfacejavax.servlet.ServletRequestReturnsthelength,inbytes,oftherequestbodyandmadeavailablebytheinputstream,or-1ifthelengthisnotknown.
getContentType()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetContentType()onthewrappedrequestobject.
getContentType()-Methodininterfacejavax.servlet.ServletRequestReturnstheMIMEtypeofthebodyoftherequest,ornullifthetypeisnotknown.
getContext(String)-Methodininterfacejavax.servlet.ServletContextReturnsaServletContextobjectthatcorrespondstoaspecifiedURLontheserver.
getContextPath()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnstheportionoftherequestURIthatindicatesthecontextoftherequest.
getContextPath()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetContextPath()onthewrappedrequestobject.
getCookies()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsanarraycontainingalloftheCookieobjectstheclientsentwiththisrequest.
getCookies()-Methodinclassjavax.servlet.http.HttpServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetCookies()onthewrappedrequestobject.
getCreationTime()-Methodininterfacejavax.servlet.http.HttpSessionReturnsthetimewhenthissessionwascreated,measuredinmillisecondssincemidnightJanuary1,1970GMT.
getDateHeader(String)-Methodininterfacejavax.servlet.http.HttpServletRequest
ReturnsthevalueofthespecifiedrequestheaderasalongvaluethatrepresentsaDateobject.
getDateHeader(String)-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetDateHeader(Stringname)onthewrappedrequestobject.
getDomain()-Methodinclassjavax.servlet.http.CookieReturnsthedomainnamesetforthiscookie.
getFilterName()-Methodininterfacejavax.servlet.FilterConfigReturnsthefilter-nameofthisfilterasdefinedinthedeploymentdescriptor.
getHeader(String)-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthevalueofthespecifiedrequestheaderasaString.
getHeader(String)-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetHeader(Stringname)onthewrappedrequestobject.
getHeaderNames()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsanenumerationofalltheheadernamesthisrequestcontains.
getHeaderNames()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetHeaderNames()onthewrappedrequestobject.
getHeaders(String)-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsallthevaluesofthespecifiedrequestheaderasanEnumerationofStringobjects.
getHeaders(String)-Methodinclass
javax.servlet.http.HttpServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetHeaders(Stringname)onthewrappedrequestobject.
getId()-Methodininterfacejavax.servlet.http.HttpSessionReturnsastringcontainingtheuniqueidentifierassignedtothissession.
getIds()-Methodininterfacejavax.servlet.http.HttpSessionContextDeprecated.AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnanemptyEnumerationandwillberemovedinafutureversionofthisAPI.
getInitParameter(String)-Methodininterfacejavax.servlet.FilterConfigReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.
getInitParameter(String)-Methodininterfacejavax.servlet.ServletConfigReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.
getInitParameter(String)-Methodininterfacejavax.servlet.ServletContextReturnsaStringcontainingthevalueofthenamedcontext-wideinitializationparameter,ornulliftheparameterdoesnotexist.
getInitParameter(String)-Methodinclassjavax.servlet.GenericServletReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.
getInitParameterNames()-Methodininterfacejavax.servlet.FilterConfigReturnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
getInitParameterNames()-Methodininterfacejavax.servlet.ServletConfigReturnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
getInitParameterNames()-Methodininterfacejavax.servlet.ServletContextReturnsthenamesofthecontext'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationifthecontexthasnoinitializationparameters.
getInitParameterNames()-Methodinclassjavax.servlet.GenericServletReturnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
getInputStream()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetInputStream()onthe
wrappedrequestobject.getInputStream()-Methodininterfacejavax.servlet.ServletRequest
RetrievesthebodyoftherequestasbinarydatausingaServletInputStream.
getIntHeader(String)-Methodininterfacejavax.servlet.http.HttpServletRequest
Returnsthevalueofthespecifiedrequestheaderasanint.getIntHeader(String)-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetIntHeader(Stringname)onthewrappedrequestobject.
getLastAccessedTime()-Methodininterfacejavax.servlet.http.HttpSessionReturnsthelasttimetheclientsentarequestassociatedwiththissession,asthenumberofmillisecondssincemidnightJanuary1,1970GMT,andmarkedbythetimethecontainerrecievedtherequest.
getLastModified(HttpServletRequest)-Methodinclassjavax.servlet.http.HttpServlet
ReturnsthetimetheHttpServletRequestobjectwaslastmodified,inmillisecondssincemidnightJanuary1,1970GMT.
getLocale()-Methodininterfacejavax.servlet.ServletResponseReturnsthelocaleassignedtotheresponse.
getLocale()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetLocale()onthewrappedrequestobject.
getLocale()-Methodininterfacejavax.servlet.ServletRequestReturnsthepreferredLocalethattheclientwillacceptcontentin,basedontheAccept-Languageheader.
getLocale()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistoreturngetLocale()onthewrappedresponseobject.
getLocales()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetLocales()onthewrappedrequestobject.
getLocales()-Methodininterfacejavax.servlet.ServletRequestReturnsanEnumerationofLocaleobjectsindicating,indecreasingorderstartingwiththepreferredlocale,thelocalesthatareacceptabletotheclientbasedontheAccept-Languageheader.
getMajorVersion()-Methodininterfacejavax.servlet.ServletContextReturnsthemajorversionoftheJavaServletAPIthatthisservletcontainer
supports.getMaxAge()-Methodinclassjavax.servlet.http.Cookie
Returnsthemaximumageofthecookie,specifiedinseconds,Bydefault,-1indicatingthecookiewillpersistuntilbrowsershutdown.
getMaxInactiveInterval()-Methodininterfacejavax.servlet.http.HttpSessionReturnsthemaximumtimeinterval,inseconds,thattheservletcontainerwillkeepthissessionopenbetweenclientaccesses.
getMethod()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthenameoftheHTTPmethodwithwhichthisrequestwasmade,forexample,GET,POST,orPUT.
getMethod()-Methodinclassjavax.servlet.http.HttpServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetMethod()onthewrappedrequestobject.
getMimeType(String)-Methodininterfacejavax.servlet.ServletContextReturnstheMIMEtypeofthespecifiedfile,ornulliftheMIMEtypeisnotknown.
getMinorVersion()-Methodininterfacejavax.servlet.ServletContextReturnstheminorversionoftheServletAPIthatthisservletcontainersupports.
getName()-Methodinclassjavax.servlet.ServletContextAttributeEventReturnthenameoftheattributethatchangedontheServletContext.
getName()-Methodinclassjavax.servlet.http.HttpSessionBindingEventReturnsthenamewithwhichtheattributeisboundtoorunboundfromthesession.
getName()-Methodinclassjavax.servlet.http.CookieReturnsthenameofthecookie.
getNamedDispatcher(String)-Methodininterfacejavax.servlet.ServletContext
ReturnsaRequestDispatcherobjectthatactsasawrapperforthenamedservlet.
getOutputStream()-Methodininterfacejavax.servlet.ServletResponseReturnsaServletOutputStreamsuitableforwritingbinarydataintheresponse.
getOutputStream()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistoreturngetOutputStream()onthewrappedresponseobject.
getParameter(String)-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetParameter(Stringname)onthewrappedrequestobject.
getParameter(String)-Methodininterfacejavax.servlet.ServletRequestReturnsthevalueofarequestparameterasaString,ornulliftheparameterdoesnotexist.
getParameterMap()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetParameterMap()onthewrappedrequestobject.
getParameterMap()-Methodininterfacejavax.servlet.ServletRequestReturnsajava.util.Mapoftheparametersofthisrequest.
getParameterNames()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetParameterNames()onthewrappedrequestobject.
getParameterNames()-Methodininterfacejavax.servlet.ServletRequestReturnsanEnumerationofStringobjectscontainingthenamesoftheparameterscontainedinthisrequest.
getParameterValues(String)-Methodinclassjavax.servlet.ServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetParameterValues(Stringname)onthewrappedrequestobject.
getParameterValues(String)-Methodininterfacejavax.servlet.ServletRequestReturnsanarrayofStringobjectscontainingallofthevaluesthegivenrequestparameterhas,ornulliftheparameterdoesnotexist.
getPath()-Methodinclassjavax.servlet.http.CookieReturnsthepathontheservertowhichthebrowserreturnsthiscookie.
getPathInfo()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsanyextrapathinformationassociatedwiththeURLtheclientsentwhenitmadethisrequest.
getPathInfo()-Methodinclassjavax.servlet.http.HttpServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetPathInfo()onthewrappedrequestobject.
getPathTranslated()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsanyextrapathinformationaftertheservletnamebutbeforethequerystring,andtranslatesittoarealpath.
getPathTranslated()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetPathTranslated()onthewrappedrequestobject.
getProtocol()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetProtocol()onthewrappedrequestobject.
getProtocol()-Methodininterfacejavax.servlet.ServletRequestReturnsthenameandversionoftheprotocoltherequestusesintheformprotocol/majorVersion.minorVersion,forexample,HTTP/1.1.
getQueryString()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthequerystringthatiscontainedintherequestURLafterthepath.
getQueryString()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetQueryString()onthewrappedrequestobject.
getReader()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetReader()onthewrappedrequestobject.
getReader()-Methodininterfacejavax.servlet.ServletRequestRetrievesthebodyoftherequestascharacterdatausingaBufferedReader.
getRealPath(String)-Methodininterfacejavax.servlet.ServletContextReturnsaStringcontainingtherealpathforagivenvirtualpath.
getRealPath(String)-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetRealPath(Stringpath)onthewrappedrequestobject.
getRealPath(String)-Methodininterfacejavax.servlet.ServletRequestDeprecated.AsofVersion2.1oftheJavaServletAPI,useServletContext.getRealPath(java.lang.String)instead.
getRemoteAddr()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetRemoteAddr()onthewrappedrequestobject.
getRemoteAddr()-Methodininterfacejavax.servlet.ServletRequestReturnstheInternetProtocol(IP)addressoftheclientthatsenttherequest.
getRemoteHost()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetRemoteHost()onthewrappedrequestobject.
getRemoteHost()-Methodininterfacejavax.servlet.ServletRequestReturnsthefullyqualifiednameoftheclientthatsenttherequest.
getRemoteUser()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnstheloginoftheusermakingthisrequest,iftheuserhasbeenauthenticated,ornulliftheuserhasnotbeenauthenticated.
getRemoteUser()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetRemoteUser()onthewrappedrequestobject.
getRequest()-Methodinclassjavax.servlet.ServletRequestWrapperReturnthewrappedrequestobject.
getRequestDispatcher(String)-Methodininterfacejavax.servlet.ServletContext
ReturnsaRequestDispatcherobjectthatactsasawrapperfortheresourcelocatedatthegivenpath.
getRequestDispatcher(String)-Methodinclassjavax.servlet.ServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetRequestDispatcher(Stringpath)onthewrappedrequestobject.
getRequestDispatcher(String)-Methodininterfacejavax.servlet.ServletRequest
ReturnsaRequestDispatcherobjectthatactsasawrapperfortheresourcelocatedatthegivenpath.
getRequestedSessionId()-Methodininterfacejavax.servlet.http.HttpServletRequest
ReturnsthesessionIDspecifiedbytheclient.getRequestedSessionId()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetRequestedSessionId()onthewrappedrequestobject.
getRequestURI()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthepartofthisrequest'sURLfromtheprotocolnameuptothequerystringinthefirstlineoftheHTTPrequest.
getRequestURI()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetRequestURI()onthewrappedrequestobject.
getRequestURL()-Methodininterfacejavax.servlet.http.HttpServletRequestReconstructstheURLtheclientusedtomaketherequest.
getRequestURL()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetRequestURL()onthewrappedrequestobject.
getRequestURL(HttpServletRequest)-Staticmethodinclassjavax.servlet.http.HttpUtils
Deprecated.ReconstructstheURLtheclientusedtomaketherequest,usinginformationintheHttpServletRequestobject.
getResource(String)-Methodininterfacejavax.servlet.ServletContext
ReturnsaURLtotheresourcethatismappedtoaspecifiedpath.getResourceAsStream(String)-Methodininterfacejavax.servlet.ServletContext
ReturnstheresourcelocatedatthenamedpathasanInputStreamobject.getResourcePaths(String)-Methodininterfacejavax.servlet.ServletContext
Returnsadirectory-likelistingofallthepathstoresourceswithinthewebapplicationwhoselongestsub-pathmatchesthesuppliedpathargument.
getResponse()-Methodinclassjavax.servlet.ServletResponseWrapperReturnthewrappedServletResponseobject.
getRootCause()-Methodinclassjavax.servlet.ServletExceptionReturnstheexceptionthatcausedthisservletexception.
getScheme()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetScheme()onthewrappedrequestobject.
getScheme()-Methodininterfacejavax.servlet.ServletRequestReturnsthenameoftheschemeusedtomakethisrequest,forexample,http,https,orftp.
getSecure()-Methodinclassjavax.servlet.http.CookieReturnstrueifthebrowserissendingcookiesonlyoverasecureprotocol,orfalseifthebrowsercansendcookiesusinganyprotocol.
getServerInfo()-Methodininterfacejavax.servlet.ServletContextReturnsthenameandversionoftheservletcontaineronwhichtheservletisrunning.
getServerName()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetServerName()onthewrappedrequestobject.
getServerName()-Methodininterfacejavax.servlet.ServletRequestReturnsthehostnameoftheserverthatreceivedtherequest.
getServerPort()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetServerPort()onthewrappedrequestobject.
getServerPort()-Methodininterfacejavax.servlet.ServletRequestReturnstheportnumberonwhichthisrequestwasreceived.
getServlet()-Methodinclassjavax.servlet.UnavailableExceptionDeprecated.AsofJavaServletAPI2.2,withnoreplacement.Returnstheservletthatisreportingitsunavailability.
getServlet(String)-Methodininterfacejavax.servlet.ServletContextDeprecated.AsofJavaServletAPI2.1,withnodirectreplacement.
ThismethodwasoriginallydefinedtoretrieveaservletfromaServletContext.Inthisversion,thismethodalwaysreturnsnullandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
Inlieuofthismethod,servletscanshareinformationusingtheServletContextclassandcanperformsharedbusinesslogicbyinvokingmethodsoncommonnon-servletclasses.
getServletConfig()-Methodininterfacejavax.servlet.ServletReturnsaServletConfigobject,whichcontainsinitializationandstartupparametersforthisservlet.
getServletConfig()-Methodinclassjavax.servlet.GenericServletReturnsthisservlet'sServletConfigobject.
getServletContext()-Methodininterfacejavax.servlet.FilterConfigReturnsareferencetotheServletContextinwhichthecallerisexecuting.
getServletContext()-Methodininterfacejavax.servlet.ServletConfigReturnsareferencetotheServletContextinwhichthecallerisexecuting.
getServletContext()-Methodinclassjavax.servlet.ServletContextEventReturntheServletContextthatchanged.
getServletContext()-Methodinclassjavax.servlet.GenericServletReturnsareferencetotheServletContextinwhichthisservletisrunning.
getServletContext()-Methodininterfacejavax.servlet.http.HttpSessionReturnstheServletContexttowhichthissessionbelongs.
getServletContextName()-Methodininterfacejavax.servlet.ServletContextReturnsthenameofthiswebapplicationcorrepondingtothisServletContextasspecifiedinthedeploymentdescriptorforthiswebapplicationbythedisplay-nameelement.
getServletInfo()-Methodininterfacejavax.servlet.ServletReturnsinformationabouttheservlet,suchasauthor,version,andcopyright.
getServletInfo()-Methodinclassjavax.servlet.GenericServletReturnsinformationabouttheservlet,suchasauthor,version,andcopyright.
getServletName()-Methodininterfacejavax.servlet.ServletConfigReturnsthenameofthisservletinstance.
getServletName()-Methodinclassjavax.servlet.GenericServletReturnsthenameofthisservletinstance.
getServletNames()-Methodininterfacejavax.servlet.ServletContext
Deprecated.AsofJavaServletAPI2.1,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletnamesknowntothiscontext.Inthisversion,thismethodalwaysreturnsanemptyEnumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
getServletPath()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthepartofthisrequest'sURLthatcallstheservlet.
getServletPath()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetServletPath()onthewrappedrequestobject.
getServlets()-Methodininterfacejavax.servlet.ServletContextDeprecated.AsofJavaServletAPI2.0,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletsknowntothisservletcontext.Inthisversion,thismethodalwaysreturnsanemptyenumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
getSession()-Methodinclassjavax.servlet.http.HttpSessionEventReturnthesessionthatchanged.
getSession()-Methodinclassjavax.servlet.http.HttpSessionBindingEventReturnthesessionthatchanged.
getSession()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthecurrentsessionassociatedwiththisrequest,oriftherequestdoesnothaveasession,createsone.
getSession()-Methodinclassjavax.servlet.http.HttpServletRequestWrapperThedefaultbehaviorofthismethodistoreturngetSession()onthewrappedrequestobject.
getSession(boolean)-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsthecurrentHttpSessionassociatedwiththisrequestor,ififthereisnocurrentsessionandcreateistrue,returnsanewsession.
getSession(boolean)-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetSession(booleancreate)
onthewrappedrequestobject.getSession(String)-Methodininterfacejavax.servlet.http.HttpSessionContext
Deprecated.AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnnullandwillberemovedinafutureversionofthisAPI.
getSessionContext()-Methodininterfacejavax.servlet.http.HttpSessionDeprecated.AsofVersion2.1,thismethodisdeprecatedandhasnoreplacement.ItwillberemovedinafutureversionoftheJavaServletAPI.
getUnavailableSeconds()-Methodinclassjavax.servlet.UnavailableExceptionReturnsthenumberofsecondstheservletexpectstobetemporarilyunavailable.
getUserPrincipal()-Methodininterfacejavax.servlet.http.HttpServletRequestReturnsajava.security.Principalobjectcontainingthenameofthecurrentauthenticateduser.
getUserPrincipal()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturngetUserPrincipal()onthewrappedrequestobject.
getValue()-Methodinclassjavax.servlet.ServletContextAttributeEventReturnsthevalueoftheattributethathasbeenaddedremovedorreplaced.
getValue()-Methodinclassjavax.servlet.http.HttpSessionBindingEventReturnsthevalueoftheattributethathasbeenadded,removedorreplaced.
getValue()-Methodinclassjavax.servlet.http.CookieReturnsthevalueofthecookie.
getValue(String)-Methodininterfacejavax.servlet.http.HttpSessionDeprecated.AsofVersion2.2,thismethodisreplacedbyHttpSession.getAttribute(java.lang.String).
getValueNames()-Methodininterfacejavax.servlet.http.HttpSessionDeprecated.AsofVersion2.2,thismethodisreplacedbyHttpSession.getAttributeNames()
getVersion()-Methodinclassjavax.servlet.http.CookieReturnstheversionoftheprotocolthiscookiecomplieswith.
getWriter()-Methodininterfacejavax.servlet.ServletResponseReturnsaPrintWriterobjectthatcansendcharactertexttotheclient.
getWriter()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistoreturngetWriter()onthewrappedresponseobject.
H
HttpServlet-classjavax.servlet.http.HttpServlet.ProvidesanabstractclasstobesubclassedtocreateanHTTPservletsuitableforaWebsite.
HttpServlet()-Constructorforclassjavax.servlet.http.HttpServletDoesnothing,becausethisisanabstractclass.
HttpServletRequest-interfacejavax.servlet.http.HttpServletRequest.ExtendstheServletRequestinterfacetoproviderequestinformationforHTTPservlets.
HttpServletRequestWrapper-classjavax.servlet.http.HttpServletRequestWrapper.
ProvidesaconvenientimplementationoftheHttpServletRequestinterfacethatcanbesubclassedbydeveloperswishingtoadapttherequesttoaServlet.
HttpServletRequestWrapper(HttpServletRequest)-Constructorforclassjavax.servlet.http.HttpServletRequestWrapper
Constructsarequestobjectwrappingthegivenrequest.HttpServletResponse-interfacejavax.servlet.http.HttpServletResponse.
ExtendstheServletResponseinterfacetoprovideHTTP-specificfunctionalityinsendingaresponse.
HttpServletResponseWrapper-classjavax.servlet.http.HttpServletResponseWrapper.
ProvidesaconvenientimplementationoftheHttpServletResponseinterfacethatcanbesubclassedbydeveloperswishingtoadapttheresponsefromaServlet.
HttpServletResponseWrapper(HttpServletResponse)-Constructorforclassjavax.servlet.http.HttpServletResponseWrapper
Constructsaresponseadaptorwrappingthegivenresponse.HttpSession-interfacejavax.servlet.http.HttpSession.
ProvidesawaytoidentifyauseracrossmorethanonepagerequestorvisittoaWebsiteandtostoreinformationaboutthatuser.
HttpSessionActivationListener-interfacejavax.servlet.http.HttpSessionActivationListener.
Objectsthatareboundtoasessionmaylistentocontainereventsnotifyingthemthatsessionswillbepassivatedandthatsessionwillbeactivated.
HttpSessionAttributeListener-interface
javax.servlet.http.HttpSessionAttributeListener.Thislistenerinterfacecanbeimplementedinordertogetnotificationsofchangestotheattributelistsofsessionswithinthiswebapplication.
HttpSessionBindingEvent-classjavax.servlet.http.HttpSessionBindingEvent.EventsofthistypeareeithersenttoanobjectthatimplementsHttpSessionBindingListenerwhenitisboundorunboundfromasession,ortoaHttpSessionAttributeListenerthathasbeenconfiguredinthedeploymentdescriptorwhenanyattributeisbound,unboundorreplacedinasession.
HttpSessionBindingEvent(HttpSession,String)-Constructorforclassjavax.servlet.http.HttpSessionBindingEvent
Constructsaneventthatnotifiesanobjectthatithasbeenboundtoorunboundfromasession.
HttpSessionBindingEvent(HttpSession,String,Object)-Constructorforclassjavax.servlet.http.HttpSessionBindingEvent
Constructsaneventthatnotifiesanobjectthatithasbeenboundtoorunboundfromasession.
HttpSessionBindingListener-interfacejavax.servlet.http.HttpSessionBindingListener.
Causesanobjecttobenotifiedwhenitisboundtoorunboundfromasession.
HttpSessionContext-interfacejavax.servlet.http.HttpSessionContext.Deprecated.AsofJava(tm)ServletAPI2.1forsecurityreasons,withnoreplacement.ThisinterfacewillberemovedinafutureversionofthisAPI.
HttpSessionEvent-classjavax.servlet.http.HttpSessionEvent.Thisistheclassrepresentingeventnotificationsforchangestosessionswithinawebapplication.
HttpSessionEvent(HttpSession)-Constructorforclassjavax.servlet.http.HttpSessionEvent
Constructasessioneventfromthegivensource.HttpSessionListener-interfacejavax.servlet.http.HttpSessionListener.
Implementationsofthisinterfacemayarenotifiedofchangestothelistofactivesessionsinawebapplication.
HttpUtils-classjavax.servlet.http.HttpUtils.Deprecated.AsofJava(tm)ServletAPI2.3.Thesemethodswereonlyusefulwiththedefaultencodingandhavebeenmovedtotherequestinterfaces.
HttpUtils()-Constructorforclassjavax.servlet.http.HttpUtilsDeprecated.ConstructsanemptyHttpUtilsobject.
I
include(ServletRequest,ServletResponse)-Methodininterfacejavax.servlet.RequestDispatcher
Includesthecontentofaresource(servlet,JSPpage,HTMLfile)intheresponse.
init()-Methodinclassjavax.servlet.GenericServletAconveniencemethodwhichcanbeoverriddensothatthere'snoneedtocallsuper.init(config).
init(FilterConfig)-Methodininterfacejavax.servlet.FilterCalledbythewebcontainertoindicatetoafilterthatitisbeingplacedintoservice.
init(ServletConfig)-Methodininterfacejavax.servlet.ServletCalledbytheservletcontainertoindicatetoaservletthattheservletisbeingplacedintoservice.
init(ServletConfig)-Methodinclassjavax.servlet.GenericServletCalledbytheservletcontainertoindicatetoaservletthattheservletisbeingplacedintoservice.
invalidate()-Methodininterfacejavax.servlet.http.HttpSessionInvalidatesthissessionthenunbindsanyobjectsboundtoit.
isCommitted()-Methodininterfacejavax.servlet.ServletResponseReturnsabooleanindicatingiftheresponsehasbeencommitted.
isCommitted()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistoreturnisCommitted()onthewrappedresponseobject.
isNew()-Methodininterfacejavax.servlet.http.HttpSessionReturnstrueiftheclientdoesnotyetknowaboutthesessionoriftheclientchoosesnottojointhesession.
isPermanent()-Methodinclassjavax.servlet.UnavailableExceptionReturnsabooleanindicatingwhethertheservletispermanentlyunavailable.
isRequestedSessionIdFromCookie()-Methodininterfacejavax.servlet.http.HttpServletRequest
CheckswhethertherequestedsessionIDcameinasacookie.isRequestedSessionIdFromCookie()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
Thedefaultbehaviorofthismethodistoreturn
isRequestedSessionIdFromCookie()onthewrappedrequestobject.isRequestedSessionIdFromUrl()-Methodininterfacejavax.servlet.http.HttpServletRequest
Deprecated.AsofVersion2.1oftheJavaServletAPI,useHttpServletRequest.isRequestedSessionIdFromURL()instead.
isRequestedSessionIdFromUrl()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromUrl()onthewrappedrequestobject.
isRequestedSessionIdFromURL()-Methodininterfacejavax.servlet.http.HttpServletRequest
CheckswhethertherequestedsessionIDcameinaspartoftherequestURL.
isRequestedSessionIdFromURL()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromURL()onthewrappedrequestobject.
isRequestedSessionIdValid()-Methodininterfacejavax.servlet.http.HttpServletRequest
CheckswhethertherequestedsessionIDisstillvalid.isRequestedSessionIdValid()-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdValid()onthewrappedrequestobject.
isSecure()-Methodinclassjavax.servlet.ServletRequestWrapperThedefaultbehaviorofthismethodistoreturnisSecure()onthewrappedrequestobject.
isSecure()-Methodininterfacejavax.servlet.ServletRequestReturnsabooleanindicatingwhetherthisrequestwasmadeusingasecurechannel,suchasHTTPS.
isUserInRole(String)-Methodininterfacejavax.servlet.http.HttpServletRequest
Returnsabooleanindicatingwhethertheauthenticateduserisincludedinthespecifiedlogical"role".
isUserInRole(String)-Methodinclassjavax.servlet.http.HttpServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturnisUserInRole(Stringrole)onthewrappedrequestobject.
J
javax.servlet-packagejavax.servlet
javax.servlet.http-packagejavax.servlet.http
L
log(Exception,String)-Methodininterfacejavax.servlet.ServletContextDeprecated.AsofJavaServletAPI2.1,useServletContext.log(Stringmessage,Throwablethrowable)instead.
Thismethodwasoriginallydefinedtowriteanexception'sstacktraceandanexplanatoryerrormessagetotheservletlogfile.
log(String)-Methodininterfacejavax.servlet.ServletContextWritesthespecifiedmessagetoaservletlogfile,usuallyaneventlog.
log(String)-Methodinclassjavax.servlet.GenericServletWritesthespecifiedmessagetoaservletlogfile,prependedbytheservlet'sname.
log(String,Throwable)-Methodininterfacejavax.servlet.ServletContextWritesanexplanatorymessageandastacktraceforagivenThrowableexceptiontotheservletlogfile.
log(String,Throwable)-Methodinclassjavax.servlet.GenericServletWritesanexplanatorymessageandastacktraceforagivenThrowableexceptiontotheservletlogfile,prependedbytheservlet'sname.
P
parsePostData(int,ServletInputStream)-Staticmethodinclassjavax.servlet.http.HttpUtils
Deprecated.ParsesdatafromanHTMLformthattheclientsendstotheserverusingtheHTTPPOSTmethodandtheapplication/x-www-form-urlencodedMIMEtype.
parseQueryString(String)-Staticmethodinclassjavax.servlet.http.HttpUtilsDeprecated.ParsesaquerystringpassedfromtheclienttotheserverandbuildsaHashTableobjectwithkey-valuepairs.
print(boolean)-Methodinclassjavax.servlet.ServletOutputStreamWritesabooleanvaluetotheclient,withnocarriagereturn-linefeed(CRLF)characterattheend.
print(char)-Methodinclassjavax.servlet.ServletOutputStreamWritesacharactertotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
print(double)-Methodinclassjavax.servlet.ServletOutputStreamWritesadoublevaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
print(float)-Methodinclassjavax.servlet.ServletOutputStreamWritesafloatvaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
print(int)-Methodinclassjavax.servlet.ServletOutputStreamWritesaninttotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
print(long)-Methodinclassjavax.servlet.ServletOutputStreamWritesalongvaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
print(String)-Methodinclassjavax.servlet.ServletOutputStreamWritesaStringtotheclient,withoutacarriagereturn-linefeed(CRLF)characterattheend.
println()-Methodinclassjavax.servlet.ServletOutputStreamWritesacarriagereturn-linefeed(CRLF)totheclient.
println(boolean)-Methodinclassjavax.servlet.ServletOutputStreamWritesabooleanvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
println(char)-Methodinclassjavax.servlet.ServletOutputStream
Writesacharactertotheclient,followedbyacarriagereturn-linefeed(CRLF).
println(double)-Methodinclassjavax.servlet.ServletOutputStreamWritesadoublevaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
println(float)-Methodinclassjavax.servlet.ServletOutputStreamWritesafloatvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
println(int)-Methodinclassjavax.servlet.ServletOutputStreamWritesaninttotheclient,followedbyacarriagereturn-linefeed(CRLF)character.
println(long)-Methodinclassjavax.servlet.ServletOutputStreamWritesalongvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
println(String)-Methodinclassjavax.servlet.ServletOutputStreamWritesaStringtotheclient,followedbyacarriagereturn-linefeed(CRLF).
putValue(String,Object)-Methodininterfacejavax.servlet.http.HttpSessionDeprecated.AsofVersion2.2,thismethodisreplacedbyHttpSession.setAttribute(java.lang.String,java.lang.Object)
R
readLine(byte[],int,int)-Methodinclassjavax.servlet.ServletInputStreamReadstheinputstream,onelineatatime.
removeAttribute(String)-Methodininterfacejavax.servlet.ServletContextRemovestheattributewiththegivennamefromtheservletcontext.
removeAttribute(String)-Methodinclassjavax.servlet.ServletRequestWrapper
ThedefaultbehaviorofthismethodistocallremoveAttribute(Stringname)onthewrappedrequestobject.
removeAttribute(String)-Methodininterfacejavax.servlet.ServletRequestRemovesanattributefromthisrequest.
removeAttribute(String)-Methodininterfacejavax.servlet.http.HttpSessionRemovestheobjectboundwiththespecifiednamefromthissession.
removeValue(String)-Methodininterfacejavax.servlet.http.HttpSessionDeprecated.AsofVersion2.2,thismethodisreplacedbyHttpSession.removeAttribute(java.lang.String)
RequestDispatcher-interfacejavax.servlet.RequestDispatcher.Definesanobjectthatreceivesrequestsfromtheclientandsendsthemtoanyresource(suchasaservlet,HTMLfile,orJSPfile)ontheserver.
reset()-Methodininterfacejavax.servlet.ServletResponseClearsanydatathatexistsinthebufferaswellasthestatuscodeandheaders.
reset()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistocallreset()onthewrappedresponseobject.
resetBuffer()-Methodininterfacejavax.servlet.ServletResponseClearsthecontentoftheunderlyingbufferintheresponsewithoutclearingheadersorstatuscode.
resetBuffer()-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistocallresetBuffer()onthewrappedresponseobject.
S
SC_ACCEPTED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(202)indicatingthatarequestwasacceptedforprocessing,butwasnotcompleted.
SC_BAD_GATEWAY-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(502)indicatingthattheHTTPserverreceivedaninvalidresponsefromaserveritconsultedwhenactingasaproxyorgateway.
SC_BAD_REQUEST-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(400)indicatingtherequestsentbytheclientwassyntacticallyincorrect.
SC_CONFLICT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(409)indicatingthattherequestcouldnotbecompletedduetoaconflictwiththecurrentstateoftheresource.
SC_CONTINUE-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(100)indicatingtheclientcancontinue.SC_CREATED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(201)indicatingtherequestsucceededandcreatedanewresourceontheserver.
SC_EXPECTATION_FAILED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(417)indicatingthattheservercouldnotmeettheexpectationgivenintheExpectrequestheader.
SC_FORBIDDEN-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(403)indicatingtheserverunderstoodtherequestbutrefusedtofulfillit.
SC_GATEWAY_TIMEOUT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(504)indicatingthattheserverdidnotreceiveatimelyresponsefromtheupstreamserverwhileactingasagatewayorproxy.
SC_GONE-Staticvariableininterfacejavax.servlet.http.HttpServletResponseStatuscode(410)indicatingthattheresourceisnolongeravailableattheserverandnoforwardingaddressisknown.
SC_HTTP_VERSION_NOT_SUPPORTED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(505)indicatingthattheserverdoesnotsupportorrefusestosupporttheHTTPprotocolversionthatwasusedintherequestmessage.
SC_INTERNAL_SERVER_ERROR-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(500)indicatinganerrorinsidetheHTTPserverwhichpreventeditfromfulfillingtherequest.
SC_LENGTH_REQUIRED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(411)indicatingthattherequestcannotbehandledwithoutadefinedContent-Length.
SC_METHOD_NOT_ALLOWED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(405)indicatingthatthemethodspecifiedintheRequest-LineisnotallowedfortheresourceidentifiedbytheRequest-URI.
SC_MOVED_PERMANENTLY-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(301)indicatingthattheresourcehaspermanentlymovedtoanewlocation,andthatfuturereferencesshoulduseanewURIwiththeirrequests.
SC_MOVED_TEMPORARILY-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(302)indicatingthattheresourcehastemporarilymovedtoanotherlocation,butthatfuturereferencesshouldstillusetheoriginalURItoaccesstheresource.
SC_MULTIPLE_CHOICES-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(300)indicatingthattherequestedresourcecorrespondstoanyoneofasetofrepresentations,eachwithitsownspecificlocation.
SC_NO_CONTENT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(204)indicatingthattherequestsucceededbutthattherewasnonewinformationtoreturn.
SC_NON_AUTHORITATIVE_INFORMATION-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(203)indicatingthatthemetainformationpresentedbytheclientdidnotoriginatefromtheserver.
SC_NOT_ACCEPTABLE-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(406)indicatingthattheresourceidentifiedbytherequestisonlycapableofgeneratingresponseentitieswhichhavecontentcharacteristicsnotacceptableaccordingtotheacceptheaderssentintherequest.
SC_NOT_FOUND-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(404)indicatingthattherequestedresourceisnotavailable.SC_NOT_IMPLEMENTED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(501)indicatingtheHTTPserverdoesnotsupportthefunctionalityneededtofulfilltherequest.
SC_NOT_MODIFIED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(304)indicatingthataconditionalGEToperationfoundthattheresourcewasavailableandnotmodified.
SC_OK-Staticvariableininterfacejavax.servlet.http.HttpServletResponseStatuscode(200)indicatingtherequestsucceedednormally.
SC_PARTIAL_CONTENT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(206)indicatingthattheserverhasfulfilledthepartialGETrequestfortheresource.
SC_PAYMENT_REQUIRED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(402)reservedforfutureuse.SC_PRECONDITION_FAILED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(412)indicatingthatthepreconditiongiveninoneormoreoftherequest-headerfieldsevaluatedtofalsewhenitwastestedontheserver.
SC_PROXY_AUTHENTICATION_REQUIRED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(407)indicatingthattheclientMUSTfirstauthenticateitselfwiththeproxy.
SC_REQUEST_ENTITY_TOO_LARGE-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(413)indicatingthattheserverisrefusingtoprocesstherequest
becausetherequestentityislargerthantheserveriswillingorabletoprocess.
SC_REQUEST_TIMEOUT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(408)indicatingthattheclientdidnotproducearequestwithinthetimethattheserverwaspreparedtowait.
SC_REQUEST_URI_TOO_LONG-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(414)indicatingthattheserverisrefusingtoservicetherequestbecausetheRequest-URIislongerthantheserveriswillingtointerpret.
SC_REQUESTED_RANGE_NOT_SATISFIABLE-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(416)indicatingthattheservercannotservetherequestedbyterange.
SC_RESET_CONTENT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(205)indicatingthattheagentSHOULDresetthedocumentviewwhichcausedtherequesttobesent.
SC_SEE_OTHER-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(303)indicatingthattheresponsetotherequestcanbefoundunderadifferentURI.
SC_SERVICE_UNAVAILABLE-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(503)indicatingthattheHTTPserveristemporarilyoverloaded,andunabletohandletherequest.
SC_SWITCHING_PROTOCOLS-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(101)indicatingtheserverisswitchingprotocolsaccordingtoUpgradeheader.
SC_TEMPORARY_REDIRECT-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(307)indicatingthattherequestedresourceresidestemporarilyunderadifferentURI.
SC_UNAUTHORIZED-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(401)indicatingthattherequestrequiresHTTPauthentication.SC_UNSUPPORTED_MEDIA_TYPE-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(415)indicatingthattheserverisrefusingtoservicetherequestbecausetheentityoftherequestisinaformatnotsupportedbytherequestedresourcefortherequestedmethod.
SC_USE_PROXY-Staticvariableininterfacejavax.servlet.http.HttpServletResponse
Statuscode(305)indicatingthattherequestedresourceMUSTbeaccessedthroughtheproxygivenbytheLocationfield.
sendError(int)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsendError(intsc)onthewrappedresponseobject.
sendError(int)-Methodininterfacejavax.servlet.http.HttpServletResponseSendsanerrorresponsetotheclientusingthespecifiedstatuscodeandclearingthebuffer.
sendError(int,String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsendError(intsc,Stringmsg)onthewrappedresponseobject.
sendError(int,String)-Methodininterfacejavax.servlet.http.HttpServletResponse
Sendsanerrorresponsetotheclientusingthespecifiedstatusclearingthebuffer.
sendRedirect(String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistoreturnsendRedirect(Stringlocation)onthewrappedresponseobject.
sendRedirect(String)-Methodininterfacejavax.servlet.http.HttpServletResponse
SendsatemporaryredirectresponsetotheclientusingthespecifiedredirectlocationURL.
service(HttpServletRequest,HttpServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
ReceivesstandardHTTPrequestsfromthepublicservicemethodanddispatchesthemtothedoXXXmethodsdefinedinthisclass.
service(ServletRequest,ServletResponse)-Methodininterfacejavax.servlet.Servlet
Calledbytheservletcontainertoallowtheservlettorespondtoarequest.service(ServletRequest,ServletResponse)-Methodinclassjavax.servlet.GenericServlet
Calledbytheservletcontainertoallowtheservlettorespondtoarequest.service(ServletRequest,ServletResponse)-Methodinclassjavax.servlet.http.HttpServlet
Dispatchesclientrequeststotheprotectedservicemethod.Servlet-interfacejavax.servlet.Servlet.
Definesmethodsthatallservletsmustimplement.ServletConfig-interfacejavax.servlet.ServletConfig.
Aservletconfigurationobjectusedbyaservletcontainerusedtopassinformationtoaservletduringinitialization.
ServletContext-interfacejavax.servlet.ServletContext.Definesasetofmethodsthataservletusestocommunicatewithitsservletcontainer,forexample,togettheMIMEtypeofafile,dispatchrequests,orwritetoalogfile.
ServletContextAttributeEvent-classjavax.servlet.ServletContextAttributeEvent.
Thisistheeventclassfornotificationsaboutchangestotheattributesoftheservletcontextofawebapplication.
ServletContextAttributeEvent(ServletContext,String,Object)-Constructorforclassjavax.servlet.ServletContextAttributeEvent
ConstructaServletContextAttributeEventfromthegivencontextforthegivenattributenameandattributevalue.
ServletContextAttributeListener-interfacejavax.servlet.ServletContextAttributeListener.
Implementationsofthisinterfacerecievenotificationsofchangestotheattributelistontheservletcontextofawebapplication.
ServletContextEvent-classjavax.servlet.ServletContextEvent.Thisistheeventclassfornotificationsaboutchangestotheservletcontextofawebapplication.
ServletContextEvent(ServletContext)-Constructorforclassjavax.servlet.ServletContextEvent
ConstructaServletContextEventfromthegivencontext.ServletContextListener-interfacejavax.servlet.ServletContextListener.
Implementationsofthisinterfacerecievenotificationsaboutchangestotheservletcontextofthewebapplicationtheyarepartof.
ServletException-exceptionjavax.servlet.ServletException.Definesageneralexceptionaservletcanthrowwhenitencountersdifficulty.
ServletException()-Constructorforclassjavax.servlet.ServletExceptionConstructsanewservletexception.
ServletException(String)-Constructorforclassjavax.servlet.ServletExceptionConstructsanewservletexceptionwiththespecifiedmessage.
ServletException(String,Throwable)-Constructorforclassjavax.servlet.ServletException
Constructsanewservletexceptionwhentheservletneedstothrowanexceptionandincludeamessageaboutthe"rootcause"exceptionthatinterferedwithitsnormaloperation,includingadescriptionmessage.
ServletException(Throwable)-Constructorforclassjavax.servlet.ServletException
Constructsanewservletexceptionwhentheservletneedstothrowanexceptionandincludeamessageaboutthe"rootcause"exceptionthatinterferedwithitsnormaloperation.
ServletInputStream-classjavax.servlet.ServletInputStream.Providesaninputstreamforreadingbinarydatafromaclientrequest,includinganefficientreadLinemethodforreadingdataonelineatatime.
ServletInputStream()-Constructorforclassjavax.servlet.ServletInputStreamDoesnothing,becausethisisanabstractclass.
ServletOutputStream-classjavax.servlet.ServletOutputStream.Providesanoutputstreamforsendingbinarydatatotheclient.
ServletOutputStream()-Constructorforclassjavax.servlet.ServletOutputStream
Doesnothing,becausethisisanabstractclass.ServletRequest-interfacejavax.servlet.ServletRequest.
Definesanobjecttoprovideclientrequestinformationtoaservlet.ServletRequestWrapper-classjavax.servlet.ServletRequestWrapper.
ProvidesaconvenientimplementationoftheServletRequestinterfacethatcanbesubclassedbydeveloperswishingtoadapttherequesttoaServlet.
ServletRequestWrapper(ServletRequest)-Constructorforclassjavax.servlet.ServletRequestWrapper
CreatesaServletRequestadaptorwrappingthegivenrequestobject.ServletResponse-interfacejavax.servlet.ServletResponse.
Definesanobjecttoassistaservletinsendingaresponsetotheclient.ServletResponseWrapper-classjavax.servlet.ServletResponseWrapper.
ProvidesaconvenientimplementationoftheServletResponseinterfacethatcanbesubclassedbydeveloperswishingtoadapttheresponsefromaServlet.
ServletResponseWrapper(ServletResponse)-Constructorforclassjavax.servlet.ServletResponseWrapper
CreatesaServletResponseadaptorwrappingthegivenresponseobject.
sessionCreated(HttpSessionEvent)-Methodininterfacejavax.servlet.http.HttpSessionListener
Notificationthatasessionwascreated.sessionDestroyed(HttpSessionEvent)-Methodininterfacejavax.servlet.http.HttpSessionListener
Notificationthatasessionwasinvalidated.sessionDidActivate(HttpSessionEvent)-Methodininterfacejavax.servlet.http.HttpSessionActivationListener
Notificationthatthesessionhasjustbeenactivated.sessionWillPassivate(HttpSessionEvent)-Methodininterfacejavax.servlet.http.HttpSessionActivationListener
Notificationthatthesessionisabouttobepassivated.setAttribute(String,Object)-Methodininterfacejavax.servlet.ServletContext
Bindsanobjecttoagivenattributenameinthisservletcontext.setAttribute(String,Object)-Methodinclassjavax.servlet.ServletRequestWrapper
ThedefaultbehaviorofthismethodistoreturnsetAttribute(Stringname,Objecto)onthewrappedrequestobject.
setAttribute(String,Object)-Methodininterfacejavax.servlet.ServletRequestStoresanattributeinthisrequest.
setAttribute(String,Object)-Methodininterfacejavax.servlet.http.HttpSession
Bindsanobjecttothissession,usingthenamespecified.setBufferSize(int)-Methodininterfacejavax.servlet.ServletResponse
Setsthepreferredbuffersizeforthebodyoftheresponse.setBufferSize(int)-Methodinclassjavax.servlet.ServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsetBufferSize(intsize)onthewrappedresponseobject.
setCharacterEncoding(String)-Methodinclassjavax.servlet.ServletRequestWrapper
Thedefaultbehaviorofthismethodistosetthecharacterencodingonthewrappedrequestobject.
setCharacterEncoding(String)-Methodininterfacejavax.servlet.ServletRequest
Overridesthenameofthecharacterencodingusedinthebodyofthisrequest.
setComment(String)-Methodinclassjavax.servlet.http.CookieSpecifiesacommentthatdescribesacookie'spurpose.
setContentLength(int)-Methodininterfacejavax.servlet.ServletResponse
SetsthelengthofthecontentbodyintheresponseInHTTPservlets,thismethodsetstheHTTPContent-Lengthheader.
setContentLength(int)-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistocallsetContentLength(intlen)onthewrappedresponseobject.
setContentType(String)-Methodininterfacejavax.servlet.ServletResponseSetsthecontenttypeoftheresponsebeingsenttotheclient.
setContentType(String)-Methodinclassjavax.servlet.ServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsetContentType(Stringtype)onthewrappedresponseobject.
setDateHeader(String,long)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsetDateHeader(Stringname,longdate)onthewrappedresponseobject.
setDateHeader(String,long)-Methodininterfacejavax.servlet.http.HttpServletResponse
Setsaresponseheaderwiththegivennameanddate-value.setDomain(String)-Methodinclassjavax.servlet.http.Cookie
Specifiesthedomainwithinwhichthiscookieshouldbepresented.setHeader(String,String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistoreturnsetHeader(Stringname,Stringvalue)onthewrappedresponseobject.
setHeader(String,String)-Methodininterfacejavax.servlet.http.HttpServletResponse
Setsaresponseheaderwiththegivennameandvalue.setIntHeader(String,int)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsetIntHeader(Stringname,intvalue)onthewrappedresponseobject.
setIntHeader(String,int)-Methodininterfacejavax.servlet.http.HttpServletResponse
Setsaresponseheaderwiththegivennameandintegervalue.setLocale(Locale)-Methodininterfacejavax.servlet.ServletResponse
Setsthelocaleoftheresponse,settingtheheaders(includingtheContent-Type'scharset)asappropriate.
setLocale(Locale)-Methodinclassjavax.servlet.ServletResponseWrapperThedefaultbehaviorofthismethodistocallsetLocale(Localeloc)onthe
wrappedresponseobject.setMaxAge(int)-Methodinclassjavax.servlet.http.Cookie
Setsthemaximumageofthecookieinseconds.setMaxInactiveInterval(int)-Methodininterfacejavax.servlet.http.HttpSession
Specifiesthetime,inseconds,betweenclientrequestsbeforetheservletcontainerwillinvalidatethissession.
setPath(String)-Methodinclassjavax.servlet.http.CookieSpecifiesapathforthecookietowhichtheclientshouldreturnthecookie.
setRequest(ServletRequest)-Methodinclassjavax.servlet.ServletRequestWrapper
Setstherequestobjectbeingwrapped.setResponse(ServletResponse)-Methodinclassjavax.servlet.ServletResponseWrapper
Setstheresponsebeingwrapped.setSecure(boolean)-Methodinclassjavax.servlet.http.Cookie
Indicatestothebrowserwhetherthecookieshouldonlybesentusingasecureprotocol,suchasHTTPSorSSL.
setStatus(int)-Methodinclassjavax.servlet.http.HttpServletResponseWrapperThedefaultbehaviorofthismethodistocallsetStatus(intsc)onthewrappedresponseobject.
setStatus(int)-Methodininterfacejavax.servlet.http.HttpServletResponseSetsthestatuscodeforthisresponse.
setStatus(int,String)-Methodinclassjavax.servlet.http.HttpServletResponseWrapper
ThedefaultbehaviorofthismethodistocallsetStatus(intsc,Stringsm)onthewrappedresponseobject.
setStatus(int,String)-Methodininterfacejavax.servlet.http.HttpServletResponse
Deprecated.Asofversion2.1,duetoambiguousmeaningofthemessageparameter.TosetastatuscodeusesetStatus(int),tosendanerrorwithadescriptionusesendError(int,String).Setsthestatuscodeandmessageforthisresponse.
setValue(String)-Methodinclassjavax.servlet.http.CookieAssignsanewvaluetoacookieafterthecookieiscreated.
setVersion(int)-Methodinclassjavax.servlet.http.CookieSetstheversionofthecookieprotocolthiscookiecomplieswith.
SingleThreadModel-interfacejavax.servlet.SingleThreadModel.Ensuresthatservletshandleonlyonerequestatatime.
U
UnavailableException-exceptionjavax.servlet.UnavailableException.Definesanexceptionthataservletorfilterthrowstoindicatethatitispermanentlyortemporarilyunavailable.
UnavailableException(int,Servlet,String)-Constructorforclassjavax.servlet.UnavailableException
Deprecated.AsofJavaServletAPI2.2,useUnavailableException.UnavailableException(String,int)instead.
UnavailableException(Servlet,String)-Constructorforclassjavax.servlet.UnavailableException
Deprecated.AsofJavaServletAPI2.2,useUnavailableException.UnavailableException(String)instead.
UnavailableException(String)-Constructorforclassjavax.servlet.UnavailableException
Constructsanewexceptionwithadescriptivemessageindicatingthattheservletispermanentlyunavailable.
UnavailableException(String,int)-Constructorforclassjavax.servlet.UnavailableException
Constructsanewexceptionwithadescriptivemessageindicatingthattheservletistemporarilyunavailableandgivinganestimateofhowlongitwillbeunavailable.
V
valueBound(HttpSessionBindingEvent)-Methodininterfacejavax.servlet.http.HttpSessionBindingListener
Notifiestheobjectthatitisbeingboundtoasessionandidentifiesthesession.
valueUnbound(HttpSessionBindingEvent)-Methodininterfacejavax.servlet.http.HttpSessionBindingListener
Notifiestheobjectthatitisbeingunboundfromasessionandidentifiesthesession.
ABCDEFGHIJLPRSUVOverview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
DeprecatedAPI
DeprecatedClassesjavax.servlet.http.HttpUtilsAsofJava(tm)ServletAPI2.3.Thesemethodswereonlyusefulwiththedefaultencodingandhavebeenmovedtotherequestinterfaces.
DeprecatedInterfacesjavax.servlet.http.HttpSessionContextAsofJava(tm)ServletAPI2.1forsecurityreasons,withnoreplacement.ThisinterfacewillberemovedinafutureversionofthisAPI.
DeprecatedMethodsjavax.servlet.http.HttpServletResponse.encodeRedirectUrl(String)Asofversion2.1,useencodeRedirectURL(Stringurl)insteadjavax.servlet.http.HttpServletResponse.encodeUrl(String)Asofversion2.1,useencodeURL(Stringurl)insteadjavax.servlet.http.HttpSessionContext.getIds()AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnanemptyEnumerationandwillberemovedinafutureversionofthisAPI.javax.servlet.ServletRequest.getRealPath(String)AsofVersion2.1oftheJavaServletAPI,useServletContext.getRealPath(java.lang.String)instead.javax.servlet.UnavailableException.getServlet()AsofJavaServletAPI2.2,withnoreplacement.Returnstheservletthatisreportingitsunavailability.javax.servlet.ServletContext.getServlet(String)AsofJavaServletAPI2.1,withnodirectreplacement.
ThismethodwasoriginallydefinedtoretrieveaservletfromaServletContext.Inthisversion,thismethodalwaysreturnsnullandremains
onlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
Inlieuofthismethod,servletscanshareinformationusingtheServletContextclassandcanperformsharedbusinesslogicbyinvokingmethodsoncommonnon-servletclasses.
javax.servlet.ServletContext.getServletNames()AsofJavaServletAPI2.1,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletnamesknowntothiscontext.Inthisversion,thismethodalwaysreturnsanemptyEnumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
javax.servlet.ServletContext.getServlets()AsofJavaServletAPI2.0,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletsknowntothisservletcontext.Inthisversion,thismethodalwaysreturnsanemptyenumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
javax.servlet.http.HttpSessionContext.getSession(String)AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnnullandwillberemovedinafutureversionofthisAPI.javax.servlet.http.HttpSession.getSessionContext()AsofVersion2.1,thismethodisdeprecatedandhasnoreplacement.ItwillberemovedinafutureversionoftheJavaServletAPI.javax.servlet.http.HttpSession.getValue(String)AsofVersion2.2,thismethodisreplacedbyHttpSession.getAttribute(java.lang.String).javax.servlet.http.HttpSession.getValueNames()AsofVersion2.2,thismethodisreplacedbyHttpSession.getAttributeNames()javax.servlet.http.HttpServletRequest.isRequestedSessionIdFromUrl()
AsofVersion2.1oftheJavaServletAPI,useHttpServletRequest.isRequestedSessionIdFromURL()instead.
javax.servlet.ServletContext.log(Exception,String)AsofJavaServletAPI2.1,useServletContext.log(Stringmessage,Throwablethrowable)instead.
Thismethodwasoriginallydefinedtowriteanexception'sstacktraceandanexplanatoryerrormessagetotheservletlogfile.
javax.servlet.http.HttpSession.putValue(String,Object)AsofVersion2.2,thismethodisreplacedbyHttpSession.setAttribute(java.lang.String,java.lang.Object)javax.servlet.http.HttpSession.removeValue(String)AsofVersion2.2,thismethodisreplacedbyHttpSession.removeAttribute(java.lang.String)javax.servlet.http.HttpServletResponse.setStatus(int,String)Asofversion2.1,duetoambiguousmeaningofthemessageparameter.TosetastatuscodeusesetStatus(int),tosendanerrorwithadescriptionusesendError(int,String).Setsthestatuscodeandmessageforthisresponse.
DeprecatedConstructorsjavax.servlet.UnavailableException(int,Servlet,String)AsofJavaServletAPI2.2,useUnavailableException.UnavailableException(String,int)instead.javax.servlet.UnavailableException(Servlet,String)AsofJavaServletAPI2.2,useUnavailableException.UnavailableException(String)instead.
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Packagesjavax.servlet javax.servlet.http
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
HierarchyForPackagejavax.servlet
PackageHierarchies:AllPackages
ClassHierarchy
classjava.lang.Objectclassjava.util.EventObject(implementsjava.io.Serializable)
classjavax.servlet.ServletContextEventclassjavax.servlet.ServletContextAttributeEvent
classjavax.servlet.GenericServlet(implementsjava.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig)classjava.io.InputStream
classjavax.servlet.ServletInputStreamclassjava.io.OutputStream
classjavax.servlet.ServletOutputStreamclassjavax.servlet.ServletRequestWrapper(implementsjavax.servlet.ServletRequest)classjavax.servlet.ServletResponseWrapper(implementsjavax.servlet.ServletResponse)classjava.lang.Throwable(implementsjava.io.Serializable)
classjava.lang.Exceptionclassjavax.servlet.ServletException
classjavax.servlet.UnavailableException
InterfaceHierarchy
interfacejava.util.EventListenerinterfacejavax.servlet.ServletContextAttributeListenerinterfacejavax.servlet.ServletContextListener
interfacejavax.servlet.Filterinterfacejavax.servlet.FilterChaininterfacejavax.servlet.FilterConfiginterfacejavax.servlet.RequestDispatcherinterfacejavax.servlet.Servletinterfacejavax.servlet.ServletConfiginterfacejavax.servlet.ServletContextinterfacejavax.servlet.ServletRequestinterfacejavax.servlet.ServletResponseinterfacejavax.servlet.SingleThreadModel
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVPACKAGENEXTPACKAGE FRAMESNOFRAMES
Packagejavax.servlet
InterfaceSummary
Filter
Afilterisanobjectthanperformfilteringtasksoneithertherequesttoaresource(aservletorstaticcontent),orontheresponsefromaresource,orboth.
FiltersperformfilteringinthedoFiltermethod.
FilterChain
AFilterChainisanobjectprovidedbytheservletcontainertothedevelopergivingaviewintotheinvocationchainofafilteredrequestforaresource.
FilterConfigAfilterconfigurationobjectusedbyaservletcontainerusedtopassinformationtoafilterduringinitialization.
RequestDispatcher
Definesanobjectthatreceivesrequestsfromtheclientandsendsthemtoanyresource(suchasaservlet,HTMLfile,orJSPfile)ontheserver.
Servlet Definesmethodsthatallservletsmustimplement.
ServletConfigAservletconfigurationobjectusedbyaservletcontainerusedtopassinformationtoaservletduringinitialization.
ServletContext
Definesasetofmethodsthataservletusestocommunicatewithitsservletcontainer,forexample,togettheMIMEtypeofafile,dispatchrequests,orwritetoalogfile.
ServletContextAttributeListenerImplementationsofthisinterfacerecievenotificationsofchangestotheattributelistontheservletcontextofawebapplication.Implementationsofthisinterfacerecieve
ServletContextListener notificationsaboutchangestotheservletcontextofthewebapplicationtheyarepartof.
ServletRequest Definesanobjecttoprovideclientrequestinformationtoaservlet.
ServletResponse Definesanobjecttoassistaservletinsendingaresponsetotheclient.
SingleThreadModel Ensuresthatservletshandleonlyonerequestatatime.
ClassSummaryGenericServlet Definesageneric,protocol-independent
servlet.
ServletContextAttributeEventThisistheeventclassfornotificationsaboutchangestotheattributesoftheservletcontextofawebapplication.
ServletContextEventThisistheeventclassfornotificationsaboutchangestotheservletcontextofawebapplication.
ServletInputStream
Providesaninputstreamforreadingbinarydatafromaclientrequest,includinganefficientreadLinemethodforreadingdataonelineatatime.
ServletOutputStream Providesanoutputstreamforsendingbinarydatatotheclient.
ServletRequestWrapper
ProvidesaconvenientimplementationoftheServletRequestinterfacethatcanbesubclassedbydeveloperswishingtoadapttherequesttoaServlet.
ServletResponseWrapper
ProvidesaconvenientimplementationoftheServletResponseinterfacethatcanbesubclassedbydeveloperswishingtoadapttheresponsefromaServlet.
ExceptionSummaryServletException Definesageneralexceptionaservletcanthrowwhenit
encountersdifficulty.
UnavailableExceptionDefinesanexceptionthataservletorfilterthrowstoindicatethatitispermanentlyortemporarilyunavailable.
Overview Package Class Tree Deprecated IndexHelpPREVPACKAGENEXTPACKAGE FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceSingleThreadModel
publicabstractinterfaceSingleThreadModel
Ensuresthatservletshandleonlyonerequestatatime.Thisinterfacehasnomethods.
Ifaservletimplementsthisinterface,youareguaranteedthatnotwothreadswillexecuteconcurrentlyintheservlet'sservicemethod.Theservletcontainercanmakethisguaranteebysynchronizingaccesstoasingleinstanceoftheservlet,orbymaintainingapoolofservletinstancesanddispatchingeachnewrequesttoafreeservlet.
Thisinterfacedoesnotpreventsynchronizationproblemsthatresultfromservletsaccessingsharedresourcessuchasstaticclassvariablesorclassesoutsidethescopeoftheservlet.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceFilter
publicabstractinterfaceFilter
Afilterisanobjectthanperformfilteringtasksoneithertherequesttoaresource(aservletorstaticcontent),orontheresponsefromaresource,orboth.
FiltersperformfilteringinthedoFiltermethod.EveryFilterhasaccesstoaFilterConfigobjectfromwhichitcanobtainitsinitializationparameters,areferencetotheServletContextwhichitcanuse,forexample,toloadresourcesneededforfilteringtasks.
Filtersareconfiguredinthedeploymentdescriptorofawebapplication
Examplesthathavebeenidentifiedforthisdesignare1)AuthenticationFilters2)LoggingandAuditingFilters3)ImageconversionFilters4)DatacompressionFilters5)EncryptionFilters6)TokenizingFilters7)Filtersthattriggerresourceaccessevents8)XSL/Tfilters9)Mime-typechainFilter
Since:Servlet2.3
MethodSummary
void
destroy()Calledbythewebcontainertoindicatetoafilterthatitisbeingtakenoutofservice.
void
doFilter(ServletRequestrequest,ServletResponseresponse,
FilterChainchain)ThedoFiltermethodoftheFilteriscalledbythecontainereach
timearequest/responsepairispassedthroughthechainduetoaclientrequestforaresourceattheendofthechain.
void
init(FilterConfigfilterConfig)Calledbythewebcontainertoindicatetoafilterthatitisbeingplacedintoservice.
MethodDetail
init
publicvoidinit(FilterConfigfilterConfig)
throwsServletException
Calledbythewebcontainertoindicatetoafilterthatitisbeingplacedintoservice.Theservletcontainercallstheinitmethodexactlyonceafterinstantiatingthefilter.Theinitmethodmustcompletesuccessfullybeforethefilterisaskedtodoanyfilteringwork.
Thewebcontainercannotplacethefilterintoserviceiftheinitmethodeither1.ThrowsaServletException2.Doesnotreturnwithinatimeperioddefinedbythewebcontainer
doFilter
publicvoiddoFilter(ServletRequestrequest,
ServletResponseresponse,
FilterChainchain)
throwsjava.io.IOException,
ServletException
ThedoFiltermethodoftheFilteriscalledbythecontainereachtimearequest/responsepairispassedthroughthechainduetoaclientrequestforaresourceattheendofthechain.TheFilterChainpassedintothismethodallowstheFiltertopassontherequestandresponsetothenextentityinthechain.
Atypicalimplementationofthismethodwouldfollowthefollowingpattern:-1.Examinetherequest2.Optionallywraptherequestobjectwithacustomimplementationtofiltercontentorheadersforinputfiltering3.Optionallywraptheresponseobjectwithacustomimplementationtofiltercontentorheadersforoutputfiltering4.a)EitherinvokethenextentityinthechainusingtheFilterChainobject(chain.doFilter()),4.b)ornotpassontherequest/responsepairtothenextentityinthefilterchaintoblocktherequestprocessing5.Directlysetheadersontheresponseafterinvokationofthenextentityintherfilterchain.
destroy
publicvoiddestroy()
Calledbythewebcontainertoindicatetoafilterthatitisbeingtakenoutofservice.Thismethodisonlycalledonceallthreadswithinthefilter'sdoFiltermethodhaveexitedorafteratimeoutperiodhaspassed.Afterthewebcontainercallsthismethod,itwillnotcallthedoFiltermethodagainonthisinstanceofthefilter.
Thismethodgivesthefilteranopportunitytocleanupanyresourcesthatarebeingheld(forexample,memory,filehandles,threads)andmakesurethatanypersistentstateissynchronizedwiththefilter'scurrentstateinmemory.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceFilterChain
publicabstractinterfaceFilterChain
AFilterChainisanobjectprovidedbytheservletcontainertothedevelopergivingaviewintotheinvocationchainofafilteredrequestforaresource.FiltersusetheFilterChaintoinvokethenextfilterinthechain,orifthecallingfilteristhelastfilterinthechain,toinvoketherosourceattheendofthechain.
Since:Servlet2.3
SeeAlso:Filter
MethodSummary
void
doFilter(ServletRequestrequest,ServletResponseresponse)Causesthenextfilterinthechaintobeinvoked,orifthecallingfilteristhelastfilterinthechain,causestheresourceattheendofthechaintobeinvoked.
MethodDetail
doFilter
publicvoiddoFilter(ServletRequestrequest,
ServletResponseresponse)
throwsjava.io.IOException,
ServletException
Causesthenextfilterinthechaintobeinvoked,orifthecallingfilteristhelastfilterinthechain,causestheresourceattheendofthechaintobeinvoked.Parameters:
request-therequesttopassalongthechain.
response-theresponsetopassalongthechain.Since:
2.3
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceFilterConfig
publicabstractinterfaceFilterConfig
Afilterconfigurationobjectusedbyaservletcontainerusedtopassinformationtoafilterduringinitialization.
Since:Servlet2.3
SeeAlso:Filter
MethodSummary
java.lang.String
getFilterName()Returnsthefilter-nameofthisfilterasdefinedinthedeploymentdescriptor.
java.lang.String
getInitParameter(java.lang.Stringname)ReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.
java.util.Enumeration
getInitParameterNames()Returnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
ServletContext
getServletContext()ReturnsareferencetotheServletContextinwhichthecallerisexecuting.
MethodDetail
getFilterName
publicjava.lang.StringgetFilterName()
Returnsthefilter-nameofthisfilterasdefinedinthedeploymentdescriptor.
getServletContext
publicServletContextgetServletContext()
ReturnsareferencetotheServletContextinwhichthecallerisexecuting.Returns:
aServletContextobject,usedbythecallertointeractwithitsservletcontainer
SeeAlso:ServletContext
getInitParameter
publicjava.lang.StringgetInitParameter(java.lang.Stringname)
ReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.Parameters:
name-aStringspecifyingthenameoftheinitializationparameterReturns:
aStringcontainingthevalueoftheinitializationparameter
getInitParameterNames
publicjava.util.EnumerationgetInitParameterNames()
Returnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.Returns:
anEnumerationofStringobjectscontainingthenamesoftheservlet'sinitializationparameters
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassGenericServletjava.lang.Object
|
+--javax.servlet.GenericServlet
DirectKnownSubclasses:HttpServlet
publicabstractclassGenericServletextendsjava.lang.ObjectimplementsServlet,ServletConfig,java.io.Serializable
Definesageneric,protocol-independentservlet.TowriteanHTTPservletforuseontheWeb,extendHttpServletinstead.
GenericServletimplementstheServletandServletConfiginterfaces.GenericServletmaybedirectlyextendedbyaservlet,althoughit'smorecommontoextendaprotocol-specificsubclasssuchasHttpServlet.
GenericServletmakeswritingservletseasier.ItprovidessimpleversionsofthelifecyclemethodsinitanddestroyandofthemethodsintheServletConfiginterface.GenericServletalsoimplementsthelogmethod,declaredintheServletContextinterface.
Towriteagenericservlet,youneedonlyoverridetheabstractservicemethod.
SeeAlso:SerializedForm
ConstructorSummaryGenericServlet()Doesnothing.
MethodSummary
void
destroy()Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingtakenoutofservice.
java.lang.String
getInitParameter(java.lang.Stringname)ReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.
java.util.Enumeration
getInitParameterNames()Returnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
ServletConfiggetServletConfig()Returnsthisservlet'sServletConfigobject.
ServletContext
getServletContext()ReturnsareferencetotheServletContextinwhichthisservletisrunning.
java.lang.String
getServletInfo()Returnsinformationabouttheservlet,suchasauthor,version,andcopyright.
java.lang.StringgetServletName()Returnsthenameofthisservletinstance.
void
init()Aconveniencemethodwhichcanbeoverriddensothatthere'snoneedtocallsuper.init(config).
void
init(ServletConfigconfig)Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingplacedintoservice.
void
log(java.lang.Stringmsg)Writesthespecifiedmessagetoaservletlogfile,prependedbytheservlet'sname.
void
log(java.lang.Stringmessage,
java.lang.Throwablet)WritesanexplanatorymessageandastacktraceforagivenThrowableexceptiontotheservletlogfile,prependedbytheservlet'sname.
abstractvoid
service(ServletRequestreq,ServletResponseres)Calledbytheservletcontainertoallowtheservlettorespondtoarequest.
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
GenericServlet
publicGenericServlet()
Doesnothing.Alloftheservletinitializationisdonebyoneoftheinitmethods.
MethodDetail
destroy
publicvoiddestroy()
Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingtakenoutofservice.SeeServlet.destroy().Specifiedby:
destroyininterfaceServlet
getInitParameter
publicjava.lang.StringgetInitParameter(java.lang.Stringname)
ReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.SeeServletConfig.getInitParameter(java.lang.String).
Thismethodissuppliedforconvenience.Itgetsthevalueofthenamedparameterfromtheservlet'sServletConfigobject.
Specifiedby:getInitParameterininterfaceServletConfig
Parameters:name-aStringspecifyingthenameoftheinitializationparameter
Returns:StringaStringcontainingthevalueoftheinitalizationparameter
getInitParameterNames
publicjava.util.EnumerationgetInitParameterNames()
Returnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.SeeServletConfig.getInitParameterNames().
Thismethodissuppliedforconvenience.Itgetstheparameternamesfromtheservlet'sServletConfigobject.
Specifiedby:getInitParameterNamesininterfaceServletConfig
Returns:EnumerationanenumerationofStringobjectscontainingthenamesoftheservlet'sinitializationparameters
getServletConfig
publicServletConfiggetServletConfig()
Returnsthisservlet'sServletConfigobject.Specifiedby:
getServletConfigininterfaceServletReturns:
ServletConfigtheServletConfigobjectthatinitializedthisservlet
getServletContext
publicServletContextgetServletContext()
ReturnsareferencetotheServletContextinwhichthisservletisrunning.SeeServletConfig.getServletContext().
Thismethodissuppliedforconvenience.Itgetsthecontextfromtheservlet'sServletConfigobject.
Specifiedby:getServletContextininterfaceServletConfig
Returns:ServletContexttheServletContextobjectpassedtothisservletbytheinitmethod
getServletInfo
publicjava.lang.StringgetServletInfo()
Returnsinformationabouttheservlet,suchasauthor,version,andcopyright.Bydefault,thismethodreturnsanemptystring.Overridethismethodtohaveitreturnameaningfulvalue.SeeServlet.getServletInfo().Specifiedby:
getServletInfoininterfaceServletReturns:
Stringinformationaboutthisservlet,bydefaultanemptystring
init
publicvoidinit(ServletConfigconfig)
throwsServletException
Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingplacedintoservice.SeeServlet.init(javax.servlet.ServletConfig).
ThisimplementationstorestheServletConfigobjectitreceivesfromtheservletcontainerforlateruse.Whenoverridingthisformofthemethod,callsuper.init(config).
Specifiedby:initininterfaceServlet
Parameters:config-theServletConfigobjectthatcontainsconfigutationinformationforthisservlet
Throws:ServletException-ifanexceptionoccursthatinterruptstheservlet'snormaloperation
SeeAlso:UnavailableException
init
publicvoidinit()
throwsServletException
Aconveniencemethodwhichcanbeoverriddensothatthere'snoneedtocallsuper.init(config).
Insteadofoverridinginit(ServletConfig),simplyoverridethismethodanditwillbecalledbyGenericServlet.init(ServletConfigconfig).TheServletConfigobjectcanstillberetrievedviagetServletConfig().
Throws:ServletException-ifanexceptionoccursthatinterruptstheservlet'snormaloperation
log
publicvoidlog(java.lang.Stringmsg)
Writesthespecifiedmessagetoaservletlogfile,prependedbytheservlet'sname.SeeServletContext.log(String).
Parameters:msg-aStringspecifyingthemessagetobewrittentothelogfile
log
publicvoidlog(java.lang.Stringmessage,
java.lang.Throwablet)
WritesanexplanatorymessageandastacktraceforagivenThrowableexceptiontotheservletlogfile,prependedbytheservlet'sname.SeeServletContext.log(String,Throwable).Parameters:
message-aStringthatdescribestheerrororexceptiont-thejava.lang.Throwableerrororexception
service
publicabstractvoidservice(ServletRequestreq,
ServletResponseres)
throwsServletException,
java.io.IOException
Calledbytheservletcontainertoallowtheservlettorespondtoarequest.SeeServlet.service(javax.servlet.ServletRequest,javax.servlet.ServletResponse).
Thismethodisdeclaredabstractsosubclasses,suchasHttpServlet,mustoverrideit.
Specifiedby:serviceininterfaceServlet
Parameters:req-theServletRequestobjectthatcontainstheclient'srequestres-theServletResponseobjectthatwillcontaintheservlet'sresponse
Throws:ServletException-ifanexceptionoccursthatinterfereswiththeservlet'snormaloperationoccurred
java.io.IOException-ifaninputoroutputexceptionoccurs
getServletName
publicjava.lang.StringgetServletName()
Returnsthenameofthisservletinstance.SeeServletConfig.getServletName().Specifiedby:
getServletNameininterfaceServletConfigReturns:
thenameofthisservletinstance
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
HierarchyForPackagejavax.servlet.http
PackageHierarchies:AllPackages
ClassHierarchy
classjava.lang.Objectclassjavax.servlet.http.Cookie(implementsjava.lang.Cloneable)classjava.util.EventObject(implementsjava.io.Serializable)
classjavax.servlet.http.HttpSessionEventclassjavax.servlet.http.HttpSessionBindingEvent
classjavax.servlet.GenericServlet(implementsjava.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig)
classjavax.servlet.http.HttpServlet(implementsjava.io.Serializable)
classjavax.servlet.http.HttpUtilsclassjavax.servlet.ServletRequestWrapper(implementsjavax.servlet.ServletRequest)
classjavax.servlet.http.HttpServletRequestWrapper(implementsjavax.servlet.http.HttpServletRequest)
classjavax.servlet.ServletResponseWrapper(implementsjavax.servlet.ServletResponse)
classjavax.servlet.http.HttpServletResponseWrapper(implementsjavax.servlet.http.HttpServletResponse)
InterfaceHierarchy
interfacejava.util.EventListenerinterfacejavax.servlet.http.HttpSessionActivationListenerinterfacejavax.servlet.http.HttpSessionAttributeListenerinterfacejavax.servlet.http.HttpSessionBindingListenerinterfacejavax.servlet.http.HttpSessionListener
interfacejavax.servlet.http.HttpSessioninterfacejavax.servlet.http.HttpSessionContextinterfacejavax.servlet.ServletRequest
interfacejavax.servlet.http.HttpServletRequestinterfacejavax.servlet.ServletResponse
interfacejavax.servlet.http.HttpServletResponse
Overview Package Class Tree Deprecated IndexHelpPREVNEXT FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVPACKAGENEXTPACKAGE FRAMESNOFRAMES
Packagejavax.servlet.http
InterfaceSummaryHttpServletRequest ExtendstheServletRequestinterfaceto
providerequestinformationforHTTPservlets.
HttpServletResponseExtendstheServletResponseinterfacetoprovideHTTP-specificfunctionalityinsendingaresponse.
HttpSessionProvidesawaytoidentifyauseracrossmorethanonepagerequestorvisittoaWebsiteandtostoreinformationaboutthatuser.
HttpSessionActivationListener
Objectsthatareboundtoasessionmaylistentocontainereventsnotifyingthemthatsessionswillbepassivatedandthatsessionwillbeactivated.
HttpSessionAttributeListener
Thislistenerinterfacecanbeimplementedinordertogetnotificationsofchangestotheattributelistsofsessionswithinthiswebapplication.
HttpSessionBindingListener Causesanobjecttobenotifiedwhenitisboundtoorunboundfromasession.
HttpSessionContext Deprecated.AsofJava(tm)ServletAPI2.1forsecurityreasons,withnoreplacement.
HttpSessionListenerImplementationsofthisinterfacemayarenotifiedofchangestothelistofactivesessionsinawebapplication.
ClassSummary
Cookie
Createsacookie,asmallamountofinformationsentbyaservlettoaWebbrowser,savedbythebrowser,andlatersentbacktotheserver.
HttpServlet ProvidesanabstractclasstobesubclassedtocreateanHTTPservletsuitableforaWebsite.
HttpServletRequestWrapper
ProvidesaconvenientimplementationoftheHttpServletRequestinterfacethatcanbesubclassedbydeveloperswishingtoadapttherequesttoaServlet.
HttpServletResponseWrapper
ProvidesaconvenientimplementationoftheHttpServletResponseinterfacethatcanbesubclassedbydeveloperswishingtoadapttheresponsefromaServlet.
HttpSessionBindingEvent
EventsofthistypeareeithersenttoanobjectthatimplementsHttpSessionBindingListenerwhenitisboundorunboundfromasession,ortoaHttpSessionAttributeListenerthathasbeenconfiguredinthedeploymentdescriptorwhenanyattributeisbound,unboundorreplacedinasession.
HttpSessionEventThisistheclassrepresentingeventnotificationsforchangestosessionswithinawebapplication.
HttpUtils Deprecated.AsofJava(tm)ServletAPI2.3.
Overview Package Class Tree Deprecated IndexHelpPREVPACKAGENEXTPACKAGE FRAMESNOFRAMES
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassCookiejava.lang.Object
|
+--javax.servlet.http.Cookie
publicclassCookieextendsjava.lang.Objectimplementsjava.lang.Cloneable
Createsacookie,asmallamountofinformationsentbyaservlettoaWebbrowser,savedbythebrowser,andlatersentbacktotheserver.Acookie'svaluecanuniquelyidentifyaclient,socookiesarecommonlyusedforsessionmanagement.
Acookiehasaname,asinglevalue,andoptionalattributessuchasacomment,pathanddomainqualifiers,amaximumage,andaversionnumber.SomeWebbrowsershavebugsinhowtheyhandletheoptionalattributes,sousethemsparinglytoimprovetheinteroperabilityofyourservlets.
TheservletsendscookiestothebrowserbyusingtheHttpServletResponse.addCookie(javax.servlet.http.Cookie)method,whichaddsfieldstoHTTPresponseheaderstosendcookiestothebrowser,oneatatime.Thebrowserisexpectedtosupport20cookiesforeachWebserver,300cookiestotal,andmaylimitcookiesizeto4KBeach.
ThebrowserreturnscookiestotheservletbyaddingfieldstoHTTPrequestheaders.CookiescanberetrievedfromarequestbyusingtheHttpServletRequest.getCookies()method.Severalcookiesmighthavethesamenamebutdifferentpathattributes.
CookiesaffectthecachingoftheWebpagesthatusethem.HTTP1.0doesnotcachepagesthatusecookiescreatedwiththisclass.ThisclassdoesnotsupportthecachecontroldefinedwithHTTP1.1.
ThisclasssupportsboththeVersion0(byNetscape)andVersion1(byRFC2109)cookiespecifications.Bydefault,cookiesarecreatedusingVersion0toensurethebestinteroperability.
ConstructorSummaryCookie(java.lang.Stringname,java.lang.Stringvalue)Constructsacookiewithaspecifiednameandvalue.
MethodSummary
java.lang.Object
clone()Overridesthestandardjava.lang.Object.clonemethodtoreturnacopyofthiscookie.
java.lang.String
getComment()Returnsthecommentdescribingthepurposeofthiscookie,ornullifthecookiehasnocomment.
java.lang.StringgetDomain()Returnsthedomainnamesetforthiscookie.
int
getMaxAge()Returnsthemaximumageofthecookie,specifiedinseconds,Bydefault,-1indicatingthecookiewillpersistuntilbrowsershutdown.
java.lang.StringgetName()Returnsthenameofthecookie.
java.lang.String
getPath()Returnsthepathontheservertowhichthebrowserreturnsthiscookie.
boolean
getSecure()Returnstrueifthebrowserissendingcookiesonlyoverasecureprotocol,orfalseifthebrowsercansendcookiesusinganyprotocol.
java.lang.StringgetValue()Returnsthevalueofthecookie.
int
getVersion()Returnstheversionoftheprotocolthiscookiecomplieswith.
voidsetComment(java.lang.Stringpurpose)Specifiesacommentthatdescribesacookie'spurpose.
void
setDomain(java.lang.Stringpattern)Specifiesthedomainwithinwhichthiscookieshouldbepresented.
voidsetMaxAge(intexpiry)Setsthemaximumageofthecookieinseconds.
void
setPath(java.lang.Stringuri)Specifiesapathforthecookietowhichtheclientshouldreturnthecookie.
void
setSecure(booleanflag)Indicatestothebrowserwhetherthecookieshouldonlybesentusingasecureprotocol,suchasHTTPSorSSL.
void
setValue(java.lang.StringnewValue)Assignsanewvaluetoacookieafterthecookieiscreated.
void
setVersion(intv)Setstheversionofthecookieprotocolthiscookiecomplieswith.
Methodsinheritedfromclassjava.lang.Objectequals,finalize,getClass,hashCode,notify,notifyAll,toString,
wait,wait,wait
ConstructorDetail
Cookie
publicCookie(java.lang.Stringname,
java.lang.Stringvalue)
Constructsacookiewithaspecifiednameandvalue.
ThenamemustconformtoRFC2109.ThatmeansitcancontainonlyASCIIalphanumericcharactersandcannotcontaincommas,semicolons,orwhitespaceorbeginwitha$character.Thecookie'snamecannotbechangedaftercreation.
Thevaluecanbeanythingtheserverchoosestosend.Itsvalueisprobablyofinterestonlytotheserver.Thecookie'svaluecanbechangedaftercreationwiththesetValuemethod.
Bydefault,cookiesarecreatedaccordingtotheNetscapecookiespecification.TheversioncanbechangedwiththesetVersionmethod.
Parameters:name-aStringspecifyingthenameofthecookievalue-aStringspecifyingthevalueofthecookie
Throws:java.lang.IllegalArgumentException-ifthecookienamecontainsillegalcharacters(forexample,acomma,space,orsemicolon)oritisoneofthetokensreservedforusebythecookieprotocol
SeeAlso:setValue(java.lang.String),setVersion(int)
MethodDetail
setComment
publicvoidsetComment(java.lang.Stringpurpose)
Specifiesacommentthatdescribesacookie'spurpose.Thecommentisusefulifthebrowserpresentsthecookietotheuser.CommentsarenotsupportedbyNetscapeVersion0cookies.Parameters:
purpose-aStringspecifyingthecommenttodisplaytotheuserSeeAlso:
getComment()
getComment
publicjava.lang.StringgetComment()
Returnsthecommentdescribingthepurposeofthiscookie,ornullifthecookiehasnocomment.Returns:
aStringcontainingthecomment,ornullifnoneSeeAlso:
setComment(java.lang.String)
setDomain
publicvoidsetDomain(java.lang.Stringpattern)
Specifiesthedomainwithinwhichthiscookieshouldbepresented.
TheformofthedomainnameisspecifiedbyRFC2109.Adomainnamebeginswithadot(.foo.com)andmeansthatthecookieisvisibletoserversinaspecifiedDomainNameSystem(DNS)zone(forexample,www.foo.com,butnota.b.foo.com).Bydefault,cookiesareonlyreturnedtotheserverthatsentthem.
Parameters:pattern-aStringcontainingthedomainnamewithinwhichthiscookieisvisible;formisaccordingtoRFC2109
SeeAlso:getDomain()
getDomain
publicjava.lang.StringgetDomain()
Returnsthedomainnamesetforthiscookie.TheformofthedomainnameissetbyRFC2109.Returns:
aStringcontainingthedomainnameSeeAlso:
setDomain(java.lang.String)
setMaxAge
publicvoidsetMaxAge(intexpiry)
Setsthemaximumageofthecookieinseconds.
Apositivevalueindicatesthatthecookiewillexpireafterthatmanysecondshavepassed.Notethatthevalueisthemaximumagewhenthecookiewillexpire,notthecookie'scurrentage.
AnegativevaluemeansthatthecookieisnotstoredpersistentlyandwillbedeletedwhentheWebbrowserexits.Azerovaluecausesthecookietobedeleted.
Parameters:expiry-anintegerspecifyingthemaximumageofthecookieinseconds;ifnegative,meansthecookieisnotstored;ifzero,deletesthecookie
SeeAlso:getMaxAge()
getMaxAge
publicintgetMaxAge()
Returnsthemaximumageofthecookie,specifiedinseconds,Bydefault,-1indicatingthecookiewillpersistuntilbrowsershutdown.Returns:
anintegerspecifyingthemaximumageofthecookieinseconds;ifnegative,meansthecookiepersistsuntilbrowsershutdown
SeeAlso:setMaxAge(int)
setPath
publicvoidsetPath(java.lang.Stringuri)
Specifiesapathforthecookietowhichtheclientshouldreturnthecookie.
Thecookieisvisibletoallthepagesinthedirectoryyouspecify,andallthepagesinthatdirectory'ssubdirectories.Acookie'spathmustincludetheservletthatsetthecookie,forexample,/catalog,whichmakesthecookie
visibletoalldirectoriesontheserverunder/catalog.
ConsultRFC2109(availableontheInternet)formoreinformationonsettingpathnamesforcookies.
Parameters:uri-aStringspecifyingapath
SeeAlso:getPath()
getPath
publicjava.lang.StringgetPath()
Returnsthepathontheservertowhichthebrowserreturnsthiscookie.Thecookieisvisibletoallsubpathsontheserver.Returns:
aStringspecifyingapaththatcontainsaservletname,forexample,/catalog
SeeAlso:setPath(java.lang.String)
setSecure
publicvoidsetSecure(booleanflag)
Indicatestothebrowserwhetherthecookieshouldonlybesentusingasecureprotocol,suchasHTTPSorSSL.
Thedefaultvalueisfalse.
Parameters:flag-iftrue,sendsthecookiefromthebrowsertotheserverusingonlywhenusingasecureprotocol;iffalse,sentonanyprotocol
SeeAlso:getSecure()
getSecure
publicbooleangetSecure()
Returnstrueifthebrowserissendingcookiesonlyoverasecureprotocol,orfalseifthebrowsercansendcookiesusinganyprotocol.Returns:
trueifthebrowserusesasecureprotocol;otherwise,trueSeeAlso:
setSecure(boolean)
getName
publicjava.lang.StringgetName()
Returnsthenameofthecookie.Thenamecannotbechangedaftercreation.Returns:
aStringspecifyingthecookie'sname
setValue
publicvoidsetValue(java.lang.StringnewValue)
Assignsanewvaluetoacookieafterthecookieiscreated.Ifyouuseabinaryvalue,youmaywanttouseBASE64encoding.
WithVersion0cookies,valuesshouldnotcontainwhitespace,brackets,parentheses,equalssigns,commas,doublequotes,slashes,questionmarks,atsigns,colons,andsemicolons.Emptyvaluesmaynotbehavethesamewayonallbrowsers.
Parameters:newValue-aStringspecifyingthenewvalue
SeeAlso:getValue(),Cookie
getValue
publicjava.lang.StringgetValue()
Returnsthevalueofthecookie.Returns:
aStringcontainingthecookie'spresentvalueSeeAlso:
setValue(java.lang.String),Cookie
getVersion
publicintgetVersion()
Returnstheversionoftheprotocolthiscookiecomplieswith.Version1complieswithRFC2109,andversion0complieswiththeoriginalcookiespecificationdraftedbyNetscape.Cookiesprovidedbyabrowseruseandidentifythebrowser'scookieversion.Returns:
0ifthecookiecomplieswiththeoriginalNetscapespecification;1ifthecookiecomplieswithRFC2109
SeeAlso:setVersion(int)
setVersion
publicvoidsetVersion(intv)
Setstheversionofthecookieprotocolthiscookiecomplieswith.Version0complieswiththeoriginalNetscapecookiespecification.Version1complieswithRFC2109.
SinceRFC2109isstillsomewhatnew,considerversion1asexperimental;donotuseityetonproductionsites.
Parameters:v-0ifthecookieshouldcomplywiththeoriginalNetscapespecification;1ifthecookieshouldcomplywithRFC2109
SeeAlso:getVersion()
clone
publicjava.lang.Objectclone()
Overridesthestandardjava.lang.Object.clonemethodtoreturnacopyofthiscookie.Overrides:
cloneinclassjava.lang.Object
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassHttpServletjava.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
publicabstractclassHttpServletextendsGenericServletimplementsjava.io.Serializable
ProvidesanabstractclasstobesubclassedtocreateanHTTPservletsuitableforaWebsite.AsubclassofHttpServletmustoverrideatleastonemethod,usuallyoneofthese:
doGet,iftheservletsupportsHTTPGETrequestsdoPost,forHTTPPOSTrequestsdoPut,forHTTPPUTrequestsdoDelete,forHTTPDELETErequestsinitanddestroy,tomanageresourcesthatareheldforthelifeoftheservletgetServletInfo,whichtheservletusestoprovideinformationaboutitself
There'salmostnoreasontooverridetheservicemethod.servicehandlesstandardHTTPrequestsbydispatchingthemtothehandlermethodsforeachHTTPrequesttype(thedoXXXmethodslistedabove).
Likewise,there'salmostnoreasontooverridethedoOptionsanddoTracemethods.
Servletstypicallyrunonmultithreadedservers,sobeawarethataservletmusthandleconcurrentrequestsandbecarefultosynchronizeaccesstosharedresources.Sharedresourcesincludein-memorydatasuchasinstanceorclassvariablesandexternalobjectssuchasfiles,databaseconnections,andnetworkconnections.SeetheJavaTutorialonMultithreadedProgrammingformoreinformationonhandlingmultiplethreadsinaJavaprogram.
SeeAlso:SerializedForm
ConstructorSummaryHttpServlet()Doesnothing,becausethisisanabstractclass.
MethodSummaryprotected
void
doDelete(HttpServletRequestreq,HttpServletResponseresp)Calledbytheserver(viatheservicemethod)toallowaservlettohandleaDELETErequest.
protected
void
doGet(HttpServletRequestreq,HttpServletResponseresp)Calledbytheserver(viatheservicemethod)toallowaservlettohandleaGETrequest.
protected
void
doHead(HttpServletRequestreq,HttpServletResponseresp)ReceivesanHTTPHEADrequestfromtheprotectedservicemethodandhandlestherequest.
protected
void
doOptions(HttpServletRequestreq,HttpServletResponseresp)
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaOPTIONSrequest.
protected
void
doPost(HttpServletRequestreq,HttpServletResponseresp)Calledbytheserver(viatheservicemethod)toallowaservlettohandleaPOSTrequest.
protected
void
doPut(HttpServletRequestreq,HttpServletResponseresp)Calledbytheserver(viatheservicemethod)toallowaservlettohandleaPUTrequest.
protected
void
doTrace(HttpServletRequestreq,HttpServletResponseresp)Calledbytheserver(viatheservicemethod)toallowaservlettohandleaTRACErequest.
protected
long
getLastModified(HttpServletRequestreq)ReturnsthetimetheHttpServletRequestobjectwaslastmodified,inmillisecondssincemidnightJanuary1,1970GMT.
protected
service(HttpServletRequestreq,HttpServletResponseresp)ReceivesstandardHTTPrequestsfromthepublicservice
void methodanddispatchesthemtothedoXXXmethodsdefinedinthisclass.
voidservice(ServletRequestreq,ServletResponseres)Dispatchesclientrequeststotheprotectedservicemethod.
Methodsinheritedfromclassjavax.servlet.GenericServletdestroy,getInitParameter,getInitParameterNames,
getServletConfig,getServletContext,getServletInfo,
getServletName,init,init,log,log
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
HttpServlet
publicHttpServlet()
Doesnothing,becausethisisanabstractclass.
MethodDetail
doGet
protectedvoiddoGet(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaGETrequest.
OverridingthismethodtosupportaGETrequestalsoautomaticallysupportsanHTTPHEADrequest.AHEADrequestisaGETrequestthat
returnsnobodyintheresponse,onlytherequestheaderfields.
Whenoverridingthismethod,readtherequestdata,writetheresponseheaders,gettheresponse'swriteroroutputstreamobject,andfinally,writetheresponsedata.It'sbesttoincludecontenttypeandencoding.WhenusingaPrintWriterobjecttoreturntheresponse,setthecontenttypebeforeaccessingthePrintWriterobject.
Theservletcontainermustwritetheheadersbeforecommittingtheresponse,becauseinHTTPtheheadersmustbesentbeforetheresponsebody.
Wherepossible,settheContent-Lengthheader(withtheServletResponse.setContentLength(int)method),toallowtheservletcontainertouseapersistentconnectiontoreturnitsresponsetotheclient,improvingperformance.Thecontentlengthisautomaticallysetiftheentireresponsefitsinsidetheresponsebuffer.
TheGETmethodshouldbesafe,thatis,withoutanysideeffectsforwhichusersareheldresponsible.Forexample,mostformquerieshavenosideeffects.Ifaclientrequestisintendedtochangestoreddata,therequestshouldusesomeotherHTTPmethod.
TheGETmethodshouldalsobeidempotent,meaningthatitcanbesafelyrepeated.Sometimesmakingamethodsafealsomakesitidempotent.Forexample,repeatingqueriesisbothsafeandidempotent,butbuyingaproductonlineormodifyingdataisneithersafenoridempotent.
Iftherequestisincorrectlyformatted,doGetreturnsanHTTP"BadRequest"message.
Parameters:req-anHttpServletRequestobjectthatcontainstherequesttheclienthasmadeoftheservletresp-anHttpServletResponseobjectthatcontainstheresponsetheservletsendstotheclient
Throws:java.io.IOException-ifaninputoroutputerrorisdetectedwhentheservlethandlestheGETrequestServletException-iftherequestfortheGETcouldnotbehandled
SeeAlso:ServletResponse.setContentType(java.lang.String)
getLastModified
protectedlonggetLastModified(HttpServletRequestreq)
ReturnsthetimetheHttpServletRequestobjectwaslastmodified,inmillisecondssincemidnightJanuary1,1970GMT.Ifthetimeisunknown,thismethodreturnsanegativenumber(thedefault).
ServletsthatsupportHTTPGETrequestsandcanquicklydeterminetheirlastmodificationtimeshouldoverridethismethod.Thismakesbrowserandproxycachesworkmoreeffectively,reducingtheloadonserverandnetworkresources.
Parameters:req-theHttpServletRequestobjectthatissenttotheservlet
Returns:alongintegerspecifyingthetimetheHttpServletRequestobjectwaslastmodified,inmillisecondssincemidnight,January1,1970GMT,or-1ifthetimeisnotknown
doHead
protectedvoiddoHead(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
ReceivesanHTTPHEADrequestfromtheprotectedservicemethodandhandlestherequest.TheclientsendsaHEADrequestwhenitwantstoseeonlytheheadersofaresponse,suchasContent-TypeorContent-Length.TheHTTPHEADmethodcountstheoutputbytesintheresponsetosettheContent-Lengthheaderaccurately.
Ifyouoverridethismethod,youcanavoidcomputingtheresponsebodyandjustsettheresponseheadersdirectlytoimproveperformance.Make
surethatthedoHeadmethodyouwriteisbothsafeandidempotent(thatis,protectsitselffrombeingcalledmultipletimesforoneHTTPHEADrequest).
IftheHTTPHEADrequestisincorrectlyformatted,doHeadreturnsanHTTP"BadRequest"message.
Parameters:req-therequestobjectthatispassedtotheservletresp-theresponseobjectthattheservletusestoreturntheheaderstotheclien
Throws:java.io.IOException-ifaninputoroutputerroroccursServletException-iftherequestfortheHEADcouldnotbehandled
doPost
protectedvoiddoPost(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaPOSTrequest.TheHTTPPOSTmethodallowstheclienttosenddataofunlimitedlengthtotheWebserverasingletimeandisusefulwhenpostinginformationsuchascreditcardnumbers.
Whenoverridingthismethod,readtherequestdata,writetheresponseheaders,gettheresponse'swriteroroutputstreamobject,andfinally,writetheresponsedata.It'sbesttoincludecontenttypeandencoding.WhenusingaPrintWriterobjecttoreturntheresponse,setthecontenttypebeforeaccessingthePrintWriterobject.
Theservletcontainermustwritetheheadersbeforecommittingtheresponse,becauseinHTTPtheheadersmustbesentbeforetheresponsebody.
Wherepossible,settheContent-Lengthheader(withtheServletResponse.setContentLength(int)method),toallowtheservlet
containertouseapersistentconnectiontoreturnitsresponsetotheclient,improvingperformance.Thecontentlengthisautomaticallysetiftheentireresponsefitsinsidetheresponsebuffer.
WhenusingHTTP1.1chunkedencoding(whichmeansthattheresponsehasaTransfer-Encodingheader),donotsettheContent-Lengthheader.
Thismethoddoesnotneedtobeeithersafeoridempotent.OperationsrequestedthroughPOSTcanhavesideeffectsforwhichtheusercanbeheldaccountable,forexample,updatingstoreddataorbuyingitemsonline.
IftheHTTPPOSTrequestisincorrectlyformatted,doPostreturnsanHTTP"BadRequest"message.
Parameters:req-anHttpServletRequestobjectthatcontainstherequesttheclienthasmadeoftheservletresp-anHttpServletResponseobjectthatcontainstheresponsetheservletsendstotheclient
Throws:java.io.IOException-ifaninputoroutputerrorisdetectedwhentheservlethandlestherequestServletException-iftherequestforthePOSTcouldnotbehandled
SeeAlso:ServletOutputStream,ServletResponse.setContentType(java.lang.String)
doPut
protectedvoiddoPut(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaPUTrequest.ThePUToperationallowsaclienttoplaceafileontheserverandissimilartosendingafilebyFTP.
Whenoverridingthismethod,leaveintactanycontentheaderssentwiththe
request(includingContent-Length,Content-Type,Content-Transfer-Encoding,Content-Encoding,Content-Base,Content-Language,Content-Location,Content-MD5,andContent-Range).Ifyourmethodcannothandleacontentheader,itmustissueanerrormessage(HTTP501-NotImplemented)anddiscardtherequest.FormoreinformationonHTTP1.1,seeRFC2068.
Thismethoddoesnotneedtobeeithersafeoridempotent.OperationsthatdoPutperformscanhavesideeffectsforwhichtheusercanbeheldaccountable.Whenusingthismethod,itmaybeusefultosaveacopyoftheaffectedURLintemporarystorage.
IftheHTTPPUTrequestisincorrectlyformatted,doPutreturnsanHTTP"BadRequest"message.
Parameters:req-theHttpServletRequestobjectthatcontainstherequesttheclientmadeoftheservletresp-theHttpServletResponseobjectthatcontainstheresponsetheservletreturnstotheclient
Throws:java.io.IOException-ifaninputoroutputerroroccurswhiletheservletishandlingthePUTrequestServletException-iftherequestforthePUTcannotbehandled
doDelete
protectedvoiddoDelete(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaDELETErequest.TheDELETEoperationallowsaclienttoremoveadocumentorWebpagefromtheserver.
Thismethoddoesnotneedtobeeithersafeoridempotent.OperationsrequestedthroughDELETEcanhavesideeffectsforwhichuserscanbeheldaccountable.Whenusingthismethod,itmaybeusefultosaveacopy
oftheaffectedURLintemporarystorage.
IftheHTTPDELETErequestisincorrectlyformatted,doDeletereturnsanHTTP"BadRequest"message.
Parameters:req-theHttpServletRequestobjectthatcontainstherequesttheclientmadeoftheservletresp-theHttpServletResponseobjectthatcontainstheresponsetheservletreturnstotheclient
Throws:java.io.IOException-ifaninputoroutputerroroccurswhiletheservletishandlingtheDELETErequestServletException-iftherequestfortheDELETEcannotbehandled
doOptions
protectedvoiddoOptions(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaOPTIONSrequest.TheOPTIONSrequestdetermineswhichHTTPmethodstheserversupportsandreturnsanappropriateheader.Forexample,ifaservletoverridesdoGet,thismethodreturnsthefollowingheader:
Allow:GET,HEAD,TRACE,OPTIONS
There'snoneedtooverridethismethodunlesstheservletimplementsnewHTTPmethods,beyondthoseimplementedbyHTTP1.1.
Parameters:req-theHttpServletRequestobjectthatcontainstherequesttheclientmadeoftheservletresp-theHttpServletResponseobjectthatcontainstheresponsetheservletreturnstotheclient
Throws:
java.io.IOException-ifaninputoroutputerroroccurswhiletheservletishandlingtheOPTIONSrequestServletException-iftherequestfortheOPTIONScannotbehandled
doTrace
protectedvoiddoTrace(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
Calledbytheserver(viatheservicemethod)toallowaservlettohandleaTRACErequest.ATRACEreturnstheheaderssentwiththeTRACErequesttotheclient,sothattheycanbeusedindebugging.There'snoneedtooverridethismethod.Parameters:
req-theHttpServletRequestobjectthatcontainstherequesttheclientmadeoftheservletresp-theHttpServletResponseobjectthatcontainstheresponsetheservletreturnstotheclient
Throws:java.io.IOException-ifaninputoroutputerroroccurswhiletheservletishandlingtheTRACErequestServletException-iftherequestfortheTRACEcannotbehandled
service
protectedvoidservice(HttpServletRequestreq,
HttpServletResponseresp)
throwsServletException,
java.io.IOException
ReceivesstandardHTTPrequestsfromthepublicservicemethodanddispatchesthemtothedoXXXmethodsdefinedinthisclass.ThismethodisanHTTP-specificversionoftheServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)method.There'snoneedtooverridethismethod.Parameters:
req-theHttpServletRequestobjectthatcontainstherequesttheclientmadeoftheservletresp-theHttpServletResponseobjectthatcontainstheresponsetheservletreturnstotheclient
Throws:java.io.IOException-ifaninputoroutputerroroccurswhiletheservletishandlingtheTRACErequestServletException-iftherequestfortheTRACEcannotbehandled
SeeAlso:Servlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
service
publicvoidservice(ServletRequestreq,
ServletResponseres)
throwsServletException,
java.io.IOException
Dispatchesclientrequeststotheprotectedservicemethod.There'snoneedtooverridethismethod.Parameters:
req-theHttpServletRequestobjectthatcontainstherequesttheclientmadeoftheservletresp-theHttpServletResponseobjectthatcontainstheresponsetheservletreturnstotheclient
Throws:java.io.IOException-ifaninputoroutputerroroccurswhiletheservletishandlingtheTRACErequestServletException-iftherequestfortheTRACEcannotbehandled
Overrides:serviceinclassGenericServlet
SeeAlso:Servlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpServletRequest
AllKnownImplementingClasses:HttpServletRequestWrapper
publicabstractinterfaceHttpServletRequestextendsServletRequest
ExtendstheServletRequestinterfacetoproviderequestinformationforHTTPservlets.
TheservletcontainercreatesanHttpServletRequestobjectandpassesitasanargumenttotheservlet'sservicemethods(doGet,doPost,etc).
FieldSummarystaticjava.lang.String
BASIC_AUTHStringidentifierforBasicauthentication.
staticjava.lang.StringCLIENT_CERT_AUTHStringidentifierforBasicauthentication.
staticjava.lang.StringDIGEST_AUTHStringidentifierforBasicauthentication.
staticjava.lang.StringFORM_AUTHStringidentifierforBasicauthentication.
MethodSummary
java.lang.String
getAuthType()Returnsthenameoftheauthenticationschemeusedtoprotecttheservlet.
java.lang.String
getContextPath()ReturnstheportionoftherequestURIthatindicatesthecontextoftherequest.getCookies()
Cookie[] ReturnsanarraycontainingalloftheCookieobjectstheclientsentwiththisrequest.
long
getDateHeader(java.lang.Stringname)ReturnsthevalueofthespecifiedrequestheaderasalongvaluethatrepresentsaDateobject.
java.lang.String
getHeader(java.lang.Stringname)ReturnsthevalueofthespecifiedrequestheaderasaString.
java.util.Enumeration
getHeaderNames()Returnsanenumerationofalltheheadernamesthisrequestcontains.
java.util.Enumeration
getHeaders(java.lang.Stringname)ReturnsallthevaluesofthespecifiedrequestheaderasanEnumerationofStringobjects.
int
getIntHeader(java.lang.Stringname)Returnsthevalueofthespecifiedrequestheaderasanint.
java.lang.String
getMethod()ReturnsthenameoftheHTTPmethodwithwhichthisrequestwasmade,forexample,GET,POST,orPUT.
java.lang.String
getPathInfo()ReturnsanyextrapathinformationassociatedwiththeURLtheclientsentwhenitmadethisrequest.
java.lang.String
getPathTranslated()Returnsanyextrapathinformationaftertheservletnamebutbeforethequerystring,andtranslatesittoarealpath.
java.lang.String
getQueryString()ReturnsthequerystringthatiscontainedintherequestURLafterthepath.
java.lang.String
getRemoteUser()Returnstheloginoftheusermakingthisrequest,iftheuserhasbeenauthenticated,ornulliftheuserhasnotbeenauthenticated.
java.lang.String
getRequestedSessionId()ReturnsthesessionIDspecifiedbytheclient.
java.lang.String
getRequestURI()Returnsthepartofthisrequest'sURLfromtheprotocolnameuptothequerystringinthefirstlineoftheHTTPrequest.
java.lang.StringBuffer
getRequestURL()ReconstructstheURLtheclientusedtomaketherequest.
java.lang.String
getServletPath()Returnsthepartofthisrequest'sURLthatcallstheservlet.
HttpSession
getSession()Returnsthecurrentsessionassociatedwiththisrequest,oriftherequestdoesnothaveasession,createsone.
HttpSession
getSession(booleancreate)ReturnsthecurrentHttpSessionassociatedwiththisrequestor,ififthereisnocurrentsessionandcreateistrue,returnsanewsession.
java.security.Principal
getUserPrincipal()Returnsajava.security.Principalobjectcontainingthenameofthecurrentauthenticateduser.
boolean
isRequestedSessionIdFromCookie()CheckswhethertherequestedsessionIDcameinasacookie.
boolean
isRequestedSessionIdFromUrl()Deprecated.AsofVersion2.1oftheJavaServletAPI,useisRequestedSessionIdFromURL()instead.
boolean
isRequestedSessionIdFromURL()CheckswhethertherequestedsessionIDcameinaspartoftherequestURL.
boolean
isRequestedSessionIdValid()CheckswhethertherequestedsessionIDisstillvalid.
boolean
isUserInRole(java.lang.Stringrole)Returnsabooleanindicatingwhetherthe
authenticateduserisincludedinthespecifiedlogical"role".
Methodsinheritedfrominterfacejavax.servlet.ServletRequestgetAttribute,getAttributeNames,getCharacterEncoding,
getContentLength,getContentType,getInputStream,getLocale,
getLocales,getParameter,getParameterMap,getParameterNames,
getParameterValues,getProtocol,getReader,getRealPath,
getRemoteAddr,getRemoteHost,getRequestDispatcher,getScheme,
getServerName,getServerPort,isSecure,removeAttribute,
setAttribute,setCharacterEncoding
FieldDetail
BASIC_AUTH
publicstaticfinaljava.lang.StringBASIC_AUTH
StringidentifierforBasicauthentication.Value"BASIC"
FORM_AUTH
publicstaticfinaljava.lang.StringFORM_AUTH
StringidentifierforBasicauthentication.Value"FORM"
CLIENT_CERT_AUTH
publicstaticfinaljava.lang.StringCLIENT_CERT_AUTH
StringidentifierforBasicauthentication.Value"CLIENT_CERT"
DIGEST_AUTH
publicstaticfinaljava.lang.StringDIGEST_AUTH
StringidentifierforBasicauthentication.Value"DIGEST"
MethodDetail
getAuthType
publicjava.lang.StringgetAuthType()
Returnsthenameoftheauthenticationschemeusedtoprotecttheservlet.Allservletcontainerssupportbasic,formandclientcertificateauthentication,andmayadditionallysupportdigestauthentication.Iftheservletisnotauthenticatednullisreturned.
SameasthevalueoftheCGIvariableAUTH_TYPE.
Returns:oneofthestaticmembersBASIC_AUTH,FORM_AUTH,CLIENT_CERT_AUTH,DIGEST_AUTH(suitablefor==comparison)indicatingtheauthenticationscheme,ornulliftherequestwasnotauthenticated.
getCookies
publicCookie[]getCookies()
ReturnsanarraycontainingalloftheCookieobjectstheclientsentwiththisrequest.Thismethodreturnsnullifnocookiesweresent.Returns:
anarrayofalltheCookiesincludedwiththisrequest,ornulliftherequesthasnocookies
getDateHeader
publiclonggetDateHeader(java.lang.Stringname)
ReturnsthevalueofthespecifiedrequestheaderasalongvaluethatrepresentsaDateobject.Usethismethodwithheadersthatcontaindates,
suchasIf-Modified-Since.
ThedateisreturnedasthenumberofmillisecondssinceJanuary1,1970GMT.Theheadernameiscaseinsensitive.
Iftherequestdidnothaveaheaderofthespecifiedname,thismethodreturns-1.Iftheheadercan'tbeconvertedtoadate,themethodthrowsanIllegalArgumentException.
Parameters:name-aStringspecifyingthenameoftheheader
Returns:alongvaluerepresentingthedatespecifiedintheheaderexpressedasthenumberofmillisecondssinceJanuary1,1970GMT,or-1ifthenamedheaderwasnotincludedwiththereqest
Throws:java.lang.IllegalArgumentException-Iftheheadervaluecan'tbeconvertedtoadate
getHeader
publicjava.lang.StringgetHeader(java.lang.Stringname)
ReturnsthevalueofthespecifiedrequestheaderasaString.Iftherequestdidnotincludeaheaderofthespecifiedname,thismethodreturnsnull.Theheadernameiscaseinsensitive.Youcanusethismethodwithanyrequestheader.Parameters:
name-aStringspecifyingtheheadernameReturns:
aStringcontainingthevalueoftherequestedheader,ornulliftherequestdoesnothaveaheaderofthatname
getHeaders
publicjava.util.EnumerationgetHeaders(java.lang.Stringname)
ReturnsallthevaluesofthespecifiedrequestheaderasanEnumerationofStringobjects.
Someheaders,suchasAccept-Languagecanbesentbyclientsasseveralheaderseachwithadifferentvalueratherthansendingtheheaderasacommaseparatedlist.
Iftherequestdidnotincludeanyheadersofthespecifiedname,thismethodreturnsanemptyEnumeration.Theheadernameiscaseinsensitive.Youcanusethismethodwithanyrequestheader.
Parameters:name-aStringspecifyingtheheadername
Returns:anEnumerationcontainingthevaluesoftherequestedheader.Iftherequestdoesnothaveanyheadersofthatnamereturnanemptyenumeration.Ifthecontainerdoesnotallowaccesstoheaderinformation,returnnull
getHeaderNames
publicjava.util.EnumerationgetHeaderNames()
Returnsanenumerationofalltheheadernamesthisrequestcontains.Iftherequesthasnoheaders,thismethodreturnsanemptyenumeration.
Someservletcontainersdonotallowdonotallowservletstoaccessheadersusingthismethod,inwhichcasethismethodreturnsnull
Returns:anenumerationofalltheheadernamessentwiththisrequest;iftherequesthasnoheaders,anemptyenumeration;iftheservletcontainerdoesnotallowservletstousethismethod,null
getIntHeader
publicintgetIntHeader(java.lang.Stringname)
Returnsthevalueofthespecifiedrequestheaderasanint.Iftherequestdoesnothaveaheaderofthespecifiedname,thismethodreturns-1.Iftheheadercannotbeconvertedtoaninteger,thismethodthrowsaNumberFormatException.
Theheadernameiscaseinsensitive.
Parameters:name-aStringspecifyingthenameofarequestheader
Returns:anintegerexpressingthevalueoftherequestheaderor-1iftherequestdoesn'thaveaheaderofthisname
Throws:java.lang.NumberFormatException-Iftheheadervaluecan'tbeconvertedtoanint
getMethod
publicjava.lang.StringgetMethod()
ReturnsthenameoftheHTTPmethodwithwhichthisrequestwasmade,forexample,GET,POST,orPUT.SameasthevalueoftheCGIvariableREQUEST_METHOD.Returns:
aStringspecifyingthenameofthemethodwithwhichthisrequestwasmade
getPathInfo
publicjava.lang.StringgetPathInfo()
ReturnsanyextrapathinformationassociatedwiththeURLtheclientsentwhenitmadethisrequest.Theextrapathinformationfollowstheservletpathbutprecedesthequerystring.Thismethodreturnsnulliftherewasnoextrapathinformation.
SameasthevalueoftheCGIvariablePATH_INFO.
Returns:aString,decodedbythewebcontainer,specifyingextrapathinformationthatcomesaftertheservletpathbutbeforethequerystringintherequestURL;ornulliftheURLdoesnothaveanyextrapathinformation
getPathTranslated
publicjava.lang.StringgetPathTranslated()
Returnsanyextrapathinformationaftertheservletnamebutbeforethequerystring,andtranslatesittoarealpath.SameasthevalueoftheCGIvariablePATH_TRANSLATED.
IftheURLdoesnothaveanyextrapathinformation,thismethodreturnsnull.Thewebcontainerdoesnotdecodethinsstring.
Returns:aStringspecifyingtherealpath,ornulliftheURLdoesnothaveanyextrapathinformation
getContextPath
publicjava.lang.StringgetContextPath()
ReturnstheportionoftherequestURIthatindicatesthecontextoftherequest.ThecontextpathalwayscomesfirstinarequestURI.Thepathstartswitha"/"characterbutdoesnotendwitha"/"character.Forservletsinthedefault(root)context,thismethodreturns"".Thecontainerdoesnotdecodethisstring.Returns:
aStringspecifyingtheportionoftherequestURIthatindicatesthecontextoftherequest
getQueryString
publicjava.lang.StringgetQueryString()
ReturnsthequerystringthatiscontainedintherequestURLafterthepath.ThismethodreturnsnulliftheURLdoesnothaveaquerystring.SameasthevalueoftheCGIvariableQUERY_STRING.Returns:
aStringcontainingthequerystringornulliftheURLcontainsnoquerystring.Thevalueisnotdecodedbythecontainer.
getRemoteUser
publicjava.lang.StringgetRemoteUser()
Returnstheloginoftheusermakingthisrequest,iftheuserhasbeenauthenticated,ornulliftheuserhasnotbeenauthenticated.Whethertheusernameissentwitheachsubsequentrequestdependsonthebrowserandtypeofauthentication.SameasthevalueoftheCGIvariableREMOTE_USER.Returns:
aStringspecifyingtheloginoftheusermakingthisrequest,ornull
isUserInRole
publicbooleanisUserInRole(java.lang.Stringrole)
Returnsabooleanindicatingwhethertheauthenticateduserisincludedinthespecifiedlogical"role".Rolesandrolemembershipcanbedefinedusingdeploymentdescriptors.Iftheuserhasnotbeenauthenticated,themethodreturnsfalse.Parameters:
role-aStringspecifyingthenameoftheroleReturns:
abooleanindicatingwhethertheusermakingthisrequestbelongstoagivenrole;falseiftheuserhasnotbeenauthenticated
getUserPrincipal
publicjava.security.PrincipalgetUserPrincipal()
Returnsajava.security.Principalobjectcontainingthenameofthecurrentauthenticateduser.Iftheuserhasnotbeenauthenticated,themethodreturnsnull.Returns:
ajava.security.Principalcontainingthenameoftheusermakingthisrequest;nulliftheuserhasnotbeenauthenticated
getRequestedSessionId
publicjava.lang.StringgetRequestedSessionId()
ReturnsthesessionIDspecifiedbytheclient.ThismaynotbethesameastheIDoftheactualsessioninuse.Forexample,iftherequestspecifiedanold(expired)sessionIDandtheserverhasstartedanewsession,thismethodgetsanewsessionwithanewID.IftherequestdidnotspecifyasessionID,thismethodreturnsnull.Returns:
aStringspecifyingthesessionID,ornulliftherequestdidnotspecifyasessionID
SeeAlso:isRequestedSessionIdValid()
getRequestURI
publicjava.lang.StringgetRequestURI()
Returnsthepartofthisrequest'sURLfromtheprotocolnameuptothequerystringinthefirstlineoftheHTTPrequest.ThewebcontainerdoesnotdecodethisString.Forexample:FirstlineofHTTPrequest ReturnedValuePOST/some/path.htmlHTTP/1.1 /some/path.htmlGEThttp://foo.bar/a.htmlHTTP/1.0 /a.htmlHEAD/xyz?a=bHTTP/1.1 /xyz
ToreconstructanURLwithaschemeandhost,useHttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)
Returns:aStringcontainingthepartoftheURLfromtheprotocolnameuptothequerystring
SeeAlso:HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)
getRequestURL
publicjava.lang.StringBuffergetRequestURL()
ReconstructstheURLtheclientusedtomaketherequest.ThereturnedURLcontainsaprotocol,servername,portnumber,andserverpath,butitdoesnotincludequerystringparameters.
BecausethismethodreturnsaStringBuffer,notastring,youcanmodifytheURLeasily,forexample,toappendqueryparameters.
Thismethodisusefulforcreatingredirectmessagesandforreportingerrors.
Returns:aStringBufferobjectcontainingthereconstructedURL
getServletPath
publicjava.lang.StringgetServletPath()
Returnsthepartofthisrequest'sURLthatcallstheservlet.Thisincludeseithertheservletnameorapathtotheservlet,butdoesnotincludeanyextrapathinformationoraquerystring.SameasthevalueoftheCGIvariableSCRIPT_NAME.Returns:
aStringcontainingthenameorpathoftheservletbeingcalled,asspecifiedintherequestURL,decoded.
getSession
publicHttpSessiongetSession(booleancreate)
ReturnsthecurrentHttpSessionassociatedwiththisrequestor,ififthereisnocurrentsessionandcreateistrue,returnsanewsession.
IfcreateisfalseandtherequesthasnovalidHttpSession,thismethodreturnsnull.
Tomakesurethesessionisproperlymaintained,youmustcallthismethodbeforetheresponseiscommitted.Ifthecontainerisusingcookiestomaintainsessionintegrityandisaskedtocreateanewsessionwhentheresponseiscommitted,anIllegalStateExceptionisthrown.
Parameters:true-tocreateanewsessionforthisrequestifnecessary;falsetoreturnnullifthere'snocurrentsession
Returns:theHttpSessionassociatedwiththisrequestornullifcreateisfalseandtherequesthasnovalidsession
SeeAlso:getSession()
getSession
publicHttpSessiongetSession()
Returnsthecurrentsessionassociatedwiththisrequest,oriftherequestdoesnothaveasession,createsone.Returns:
theHttpSessionassociatedwiththisrequestSeeAlso:
getSession(boolean)
isRequestedSessionIdValid
publicbooleanisRequestedSessionIdValid()
CheckswhethertherequestedsessionIDisstillvalid.Returns:
trueifthisrequesthasanidforavalidsessioninthecurrent
sessioncontext;falseotherwiseSeeAlso:
getRequestedSessionId(),getSession(boolean),HttpSessionContext
isRequestedSessionIdFromCookie
publicbooleanisRequestedSessionIdFromCookie()
CheckswhethertherequestedsessionIDcameinasacookie.Returns:
trueifthesessionIDcameinasacookie;otherwise,falseSeeAlso:
getSession(boolean)
isRequestedSessionIdFromURL
publicbooleanisRequestedSessionIdFromURL()
CheckswhethertherequestedsessionIDcameinaspartoftherequestURL.Returns:
trueifthesessionIDcameinaspartofaURL;otherwise,falseSeeAlso:
getSession(boolean)
isRequestedSessionIdFromUrl
publicbooleanisRequestedSessionIdFromUrl()
Deprecated.AsofVersion2.1oftheJavaServletAPI,useisRequestedSessionIdFromURL()instead.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassHttpServletRequestWrapperjava.lang.Object
|
+--javax.servlet.ServletRequestWrapper
|
+--javax.servlet.http.HttpServletRequestWrapper
publicclassHttpServletRequestWrapperextendsServletRequestWrapperimplementsHttpServletRequest
ProvidesaconvenientimplementationoftheHttpServletRequestinterfacethatcanbesubclassedbydeveloperswishingtoadapttherequesttoaServlet.ThisclassimplementstheWrapperorDecoratorpattern.Methodsdefaulttocallingthroughtothewrappedrequestobject.
Since:v2.3
SeeAlso:HttpServletRequest
ConstructorSummaryHttpServletRequestWrapper(HttpServletRequestrequest)Constructsarequestobjectwrappingthegivenrequest.
MethodSummary
java.lang.String
getAuthType()ThedefaultbehaviorofthismethodistoreturngetAuthType()onthewrappedrequestobject.
java.lang.String
getContextPath()ThedefaultbehaviorofthismethodistoreturngetContextPath()onthewrappedrequestobject.getCookies()
Cookie[] ThedefaultbehaviorofthismethodistoreturngetCookies()onthewrappedrequestobject.
long
getDateHeader(java.lang.Stringname)ThedefaultbehaviorofthismethodistoreturngetDateHeader(Stringname)onthewrappedrequestobject.
java.lang.String
getHeader(java.lang.Stringname)ThedefaultbehaviorofthismethodistoreturngetHeader(Stringname)onthewrappedrequestobject.
java.util.Enumeration
getHeaderNames()ThedefaultbehaviorofthismethodistoreturngetHeaderNames()onthewrappedrequestobject.
java.util.Enumeration
getHeaders(java.lang.Stringname)ThedefaultbehaviorofthismethodistoreturngetHeaders(Stringname)onthewrappedrequestobject.
int
getIntHeader(java.lang.Stringname)ThedefaultbehaviorofthismethodistoreturngetIntHeader(Stringname)onthewrappedrequestobject.
java.lang.String
getMethod()ThedefaultbehaviorofthismethodistoreturngetMethod()onthewrappedrequestobject.
java.lang.String
getPathInfo()ThedefaultbehaviorofthismethodistoreturngetPathInfo()onthewrappedrequestobject.
java.lang.String
getPathTranslated()ThedefaultbehaviorofthismethodistoreturngetPathTranslated()onthewrappedrequestobject.
java.lang.String
getQueryString()ThedefaultbehaviorofthismethodistoreturngetQueryString()onthewrappedrequestobject.
java.lang.String
getRemoteUser()ThedefaultbehaviorofthismethodistoreturngetRemoteUser()onthewrappedrequestobject.
java.lang.String
getRequestedSessionId()
ThedefaultbehaviorofthismethodistoreturngetRequestedSessionId()onthewrappedrequestobject.
java.lang.String
getRequestURI()ThedefaultbehaviorofthismethodistoreturngetRequestURI()onthewrappedrequestobject.
java.lang.StringBuffer
getRequestURL()ThedefaultbehaviorofthismethodistoreturngetRequestURL()onthewrappedrequestobject.
java.lang.String
getServletPath()ThedefaultbehaviorofthismethodistoreturngetServletPath()onthewrappedrequestobject.
HttpSession
getSession()ThedefaultbehaviorofthismethodistoreturngetSession()onthewrappedrequestobject.
HttpSession
getSession(booleancreate)ThedefaultbehaviorofthismethodistoreturngetSession(booleancreate)onthewrappedrequestobject.
java.security.Principal
getUserPrincipal()ThedefaultbehaviorofthismethodistoreturngetUserPrincipal()onthewrappedrequestobject.
boolean
isRequestedSessionIdFromCookie()ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromCookie()onthewrappedrequestobject.
boolean
isRequestedSessionIdFromUrl()ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromUrl()onthewrappedrequestobject.
boolean
isRequestedSessionIdFromURL()ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromURL()onthewrappedrequestobject.
boolean
isRequestedSessionIdValid()ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdValid()onthewrappedrequest
object.
boolean
isUserInRole(java.lang.Stringrole)ThedefaultbehaviorofthismethodistoreturnisUserInRole(Stringrole)onthewrappedrequestobject.
Methodsinheritedfromclassjavax.servlet.ServletRequestWrappergetAttribute,getAttributeNames,getCharacterEncoding,
getContentLength,getContentType,getInputStream,getLocale,
getLocales,getParameter,getParameterMap,getParameterNames,
getParameterValues,getProtocol,getReader,getRealPath,
getRemoteAddr,getRemoteHost,getRequest,getRequestDispatcher,
getScheme,getServerName,getServerPort,isSecure,
removeAttribute,setAttribute,setCharacterEncoding,setRequest
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
HttpServletRequestWrapper
publicHttpServletRequestWrapper(HttpServletRequestrequest)
Constructsarequestobjectwrappingthegivenrequest.Throws:
java.lang.IllegalArgumentException-iftherequestisnull
MethodDetail
getAuthType
publicjava.lang.StringgetAuthType()
ThedefaultbehaviorofthismethodistoreturngetAuthType()onthewrappedrequestobject.
Specifiedby:getAuthTypeininterfaceHttpServletRequest
getCookies
publicCookie[]getCookies()
ThedefaultbehaviorofthismethodistoreturngetCookies()onthewrappedrequestobject.Specifiedby:
getCookiesininterfaceHttpServletRequest
getDateHeader
publiclonggetDateHeader(java.lang.Stringname)
ThedefaultbehaviorofthismethodistoreturngetDateHeader(Stringname)onthewrappedrequestobject.Specifiedby:
getDateHeaderininterfaceHttpServletRequest
getHeader
publicjava.lang.StringgetHeader(java.lang.Stringname)
ThedefaultbehaviorofthismethodistoreturngetHeader(Stringname)onthewrappedrequestobject.Specifiedby:
getHeaderininterfaceHttpServletRequest
getHeaders
publicjava.util.EnumerationgetHeaders(java.lang.Stringname)
ThedefaultbehaviorofthismethodistoreturngetHeaders(Stringname)on
thewrappedrequestobject.Specifiedby:
getHeadersininterfaceHttpServletRequest
getHeaderNames
publicjava.util.EnumerationgetHeaderNames()
ThedefaultbehaviorofthismethodistoreturngetHeaderNames()onthewrappedrequestobject.Specifiedby:
getHeaderNamesininterfaceHttpServletRequest
getIntHeader
publicintgetIntHeader(java.lang.Stringname)
ThedefaultbehaviorofthismethodistoreturngetIntHeader(Stringname)onthewrappedrequestobject.Specifiedby:
getIntHeaderininterfaceHttpServletRequest
getMethod
publicjava.lang.StringgetMethod()
ThedefaultbehaviorofthismethodistoreturngetMethod()onthewrappedrequestobject.Specifiedby:
getMethodininterfaceHttpServletRequest
getPathInfo
publicjava.lang.StringgetPathInfo()
ThedefaultbehaviorofthismethodistoreturngetPathInfo()onthewrappedrequestobject.Specifiedby:
getPathInfoininterfaceHttpServletRequest
getPathTranslated
publicjava.lang.StringgetPathTranslated()
ThedefaultbehaviorofthismethodistoreturngetPathTranslated()onthewrappedrequestobject.Specifiedby:
getPathTranslatedininterfaceHttpServletRequest
getContextPath
publicjava.lang.StringgetContextPath()
ThedefaultbehaviorofthismethodistoreturngetContextPath()onthewrappedrequestobject.Specifiedby:
getContextPathininterfaceHttpServletRequest
getQueryString
publicjava.lang.StringgetQueryString()
ThedefaultbehaviorofthismethodistoreturngetQueryString()onthewrappedrequestobject.Specifiedby:
getQueryStringininterfaceHttpServletRequest
getRemoteUser
publicjava.lang.StringgetRemoteUser()
ThedefaultbehaviorofthismethodistoreturngetRemoteUser()onthewrappedrequestobject.Specifiedby:
getRemoteUserininterfaceHttpServletRequest
isUserInRole
publicbooleanisUserInRole(java.lang.Stringrole)
ThedefaultbehaviorofthismethodistoreturnisUserInRole(Stringrole)onthewrappedrequestobject.Specifiedby:
isUserInRoleininterfaceHttpServletRequest
getUserPrincipal
publicjava.security.PrincipalgetUserPrincipal()
ThedefaultbehaviorofthismethodistoreturngetUserPrincipal()onthewrappedrequestobject.Specifiedby:
getUserPrincipalininterfaceHttpServletRequest
getRequestedSessionId
publicjava.lang.StringgetRequestedSessionId()
ThedefaultbehaviorofthismethodistoreturngetRequestedSessionId()onthewrappedrequestobject.Specifiedby:
getRequestedSessionIdininterfaceHttpServletRequest
getRequestURI
publicjava.lang.StringgetRequestURI()
ThedefaultbehaviorofthismethodistoreturngetRequestURI()onthewrappedrequestobject.Specifiedby:
getRequestURIininterfaceHttpServletRequest
getRequestURL
publicjava.lang.StringBuffergetRequestURL()
ThedefaultbehaviorofthismethodistoreturngetRequestURL()onthewrappedrequestobject.Specifiedby:
getRequestURLininterfaceHttpServletRequest
getServletPath
publicjava.lang.StringgetServletPath()
ThedefaultbehaviorofthismethodistoreturngetServletPath()onthewrappedrequestobject.Specifiedby:
getServletPathininterfaceHttpServletRequest
getSession
publicHttpSessiongetSession(booleancreate)
ThedefaultbehaviorofthismethodistoreturngetSession(booleancreate)onthewrappedrequestobject.Specifiedby:
getSessionininterfaceHttpServletRequest
getSession
publicHttpSessiongetSession()
ThedefaultbehaviorofthismethodistoreturngetSession()onthewrappedrequestobject.Specifiedby:
getSessionininterfaceHttpServletRequest
isRequestedSessionIdValid
publicbooleanisRequestedSessionIdValid()
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdValid()onthewrappedrequestobject.Specifiedby:
isRequestedSessionIdValidininterfaceHttpServletRequest
isRequestedSessionIdFromCookie
publicbooleanisRequestedSessionIdFromCookie()
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromCookie()onthewrappedrequestobject.Specifiedby:
isRequestedSessionIdFromCookieininterfaceHttpServletRequest
isRequestedSessionIdFromURL
publicbooleanisRequestedSessionIdFromURL()
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromURL()onthewrappedrequestobject.Specifiedby:
isRequestedSessionIdFromURLininterfaceHttpServletRequest
isRequestedSessionIdFromUrl
publicbooleanisRequestedSessionIdFromUrl()
ThedefaultbehaviorofthismethodistoreturnisRequestedSessionIdFromUrl()onthewrappedrequestobject.Specifiedby:
isRequestedSessionIdFromUrlininterfaceHttpServletRequest
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpServletResponse
AllKnownImplementingClasses:HttpServletResponseWrapper
publicabstractinterfaceHttpServletResponseextendsServletResponse
ExtendstheServletResponseinterfacetoprovideHTTP-specificfunctionalityinsendingaresponse.Forexample,ithasmethodstoaccessHTTPheadersandcookies.
TheservletcontainercreatesanHttpServletRequestobjectandpassesitasanargumenttotheservlet'sservicemethods(doGet,doPost,etc).
SeeAlso:ServletResponse
FieldSummary
staticint
SC_ACCEPTEDStatuscode(202)indicatingthatarequestwasacceptedforprocessing,butwasnotcompleted.
staticint
SC_BAD_GATEWAYStatuscode(502)indicatingthattheHTTPserverreceivedaninvalidresponsefromaserveritconsultedwhenactingasaproxyorgateway.
staticint
SC_BAD_REQUESTStatuscode(400)indicatingtherequestsentbytheclientwassyntacticallyincorrect.
staticint
SC_CONFLICTStatuscode(409)indicatingthattherequestcouldnotbecompletedduetoaconflictwiththecurrentstateoftheresource.
staticintSC_CONTINUEStatuscode(100)indicatingtheclientcancontinue.
staticint
SC_CREATEDStatuscode(201)indicatingtherequestsucceededandcreatedanewresourceontheserver.
staticint
SC_EXPECTATION_FAILEDStatuscode(417)indicatingthattheservercouldnotmeettheexpectationgivenintheExpectrequestheader.
staticint
SC_FORBIDDENStatuscode(403)indicatingtheserverunderstoodtherequestbutrefusedtofulfillit.
staticint
SC_GATEWAY_TIMEOUTStatuscode(504)indicatingthattheserverdidnotreceiveatimelyresponsefromtheupstreamserverwhileactingasagatewayorproxy.
staticint
SC_GONEStatuscode(410)indicatingthattheresourceisnolongeravailableattheserverandnoforwardingaddressisknown.
staticint
SC_HTTP_VERSION_NOT_SUPPORTEDStatuscode(505)indicatingthattheserverdoesnotsupportorrefusestosupporttheHTTPprotocolversionthatwasusedintherequestmessage.
staticint
SC_INTERNAL_SERVER_ERRORStatuscode(500)indicatinganerrorinsidetheHTTPserverwhichpreventeditfromfulfillingtherequest.
staticint
SC_LENGTH_REQUIREDStatuscode(411)indicatingthattherequestcannotbehandledwithoutadefinedContent-Length.
staticint
SC_METHOD_NOT_ALLOWEDStatuscode(405)indicatingthatthemethodspecifiedintheRequest-LineisnotallowedfortheresourceidentifiedbytheRequest-URI.
staticint
SC_MOVED_PERMANENTLYStatuscode(301)indicatingthattheresourcehaspermanentlymovedtoanewlocation,andthatfuturereferencesshoulduseanewURIwiththeirrequests.SC_MOVED_TEMPORARILYStatuscode(302)indicatingthattheresourcehastemporarily
staticint movedtoanotherlocation,butthatfuturereferencesshouldstillusetheoriginalURItoaccesstheresource.
staticint
SC_MULTIPLE_CHOICESStatuscode(300)indicatingthattherequestedresourcecorrespondstoanyoneofasetofrepresentations,eachwithitsownspecificlocation.
staticint
SC_NO_CONTENTStatuscode(204)indicatingthattherequestsucceededbutthattherewasnonewinformationtoreturn.
staticint
SC_NON_AUTHORITATIVE_INFORMATIONStatuscode(203)indicatingthatthemetainformationpresentedbytheclientdidnotoriginatefromtheserver.
staticint
SC_NOT_ACCEPTABLEStatuscode(406)indicatingthattheresourceidentifiedbytherequestisonlycapableofgeneratingresponseentitieswhichhavecontentcharacteristicsnotacceptableaccordingtotheacceptheaderssentintherequest.
staticint
SC_NOT_FOUNDStatuscode(404)indicatingthattherequestedresourceisnotavailable.
staticint
SC_NOT_IMPLEMENTEDStatuscode(501)indicatingtheHTTPserverdoesnotsupportthefunctionalityneededtofulfilltherequest.
staticint
SC_NOT_MODIFIEDStatuscode(304)indicatingthataconditionalGEToperationfoundthattheresourcewasavailableandnotmodified.
staticintSC_OKStatuscode(200)indicatingtherequestsucceedednormally.
staticint
SC_PARTIAL_CONTENTStatuscode(206)indicatingthattheserverhasfulfilledthepartialGETrequestfortheresource.
staticintSC_PAYMENT_REQUIREDStatuscode(402)reservedforfutureuse.SC_PRECONDITION_FAILEDStatuscode(412)indicatingthatthepreconditiongiveninone
staticint ormoreoftherequest-headerfieldsevaluatedtofalsewhenitwastestedontheserver.
staticint
SC_PROXY_AUTHENTICATION_REQUIREDStatuscode(407)indicatingthattheclientMUSTfirstauthenticateitselfwiththeproxy.
staticint
SC_REQUEST_ENTITY_TOO_LARGEStatuscode(413)indicatingthattheserverisrefusingtoprocesstherequestbecausetherequestentityislargerthantheserveriswillingorabletoprocess.
staticint
SC_REQUEST_TIMEOUTStatuscode(408)indicatingthattheclientdidnotproducearequestwithinthetimethattheserverwaspreparedtowait.
staticint
SC_REQUEST_URI_TOO_LONGStatuscode(414)indicatingthattheserverisrefusingtoservicetherequestbecausetheRequest-URIislongerthantheserveriswillingtointerpret.
staticint
SC_REQUESTED_RANGE_NOT_SATISFIABLEStatuscode(416)indicatingthattheservercannotservetherequestedbyterange.
staticint
SC_RESET_CONTENTStatuscode(205)indicatingthattheagentSHOULDresetthedocumentviewwhichcausedtherequesttobesent.
staticint
SC_SEE_OTHERStatuscode(303)indicatingthattheresponsetotherequestcanbefoundunderadifferentURI.
staticint
SC_SERVICE_UNAVAILABLEStatuscode(503)indicatingthattheHTTPserveristemporarilyoverloaded,andunabletohandletherequest.
staticint
SC_SWITCHING_PROTOCOLSStatuscode(101)indicatingtheserverisswitchingprotocolsaccordingtoUpgradeheader.
staticint
SC_TEMPORARY_REDIRECTStatuscode(307)indicatingthattherequestedresourceresidestemporarilyunderadifferentURI.SC_UNAUTHORIZED
staticint Statuscode(401)indicatingthattherequestrequiresHTTPauthentication.
staticint
SC_UNSUPPORTED_MEDIA_TYPEStatuscode(415)indicatingthattheserverisrefusingtoservicetherequestbecausetheentityoftherequestisinaformatnotsupportedbytherequestedresourcefortherequestedmethod.
staticint
SC_USE_PROXYStatuscode(305)indicatingthattherequestedresourceMUSTbeaccessedthroughtheproxygivenbytheLocationfield.
MethodSummaryvoid
addCookie(Cookiecookie)Addsthespecifiedcookietotheresponse.
void
addDateHeader(java.lang.Stringname,longdate)Addsaresponseheaderwiththegivennameanddate-value.
void
addHeader(java.lang.Stringname,
java.lang.Stringvalue)Addsaresponseheaderwiththegivennameandvalue.
void
addIntHeader(java.lang.Stringname,intvalue)Addsaresponseheaderwiththegivennameandintegervalue.
boolean
containsHeader(java.lang.Stringname)Returnsabooleanindicatingwhetherthenamedresponseheaderhasalreadybeenset.
java.lang.String
encodeRedirectUrl(java.lang.Stringurl)Deprecated.Asofversion2.1,useencodeRedirectURL(Stringurl)instead
java.lang.String
encodeRedirectURL(java.lang.Stringurl)EncodesthespecifiedURLforuseinthesendRedirectmethodor,ifencodingisnotneeded,returnstheURLunchanged.
java.lang.String
encodeUrl(java.lang.Stringurl)Deprecated.Asofversion2.1,useencodeURL(String
url)instead
java.lang.String
encodeURL(java.lang.Stringurl)EncodesthespecifiedURLbyincludingthesessionIDinit,or,ifencodingisnotneeded,returnstheURLunchanged.
void
sendError(intsc)Sendsanerrorresponsetotheclientusingthespecifiedstatuscodeandclearingthebuffer.
void
sendError(intsc,java.lang.Stringmsg)Sendsanerrorresponsetotheclientusingthespecifiedstatusclearingthebuffer.
void
sendRedirect(java.lang.Stringlocation)SendsatemporaryredirectresponsetotheclientusingthespecifiedredirectlocationURL.
void
setDateHeader(java.lang.Stringname,longdate)Setsaresponseheaderwiththegivennameanddate-value.
void
setHeader(java.lang.Stringname,
java.lang.Stringvalue)Setsaresponseheaderwiththegivennameandvalue.
void
setIntHeader(java.lang.Stringname,intvalue)Setsaresponseheaderwiththegivennameandintegervalue.
voidsetStatus(intsc)Setsthestatuscodeforthisresponse.
void
setStatus(intsc,java.lang.Stringsm)Deprecated.Asofversion2.1,duetoambiguousmeaningofthemessageparameter.TosetastatuscodeusesetStatus(int),tosendanerrorwithadescriptionusesendError(int,String).Setsthestatuscodeandmessageforthisresponse.
Methodsinheritedfrominterfacejavax.servlet.ServletResponseflushBuffer,getBufferSize,getCharacterEncoding,getLocale,
getOutputStream,getWriter,isCommitted,reset,resetBuffer,
setBufferSize,setContentLength,setContentType,setLocale
FieldDetail
SC_CONTINUE
publicstaticfinalintSC_CONTINUE
Statuscode(100)indicatingtheclientcancontinue.
SC_SWITCHING_PROTOCOLS
publicstaticfinalintSC_SWITCHING_PROTOCOLS
Statuscode(101)indicatingtheserverisswitchingprotocolsaccordingtoUpgradeheader.
SC_OK
publicstaticfinalintSC_OK
Statuscode(200)indicatingtherequestsucceedednormally.
SC_CREATED
publicstaticfinalintSC_CREATED
Statuscode(201)indicatingtherequestsucceededandcreatedanewresourceontheserver.
SC_ACCEPTED
publicstaticfinalintSC_ACCEPTED
Statuscode(202)indicatingthatarequestwasacceptedforprocessing,butwasnotcompleted.
SC_NON_AUTHORITATIVE_INFORMATION
publicstaticfinalintSC_NON_AUTHORITATIVE_INFORMATION
Statuscode(203)indicatingthatthemetainformationpresentedbytheclientdidnotoriginatefromtheserver.
SC_NO_CONTENT
publicstaticfinalintSC_NO_CONTENT
Statuscode(204)indicatingthattherequestsucceededbutthattherewasnonewinformationtoreturn.
SC_RESET_CONTENT
publicstaticfinalintSC_RESET_CONTENT
Statuscode(205)indicatingthattheagentSHOULDresetthedocumentviewwhichcausedtherequesttobesent.
SC_PARTIAL_CONTENT
publicstaticfinalintSC_PARTIAL_CONTENT
Statuscode(206)indicatingthattheserverhasfulfilledthepartialGETrequestfortheresource.
SC_MULTIPLE_CHOICES
publicstaticfinalintSC_MULTIPLE_CHOICES
Statuscode(300)indicatingthattherequestedresourcecorrespondstoanyoneofasetofrepresentations,eachwithitsownspecificlocation.
SC_MOVED_PERMANENTLY
publicstaticfinalintSC_MOVED_PERMANENTLY
Statuscode(301)indicatingthattheresourcehaspermanentlymovedtoanewlocation,andthatfuturereferencesshoulduseanewURIwiththeirrequests.
SC_MOVED_TEMPORARILY
publicstaticfinalintSC_MOVED_TEMPORARILY
Statuscode(302)indicatingthattheresourcehastemporarilymovedtoanotherlocation,butthatfuturereferencesshouldstillusetheoriginalURItoaccesstheresource.
SC_SEE_OTHER
publicstaticfinalintSC_SEE_OTHER
Statuscode(303)indicatingthattheresponsetotherequestcanbefoundunderadifferentURI.
SC_NOT_MODIFIED
publicstaticfinalintSC_NOT_MODIFIED
Statuscode(304)indicatingthataconditionalGEToperationfoundthattheresourcewasavailableandnotmodified.
SC_USE_PROXY
publicstaticfinalintSC_USE_PROXY
Statuscode(305)indicatingthattherequestedresourceMUSTbeaccessedthroughtheproxygivenbytheLocationfield.
SC_TEMPORARY_REDIRECT
publicstaticfinalintSC_TEMPORARY_REDIRECT
Statuscode(307)indicatingthattherequestedresourceresidestemporarilyunderadifferentURI.ThetemporaryURISHOULDbegivenbytheLocationfieldintheresponse.
SC_BAD_REQUEST
publicstaticfinalintSC_BAD_REQUEST
Statuscode(400)indicatingtherequestsentbytheclientwassyntacticallyincorrect.
SC_UNAUTHORIZED
publicstaticfinalintSC_UNAUTHORIZED
Statuscode(401)indicatingthattherequestrequiresHTTPauthentication.
SC_PAYMENT_REQUIRED
publicstaticfinalintSC_PAYMENT_REQUIRED
Statuscode(402)reservedforfutureuse.
SC_FORBIDDEN
publicstaticfinalintSC_FORBIDDEN
Statuscode(403)indicatingtheserverunderstoodtherequestbutrefusedtofulfillit.
SC_NOT_FOUND
publicstaticfinalintSC_NOT_FOUND
Statuscode(404)indicatingthattherequestedresourceisnotavailable.
SC_METHOD_NOT_ALLOWED
publicstaticfinalintSC_METHOD_NOT_ALLOWED
Statuscode(405)indicatingthatthemethodspecifiedintheRequest-LineisnotallowedfortheresourceidentifiedbytheRequest-URI.
SC_NOT_ACCEPTABLE
publicstaticfinalintSC_NOT_ACCEPTABLE
Statuscode(406)indicatingthattheresourceidentifiedbytherequestisonlycapableofgeneratingresponseentitieswhichhavecontentcharacteristicsnotacceptableaccordingtotheacceptheaderssentintherequest.
SC_PROXY_AUTHENTICATION_REQUIRED
publicstaticfinalintSC_PROXY_AUTHENTICATION_REQUIRED
Statuscode(407)indicatingthattheclientMUSTfirstauthenticateitselfwiththeproxy.
SC_REQUEST_TIMEOUT
publicstaticfinalintSC_REQUEST_TIMEOUT
Statuscode(408)indicatingthattheclientdidnotproducearequestwithinthetimethattheserverwaspreparedtowait.
SC_CONFLICT
publicstaticfinalintSC_CONFLICT
Statuscode(409)indicatingthattherequestcouldnotbecompletedduetoaconflictwiththecurrentstateoftheresource.
SC_GONE
publicstaticfinalintSC_GONE
Statuscode(410)indicatingthattheresourceisnolongeravailableattheserverandnoforwardingaddressisknown.ThisconditionSHOULDbeconsideredpermanent.
SC_LENGTH_REQUIRED
publicstaticfinalintSC_LENGTH_REQUIRED
Statuscode(411)indicatingthattherequestcannotbehandledwithoutadefinedContent-Length.
SC_PRECONDITION_FAILED
publicstaticfinalintSC_PRECONDITION_FAILED
Statuscode(412)indicatingthatthepreconditiongiveninoneormoreoftherequest-headerfieldsevaluatedtofalsewhenitwastestedontheserver.
SC_REQUEST_ENTITY_TOO_LARGE
publicstaticfinalintSC_REQUEST_ENTITY_TOO_LARGE
Statuscode(413)indicatingthattheserverisrefusingtoprocesstherequestbecausetherequestentityislargerthantheserveriswillingorableto
process.
SC_REQUEST_URI_TOO_LONG
publicstaticfinalintSC_REQUEST_URI_TOO_LONG
Statuscode(414)indicatingthattheserverisrefusingtoservicetherequestbecausetheRequest-URIislongerthantheserveriswillingtointerpret.
SC_UNSUPPORTED_MEDIA_TYPE
publicstaticfinalintSC_UNSUPPORTED_MEDIA_TYPE
Statuscode(415)indicatingthattheserverisrefusingtoservicetherequestbecausetheentityoftherequestisinaformatnotsupportedbytherequestedresourcefortherequestedmethod.
SC_REQUESTED_RANGE_NOT_SATISFIABLE
publicstaticfinalintSC_REQUESTED_RANGE_NOT_SATISFIABLE
Statuscode(416)indicatingthattheservercannotservetherequestedbyterange.
SC_EXPECTATION_FAILED
publicstaticfinalintSC_EXPECTATION_FAILED
Statuscode(417)indicatingthattheservercouldnotmeettheexpectationgivenintheExpectrequestheader.
SC_INTERNAL_SERVER_ERROR
publicstaticfinalintSC_INTERNAL_SERVER_ERROR
Statuscode(500)indicatinganerrorinsidetheHTTPserverwhichpreventeditfromfulfillingtherequest.
SC_NOT_IMPLEMENTED
publicstaticfinalintSC_NOT_IMPLEMENTED
Statuscode(501)indicatingtheHTTPserverdoesnotsupportthefunctionalityneededtofulfilltherequest.
SC_BAD_GATEWAY
publicstaticfinalintSC_BAD_GATEWAY
Statuscode(502)indicatingthattheHTTPserverreceivedaninvalidresponsefromaserveritconsultedwhenactingasaproxyorgateway.
SC_SERVICE_UNAVAILABLE
publicstaticfinalintSC_SERVICE_UNAVAILABLE
Statuscode(503)indicatingthattheHTTPserveristemporarilyoverloaded,andunabletohandletherequest.
SC_GATEWAY_TIMEOUT
publicstaticfinalintSC_GATEWAY_TIMEOUT
Statuscode(504)indicatingthattheserverdidnotreceiveatimelyresponsefromtheupstreamserverwhileactingasagatewayorproxy.
SC_HTTP_VERSION_NOT_SUPPORTED
publicstaticfinalintSC_HTTP_VERSION_NOT_SUPPORTED
Statuscode(505)indicatingthattheserverdoesnotsupportorrefusestosupporttheHTTPprotocolversionthatwasusedintherequestmessage.
MethodDetail
addCookie
publicvoidaddCookie(Cookiecookie)
Addsthespecifiedcookietotheresponse.Thismethodcanbecalledmultipletimestosetmorethanonecookie.Parameters:
cookie-theCookietoreturntotheclient
containsHeader
publicbooleancontainsHeader(java.lang.Stringname)
Returnsabooleanindicatingwhetherthenamedresponseheaderhasalreadybeenset.Parameters:
name-theheadernameReturns:
trueifthenamedresponseheaderhasalreadybeenset;falseotherwise
encodeURL
publicjava.lang.StringencodeURL(java.lang.Stringurl)
EncodesthespecifiedURLbyincludingthesessionIDinit,or,ifencodingisnotneeded,returnstheURLunchanged.TheimplementationofthismethodincludesthelogictodeterminewhetherthesessionIDneedstobeencodedintheURL.Forexample,ifthebrowsersupportscookies,orsessiontrackingisturnedoff,URLencodingisunnecessary.
Forrobustsessiontracking,allURLsemittedbyaservletshouldberun
throughthismethod.Otherwise,URLrewritingcannotbeusedwithbrowserswhichdonotsupportcookies.
Parameters:url-theurltobeencoded.
Returns:theencodedURLifencodingisneeded;theunchangedURLotherwise.
encodeRedirectURL
publicjava.lang.StringencodeRedirectURL(java.lang.Stringurl)
EncodesthespecifiedURLforuseinthesendRedirectmethodor,ifencodingisnotneeded,returnstheURLunchanged.TheimplementationofthismethodincludesthelogictodeterminewhetherthesessionIDneedstobeencodedintheURL.Becausetherulesformakingthisdeterminationcandifferfromthoseusedtodecidewhethertoencodeanormallink,thismethodisseperatefromtheencodeURLmethod.
AllURLssenttotheHttpServletResponse.sendRedirectmethodshouldberunthroughthismethod.Otherwise,URLrewritingcannotbeusedwithbrowserswhichdonotsupportcookies.
Parameters:url-theurltobeencoded.
Returns:theencodedURLifencodingisneeded;theunchangedURLotherwise.
SeeAlso:sendRedirect(java.lang.String),encodeUrl(java.lang.String)
encodeUrl
publicjava.lang.StringencodeUrl(java.lang.Stringurl)
Deprecated.Asofversion2.1,useencodeURL(Stringurl)instead
Parameters:url-theurltobeencoded.
Returns:theencodedURLifencodingisneeded;theunchangedURLotherwise.
encodeRedirectUrl
publicjava.lang.StringencodeRedirectUrl(java.lang.Stringurl)
Deprecated.Asofversion2.1,useencodeRedirectURL(Stringurl)insteadParameters:
url-theurltobeencoded.Returns:
theencodedURLifencodingisneeded;theunchangedURLotherwise.
sendError
publicvoidsendError(intsc,
java.lang.Stringmsg)
throwsjava.io.IOException
Sendsanerrorresponsetotheclientusingthespecifiedstatusclearingthebuffer.TheserverdefaultstocreatingtheresponsetolooklikeanHTML-formattedservererrorpagecontainingthespecifiedmessage,settingthecontenttypeto"text/html",leavingcookiesandotherheadersunmodified.Ifanerror-pagedeclarationhasbeenmadeforthewebapplicationcorrespondingtothestatuscodepassedin,itwillbeservedbackinpreferencetothesuggestedmsgparameter.
Iftheresponsehasalreadybeencommitted,thismethodthrowsanIllegalStateException.Afterusingthismethod,theresponseshouldbeconsideredtobecommittedandshouldnotbewrittento.
Parameters:sc-theerrorstatuscodemsg-thedescriptivemessage
Throws:java.io.IOException-IfaninputoroutputexceptionoccursIllegalStateException-Iftheresponsewascommitted
sendError
publicvoidsendError(intsc)
throwsjava.io.IOException
Sendsanerrorresponsetotheclientusingthespecifiedstatuscodeandclearingthebuffer.
Iftheresponsehasalreadybeencommitted,thismethodthrowsanIllegalStateException.Afterusingthismethod,theresponseshouldbeconsideredtobecommittedandshouldnotbewrittento.
Parameters:sc-theerrorstatuscode
Throws:java.io.IOException-IfaninputoroutputexceptionoccursIllegalStateException-Iftheresponsewascommittedbeforethismethodcall
sendRedirect
publicvoidsendRedirect(java.lang.Stringlocation)
throwsjava.io.IOException
SendsatemporaryredirectresponsetotheclientusingthespecifiedredirectlocationURL.ThismethodcanacceptrelativeURLs;theservletcontainermustconverttherelativeURLtoanabsoluteURLbeforesendingtheresponsetotheclient.Ifthelocationisrelativewithoutaleading'/'thecontainerinterpretsitasrelativetothecurrentrequestURI.Ifthelocationisrelativewithaleading'/'thecontainerinterpretsitasrelativetotheservletcontainerroot.
Iftheresponsehasalreadybeencommitted,thismethodthrowsanIllegalStateException.Afterusingthismethod,theresponseshouldbe
consideredtobecommittedandshouldnotbewrittento.
Parameters:location-theredirectlocationURL
Throws:java.io.IOException-IfaninputoroutputexceptionoccursIllegalStateException-Iftheresponsewascommitted
setDateHeader
publicvoidsetDateHeader(java.lang.Stringname,
longdate)
Setsaresponseheaderwiththegivennameanddate-value.Thedateisspecifiedintermsofmillisecondssincetheepoch.Iftheheaderhadalreadybeenset,thenewvalueoverwritesthepreviousone.ThecontainsHeadermethodcanbeusedtotestforthepresenceofaheaderbeforesettingitsvalue.Parameters:
name-thenameoftheheadertosetvalue-theassigneddatevalue
SeeAlso:containsHeader(java.lang.String),addDateHeader(java.lang.String,long)
addDateHeader
publicvoidaddDateHeader(java.lang.Stringname,
longdate)
Addsaresponseheaderwiththegivennameanddate-value.Thedateisspecifiedintermsofmillisecondssincetheepoch.Thismethodallowsresponseheaderstohavemultiplevalues.Parameters:
name-thenameoftheheadertosetvalue-theadditionaldatevalue
SeeAlso:setDateHeader(java.lang.String,long)
setHeader
publicvoidsetHeader(java.lang.Stringname,
java.lang.Stringvalue)
Setsaresponseheaderwiththegivennameandvalue.Iftheheaderhadalreadybeenset,thenewvalueoverwritesthepreviousone.ThecontainsHeadermethodcanbeusedtotestforthepresenceofaheaderbeforesettingitsvalue.Parameters:
name-thenameoftheheadervalue-theheadervalue
SeeAlso:containsHeader(java.lang.String),addHeader(java.lang.String,java.lang.String)
addHeader
publicvoidaddHeader(java.lang.Stringname,
java.lang.Stringvalue)
Addsaresponseheaderwiththegivennameandvalue.Thismethodallowsresponseheaderstohavemultiplevalues.Parameters:
name-thenameoftheheadervalue-theadditionalheadervalue
SeeAlso:setHeader(java.lang.String,java.lang.String)
setIntHeader
publicvoidsetIntHeader(java.lang.Stringname,
intvalue)
Setsaresponseheaderwiththegivennameandintegervalue.Iftheheaderhadalreadybeenset,thenewvalueoverwritesthepreviousone.ThecontainsHeadermethodcanbeusedtotestforthepresenceofaheader
beforesettingitsvalue.Parameters:
name-thenameoftheheadervalue-theassignedintegervalue
SeeAlso:containsHeader(java.lang.String),addIntHeader(java.lang.String,int)
addIntHeader
publicvoidaddIntHeader(java.lang.Stringname,
intvalue)
Addsaresponseheaderwiththegivennameandintegervalue.Thismethodallowsresponseheaderstohavemultiplevalues.Parameters:
name-thenameoftheheadervalue-theassignedintegervalue
SeeAlso:setIntHeader(java.lang.String,int)
setStatus
publicvoidsetStatus(intsc)
Setsthestatuscodeforthisresponse.Thismethodisusedtosetthereturnstatuscodewhenthereisnoerror(forexample,forthestatuscodesSC_OKorSC_MOVED_TEMPORARILY).Ifthereisanerror,andthecallerwishestoinvokeandefinedinthewebapplicaion,thesendErrormethodshouldbeusedinstead.
ThecontainerclearsthebufferandsetstheLocationheader,preservingcookiesandotherheaders.
Parameters:sc-thestatuscode
SeeAlso:sendError(int,java.lang.String)
setStatus
publicvoidsetStatus(intsc,
java.lang.Stringsm)
Deprecated.Asofversion2.1,duetoambiguousmeaningofthemessageparameter.TosetastatuscodeusesetStatus(int),tosendanerrorwithadescriptionusesendError(int,String).Setsthestatuscodeandmessageforthisresponse.Parameters:
sc-thestatuscodesm-thestatusmessage
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassHttpServletResponseWrapperjava.lang.Object
|
+--javax.servlet.ServletResponseWrapper
|
+--javax.servlet.http.HttpServletResponseWrapper
publicclassHttpServletResponseWrapperextendsServletResponseWrapperimplementsHttpServletResponse
ProvidesaconvenientimplementationoftheHttpServletResponseinterfacethatcanbesubclassedbydeveloperswishingtoadapttheresponsefromaServlet.ThisclassimplementstheWrapperorDecoratorpattern.Methodsdefaulttocallingthroughtothewrappedresponseobject.
Since:v2.3
SeeAlso:HttpServletResponse
ConstructorSummaryHttpServletResponseWrapper(HttpServletResponseresponse)Constructsaresponseadaptorwrappingthegivenresponse.
MethodSummary
void
addCookie(Cookiecookie)ThedefaultbehaviorofthismethodistocalladdCookie(Cookiecookie)onthewrappedresponseobject.
void
addDateHeader(java.lang.Stringname,longdate)ThedefaultbehaviorofthismethodistocalladdDateHeader(Stringname,longdate)onthewrappedresponseobject.addHeader(java.lang.Stringname,
void
java.lang.Stringvalue)ThedefaultbehaviorofthismethodistoreturnaddHeader(Stringname,Stringvalue)onthewrappedresponseobject.
void
addIntHeader(java.lang.Stringname,intvalue)ThedefaultbehaviorofthismethodistocalladdIntHeader(Stringname,intvalue)onthewrappedresponseobject.
boolean
containsHeader(java.lang.Stringname)ThedefaultbehaviorofthismethodistocallcontainsHeader(Stringname)onthewrappedresponseobject.
java.lang.String
encodeRedirectUrl(java.lang.Stringurl)ThedefaultbehaviorofthismethodistoreturnencodeRedirectUrl(Stringurl)onthewrappedresponseobject.
java.lang.String
encodeRedirectURL(java.lang.Stringurl)ThedefaultbehaviorofthismethodistoreturnencodeRedirectURL(Stringurl)onthewrappedresponseobject.
java.lang.String
encodeUrl(java.lang.Stringurl)ThedefaultbehaviorofthismethodistocallencodeUrl(Stringurl)onthewrappedresponseobject.
java.lang.String
encodeURL(java.lang.Stringurl)ThedefaultbehaviorofthismethodistocallencodeURL(Stringurl)onthewrappedresponseobject.
void
sendError(intsc)ThedefaultbehaviorofthismethodistocallsendError(intsc)onthewrappedresponseobject.
void
sendError(intsc,java.lang.Stringmsg)ThedefaultbehaviorofthismethodistocallsendError(intsc,Stringmsg)onthewrappedresponseobject.
void
sendRedirect(java.lang.Stringlocation)ThedefaultbehaviorofthismethodistoreturnsendRedirect(Stringlocation)onthewrappedresponseobject.
void
setDateHeader(java.lang.Stringname,longdate)ThedefaultbehaviorofthismethodistocallsetDateHeader(Stringname,longdate)onthewrapped
responseobject.
void
setHeader(java.lang.Stringname,
java.lang.Stringvalue)ThedefaultbehaviorofthismethodistoreturnsetHeader(Stringname,Stringvalue)onthewrappedresponseobject.
void
setIntHeader(java.lang.Stringname,intvalue)ThedefaultbehaviorofthismethodistocallsetIntHeader(Stringname,intvalue)onthewrappedresponseobject.
void
setStatus(intsc)ThedefaultbehaviorofthismethodistocallsetStatus(intsc)onthewrappedresponseobject.
void
setStatus(intsc,java.lang.Stringsm)ThedefaultbehaviorofthismethodistocallsetStatus(intsc,Stringsm)onthewrappedresponseobject.
Methodsinheritedfromclassjavax.servlet.ServletResponseWrapperflushBuffer,getBufferSize,getCharacterEncoding,getLocale,
getOutputStream,getResponse,getWriter,isCommitted,reset,
resetBuffer,setBufferSize,setContentLength,setContentType,
setLocale,setResponse
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
HttpServletResponseWrapper
publicHttpServletResponseWrapper(HttpServletResponseresponse)
Constructsaresponseadaptorwrappingthegivenresponse.Throws:
java.lang.IllegalArgumentException-iftheresponseisnull
MethodDetail
addCookie
publicvoidaddCookie(Cookiecookie)
ThedefaultbehaviorofthismethodistocalladdCookie(Cookiecookie)onthewrappedresponseobject.Specifiedby:
addCookieininterfaceHttpServletResponse
containsHeader
publicbooleancontainsHeader(java.lang.Stringname)
ThedefaultbehaviorofthismethodistocallcontainsHeader(Stringname)onthewrappedresponseobject.Specifiedby:
containsHeaderininterfaceHttpServletResponse
encodeURL
publicjava.lang.StringencodeURL(java.lang.Stringurl)
ThedefaultbehaviorofthismethodistocallencodeURL(Stringurl)onthewrappedresponseobject.Specifiedby:
encodeURLininterfaceHttpServletResponse
encodeRedirectURL
publicjava.lang.StringencodeRedirectURL(java.lang.Stringurl)
ThedefaultbehaviorofthismethodistoreturnencodeRedirectURL(Stringurl)onthewrappedresponseobject.Specifiedby:
encodeRedirectURLininterfaceHttpServletResponse
encodeUrl
publicjava.lang.StringencodeUrl(java.lang.Stringurl)
ThedefaultbehaviorofthismethodistocallencodeUrl(Stringurl)onthewrappedresponseobject.Specifiedby:
encodeUrlininterfaceHttpServletResponse
encodeRedirectUrl
publicjava.lang.StringencodeRedirectUrl(java.lang.Stringurl)
ThedefaultbehaviorofthismethodistoreturnencodeRedirectUrl(Stringurl)onthewrappedresponseobject.Specifiedby:
encodeRedirectUrlininterfaceHttpServletResponse
sendError
publicvoidsendError(intsc,
java.lang.Stringmsg)
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistocallsendError(intsc,Stringmsg)onthewrappedresponseobject.Specifiedby:
sendErrorininterfaceHttpServletResponse
sendError
publicvoidsendError(intsc)
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistocallsendError(intsc)onthewrappedresponseobject.Specifiedby:
sendErrorininterfaceHttpServletResponse
sendRedirect
publicvoidsendRedirect(java.lang.Stringlocation)
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistoreturnsendRedirect(Stringlocation)onthewrappedresponseobject.Specifiedby:
sendRedirectininterfaceHttpServletResponse
setDateHeader
publicvoidsetDateHeader(java.lang.Stringname,
longdate)
ThedefaultbehaviorofthismethodistocallsetDateHeader(Stringname,longdate)onthewrappedresponseobject.Specifiedby:
setDateHeaderininterfaceHttpServletResponse
addDateHeader
publicvoidaddDateHeader(java.lang.Stringname,
longdate)
ThedefaultbehaviorofthismethodistocalladdDateHeader(Stringname,longdate)onthewrappedresponseobject.Specifiedby:
addDateHeaderininterfaceHttpServletResponse
setHeader
publicvoidsetHeader(java.lang.Stringname,
java.lang.Stringvalue)
ThedefaultbehaviorofthismethodistoreturnsetHeader(Stringname,Stringvalue)onthewrappedresponseobject.Specifiedby:
setHeaderininterfaceHttpServletResponse
addHeader
publicvoidaddHeader(java.lang.Stringname,
java.lang.Stringvalue)
ThedefaultbehaviorofthismethodistoreturnaddHeader(Stringname,Stringvalue)onthewrappedresponseobject.Specifiedby:
addHeaderininterfaceHttpServletResponse
setIntHeader
publicvoidsetIntHeader(java.lang.Stringname,
intvalue)
ThedefaultbehaviorofthismethodistocallsetIntHeader(Stringname,intvalue)onthewrappedresponseobject.Specifiedby:
setIntHeaderininterfaceHttpServletResponse
addIntHeader
publicvoidaddIntHeader(java.lang.Stringname,
intvalue)
ThedefaultbehaviorofthismethodistocalladdIntHeader(Stringname,intvalue)onthewrappedresponseobject.Specifiedby:
addIntHeaderininterfaceHttpServletResponse
setStatus
publicvoidsetStatus(intsc)
ThedefaultbehaviorofthismethodistocallsetStatus(intsc)onthewrappedresponseobject.Specifiedby:
setStatusininterfaceHttpServletResponse
setStatus
publicvoidsetStatus(intsc,
java.lang.Stringsm)
ThedefaultbehaviorofthismethodistocallsetStatus(intsc,Stringsm)onthewrappedresponseobject.Specifiedby:
setStatusininterfaceHttpServletResponse
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpSession
publicabstractinterfaceHttpSession
ProvidesawaytoidentifyauseracrossmorethanonepagerequestorvisittoaWebsiteandtostoreinformationaboutthatuser.
TheservletcontainerusesthisinterfacetocreateasessionbetweenanHTTPclientandanHTTPserver.Thesessionpersistsforaspecifiedtimeperiod,acrossmorethanoneconnectionorpagerequestfromtheuser.Asessionusuallycorrespondstooneuser,whomayvisitasitemanytimes.TheservercanmaintainasessioninmanywayssuchasusingcookiesorrewritingURLs.
Thisinterfaceallowsservletsto
Viewandmanipulateinformationaboutasession,suchasthesessionidentifier,creationtime,andlastaccessedtimeBindobjectstosessions,allowinguserinformationtopersistacrossmultipleuserconnections
Whenanapplicationstoresanobjectinorremovesanobjectfromasession,thesessioncheckswhethertheobjectimplementsHttpSessionBindingListener.Ifitdoes,theservletnotifiestheobjectthatithasbeenboundtoorunboundfromthesession.Notificationsaresentafterthebindingmethodscomplete.Forsessionthatareinvalidatedorexpire,notificationsaresentafterthesessionhasbeeninvalidatdorexpired.
WhencontainermigratesasessionbetweenVMsinadistributedcontainersetting,allsessionatributesimplementingtheHttpSessionActivationListenerinterfacearenotified.
Aservletshouldbeabletohandlecasesinwhichtheclientdoesnotchoosetojoinasession,suchaswhencookiesareintentionallyturnedoff.Untiltheclientjoinsthesession,isNewreturnstrue.Iftheclientchoosesnottojointhesession,getSessionwillreturnadifferentsessiononeachrequest,andisNewwillalwaysreturntrue.
Sessioninformationisscopedonlytothecurrentwebapplication(ServletContext),soinformationstoredinonecontextwillnotbedirectlyvisibleinanother.
SeeAlso:HttpSessionBindingListener,HttpSessionContext
MethodSummary
java.lang.Object
getAttribute(java.lang.Stringname)Returnstheobjectboundwiththespecifiednameinthissession,ornullifnoobjectisboundunderthename.
java.util.Enumeration
getAttributeNames()ReturnsanEnumerationofStringobjectscontainingthenamesofalltheobjectsboundtothissession.
long
getCreationTime()Returnsthetimewhenthissessionwascreated,measuredinmillisecondssincemidnightJanuary1,1970GMT.
java.lang.String
getId()Returnsastringcontainingtheuniqueidentifierassignedtothissession.
long
getLastAccessedTime()Returnsthelasttimetheclientsentarequestassociatedwiththissession,asthenumberofmillisecondssincemidnightJanuary1,1970GMT,andmarkedbythetimethecontainerrecievedtherequest.
int
getMaxInactiveInterval()Returnsthemaximumtimeinterval,inseconds,thattheservletcontainerwillkeepthissessionopenbetweenclientaccesses.
ServletContext
getServletContext()ReturnstheServletContexttowhichthissessionbelongs.getSessionContext()
HttpSessionContext Deprecated.AsofVersion2.1,thismethodisdeprecatedandhasnoreplacement.ItwillberemovedinafutureversionoftheJavaServletAPI.
java.lang.Object
getValue(java.lang.Stringname)Deprecated.AsofVersion2.2,thismethodisreplacedbygetAttribute(java.lang.String).
java.lang.String[]
getValueNames()Deprecated.AsofVersion2.2,thismethodisreplacedbygetAttributeNames()
void
invalidate()Invalidatesthissessionthenunbindsanyobjectsboundtoit.
boolean
isNew()Returnstrueiftheclientdoesnotyetknowaboutthesessionoriftheclientchoosesnottojointhesession.
void
putValue(java.lang.Stringname,
java.lang.Objectvalue)Deprecated.AsofVersion2.2,thismethodisreplacedbysetAttribute(java.lang.String,java.lang.Object)
void
removeAttribute(java.lang.Stringname)Removestheobjectboundwiththespecifiednamefromthissession.
void
removeValue(java.lang.Stringname)Deprecated.AsofVersion2.2,thismethodisreplacedbyremoveAttribute(java.lang.String)
void
setAttribute(java.lang.Stringname,
java.lang.Objectvalue)Bindsanobjecttothissession,usingthenamespecified.
void
setMaxInactiveInterval(intinterval)Specifiesthetime,inseconds,betweenclientrequestsbeforetheservletcontainerwillinvalidatethissession.
MethodDetail
getCreationTime
publiclonggetCreationTime()
Returnsthetimewhenthissessionwascreated,measuredinmillisecondssincemidnightJanuary1,1970GMT.Returns:
alongspecifyingwhenthissessionwascreated,expressedinmillisecondssince1/1/1970GMT
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
getId
publicjava.lang.StringgetId()
Returnsastringcontainingtheuniqueidentifierassignedtothissession.Theidentifierisassignedbytheservletcontainerandisimplementationdependent.Returns:
astringspecifyingtheidentifierassignedtothissession
getLastAccessedTime
publiclonggetLastAccessedTime()
Returnsthelasttimetheclientsentarequestassociatedwiththissession,asthenumberofmillisecondssincemidnightJanuary1,1970GMT,andmarkedbythetimethecontainerrecievedtherequest.
Actionsthatyourapplicationtakes,suchasgettingorsettingavalueassociatedwiththesession,donotaffecttheaccesstime.
Returns:
alongrepresentingthelasttimetheclientsentarequestassociatedwiththissession,expressedinmillisecondssince1/1/1970GMT
getServletContext
publicServletContextgetServletContext()
ReturnstheServletContexttowhichthissessionbelongs.Returns:
TheServletContextobjectforthewebapplicationSince:
2.3
setMaxInactiveInterval
publicvoidsetMaxInactiveInterval(intinterval)
Specifiesthetime,inseconds,betweenclientrequestsbeforetheservletcontainerwillinvalidatethissession.Anegativetimeindicatesthesessionshouldnevertimeout.Parameters:
interval-Anintegerspecifyingthenumberofseconds
getMaxInactiveInterval
publicintgetMaxInactiveInterval()
Returnsthemaximumtimeinterval,inseconds,thattheservletcontainerwillkeepthissessionopenbetweenclientaccesses.Afterthisinterval,theservletcontainerwillinvalidatethesession.ThemaximumtimeintervalcanbesetwiththesetMaxInactiveIntervalmethod.Anegativetimeindicatesthesessionshouldnevertimeout.Returns:
anintegerspecifyingthenumberofsecondsthissessionremainsopenbetweenclientrequests
SeeAlso:
setMaxInactiveInterval(int)
getSessionContext
publicHttpSessionContextgetSessionContext()
Deprecated.AsofVersion2.1,thismethodisdeprecatedandhasnoreplacement.ItwillberemovedinafutureversionoftheJavaServletAPI.
getAttribute
publicjava.lang.ObjectgetAttribute(java.lang.Stringname)
Returnstheobjectboundwiththespecifiednameinthissession,ornullifnoobjectisboundunderthename.Parameters:
name-astringspecifyingthenameoftheobjectReturns:
theobjectwiththespecifiednameThrows:
IllegalStateException-ifthismethodiscalledonaninvalidatedsession
getValue
publicjava.lang.ObjectgetValue(java.lang.Stringname)
Deprecated.AsofVersion2.2,thismethodisreplacedbygetAttribute(java.lang.String).Parameters:
name-astringspecifyingthenameoftheobjectReturns:
theobjectwiththespecifiednameThrows:
IllegalStateException-ifthismethodiscalledonaninvalidatedsession
getAttributeNames
publicjava.util.EnumerationgetAttributeNames()
ReturnsanEnumerationofStringobjectscontainingthenamesofalltheobjectsboundtothissession.Returns:
anEnumerationofStringobjectsspecifyingthenamesofalltheobjectsboundtothissession
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
getValueNames
publicjava.lang.String[]getValueNames()
Deprecated.AsofVersion2.2,thismethodisreplacedbygetAttributeNames()
Returns:anarrayofStringobjectsspecifyingthenamesofalltheobjectsboundtothissession
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
setAttribute
publicvoidsetAttribute(java.lang.Stringname,
java.lang.Objectvalue)
Bindsanobjecttothissession,usingthenamespecified.Ifanobjectofthesamenameisalreadyboundtothesession,theobjectisreplaced.
Afterthismethodexecutes,andifthenewobjectimplementsHttpSessionBindingListener,thecontainercallsHttpSessionBindingListener.valueBound.Thecontainerthennotifies
anyHttpSessionAttributeListenersinthewebapplication.
IfanobjectwasalreadyboundtothissessionofthisnamethatimplementsHttpSessionBindingListener,itsHttpSessionBindingListener.valueUnboundmethodiscalled.
Ifthevaluepassedinisnull,thishasthesameeffectascallingremoveAttribute().
Parameters:name-thenametowhichtheobjectisbound;cannotbenullvalue-theobjecttobebound
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
putValue
publicvoidputValue(java.lang.Stringname,
java.lang.Objectvalue)
Deprecated.AsofVersion2.2,thismethodisreplacedbysetAttribute(java.lang.String,java.lang.Object)
Parameters:name-thenametowhichtheobjectisbound;cannotbenullvalue-theobjecttobebound;cannotbenull
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
removeAttribute
publicvoidremoveAttribute(java.lang.Stringname)
Removestheobjectboundwiththespecifiednamefromthissession.Ifthesessiondoesnothaveanobjectboundwiththespecifiedname,thismethoddoesnothing.
Afterthismethodexecutes,andiftheobjectimplementsHttpSessionBindingListener,thecontainercallsHttpSessionBindingListener.valueUnbound.ThecontainerthennotifiesanyHttpSessionAttributeListenersinthewebapplication.
Parameters:name-thenameoftheobjecttoremovefromthissession
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
removeValue
publicvoidremoveValue(java.lang.Stringname)
Deprecated.AsofVersion2.2,thismethodisreplacedbyremoveAttribute(java.lang.String)
Parameters:name-thenameoftheobjecttoremovefromthissession
Throws:IllegalStateException-ifthismethodiscalledonaninvalidatedsession
invalidate
publicvoidinvalidate()
Invalidatesthissessionthenunbindsanyobjectsboundtoit.Throws:
IllegalStateException-ifthismethodiscalledonanalreadyinvalidatedsession
isNew
publicbooleanisNew()
Returnstrueiftheclientdoesnotyetknowaboutthesessionorifthe
clientchoosesnottojointhesession.Forexample,iftheserverusedonlycookie-basedsessions,andtheclienthaddisabledtheuseofcookies,thenasessionwouldbenewoneachrequest.Returns:
trueiftheserverhascreatedasession,buttheclienthasnotyetjoined
Throws:IllegalStateException-ifthismethodiscalledonanalreadyinvalidatedsession
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpSessionActivationListener
publicabstractinterfaceHttpSessionActivationListenerextendsjava.util.EventListener
Objectsthatareboundtoasessionmaylistentocontainereventsnotifyingthemthatsessionswillbepassivatedandthatsessionwillbeactivated.AcontainerthatmigratessessionbetweenVMsorpersistssessionsisrequiredtonotifyallattributesboundtosessionsimplementingHttpSessionActivationListener.
Since:2.3
MethodSummaryvoid
sessionDidActivate(HttpSessionEventse)Notificationthatthesessionhasjustbeenactivated.
voidsessionWillPassivate(HttpSessionEventse)Notificationthatthesessionisabouttobepassivated.
MethodDetail
sessionWillPassivate
publicvoidsessionWillPassivate(HttpSessionEventse)
Notificationthatthesessionisabouttobepassivated.
sessionDidActivate
publicvoidsessionDidActivate(HttpSessionEventse)
Notificationthatthesessionhasjustbeenactivated.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpSessionAttributeListener
publicabstractinterfaceHttpSessionAttributeListenerextendsjava.util.EventListener
Thislistenerinterfacecanbeimplementedinordertogetnotificationsofchangestotheattributelistsofsessionswithinthiswebapplication.
Since:v2.3
MethodSummaryvoid
attributeAdded(HttpSessionBindingEventse)Notificationthatanattributehasbeenaddedtoasession.
voidattributeRemoved(HttpSessionBindingEventse)Notificationthatanattributehasbeenremovedfromasession.
voidattributeReplaced(HttpSessionBindingEventse)Notificationthatanattributehasbeenreplacedinasession.
MethodDetail
attributeAdded
publicvoidattributeAdded(HttpSessionBindingEventse)
Notificationthatanattributehasbeenaddedtoasession.Calledaftertheattributeisadded.
attributeRemoved
publicvoidattributeRemoved(HttpSessionBindingEventse)
Notificationthatanattributehasbeenremovedfromasession.Calledaftertheattributeisremoved.
attributeReplaced
publicvoidattributeReplaced(HttpSessionBindingEventse)
Notificationthatanattributehasbeenreplacedinasession.Calledaftertheattributeisreplaced.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassHttpSessionBindingEventjava.lang.Object
|
+--java.util.EventObject
|
+--javax.servlet.http.HttpSessionEvent
|
+--javax.servlet.http.HttpSessionBindingEvent
publicclassHttpSessionBindingEventextendsHttpSessionEvent
EventsofthistypeareeithersenttoanobjectthatimplementsHttpSessionBindingListenerwhenitisboundorunboundfromasession,ortoaHttpSessionAttributeListenerthathasbeenconfiguredinthedeploymentdescriptorwhenanyattributeisbound,unboundorreplacedinasession.
ThesessionbindstheobjectbyacalltoHttpSession.setAttributeandunbindstheobjectbyacalltoHttpSession.removeAttribute.
SeeAlso:HttpSession,HttpSessionBindingListener,HttpSessionAttributeListener,SerializedForm
Fieldsinheritedfromclassjava.util.EventObjectsource
ConstructorSummaryHttpSessionBindingEvent(HttpSessionsession,
java.lang.Stringname)Constructsaneventthatnotifiesanobjectthatithasbeenboundtoorunboundfromasession.HttpSessionBindingEvent(HttpSessionsession,
java.lang.Stringname,java.lang.Objectvalue)
Constructsaneventthatnotifiesanobjectthatithasbeenboundtoorunboundfromasession.
MethodSummary
java.lang.String
getName()Returnsthenamewithwhichtheattributeisboundtoorunboundfromthesession.
HttpSessiongetSession()Returnthesessionthatchanged.
java.lang.Object
getValue()Returnsthevalueoftheattributethathasbeenadded,removedorreplaced.
Methodsinheritedfromclassjava.util.EventObjectgetSource,toString
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
wait,wait,wait
ConstructorDetail
HttpSessionBindingEvent
publicHttpSessionBindingEvent(HttpSessionsession,
java.lang.Stringname)
Constructsaneventthatnotifiesanobjectthatithasbeenboundtoorunboundfromasession.Toreceivetheevent,theobjectmustimplementHttpSessionBindingListener.Parameters:
session-thesessiontowhichtheobjectisboundorunboundname-thenamewithwhichtheobjectisboundorunbound
SeeAlso:getName(),getSession()
HttpSessionBindingEvent
publicHttpSessionBindingEvent(HttpSessionsession,
java.lang.Stringname,
java.lang.Objectvalue)
Constructsaneventthatnotifiesanobjectthatithasbeenboundtoorunboundfromasession.Toreceivetheevent,theobjectmustimplementHttpSessionBindingListener.Parameters:
session-thesessiontowhichtheobjectisboundorunboundname-thenamewithwhichtheobjectisboundorunbound
SeeAlso:getName(),getSession()
MethodDetail
getSession
publicHttpSessiongetSession()
Returnthesessionthatchanged.Overrides:
getSessioninclassHttpSessionEvent
getName
publicjava.lang.StringgetName()
Returnsthenamewithwhichtheattributeisboundtoorunboundfromthesession.Returns:
astringspecifyingthenamewithwhichtheobjectisboundtoorunboundfromthesession
getValue
publicjava.lang.ObjectgetValue()
Returnsthevalueoftheattributethathasbeenadded,removedorreplaced.Iftheattributewasadded(orbound),thisisthevalueoftheattribute.Iftheattrubutewasremoved(orunbound),thisisthevalueoftheremovedattribute.Iftheattributewasreplaced,thisistheoldvalueoftheattribute.Since:
2.3
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpSessionBindingListener
publicabstractinterfaceHttpSessionBindingListenerextendsjava.util.EventListener
Causesanobjecttobenotifiedwhenitisboundtoorunboundfromasession.TheobjectisnotifiedbyanHttpSessionBindingEventobject.Thismaybeasaresultofaservletprogrammerexplicitlyunbindinganattributefromasession,duetoasessionbeinginvalidated,orduetoasessiontimingout.
SeeAlso:HttpSession,HttpSessionBindingEvent
MethodSummary
void
valueBound(HttpSessionBindingEventevent)Notifiestheobjectthatitisbeingboundtoasessionandidentifiesthesession.
void
valueUnbound(HttpSessionBindingEventevent)Notifiestheobjectthatitisbeingunboundfromasessionandidentifiesthesession.
MethodDetail
valueBound
publicvoidvalueBound(HttpSessionBindingEventevent)
Notifiestheobjectthatitisbeingboundtoasessionandidentifiesthesession.Parameters:
event-theeventthatidentifiesthesessionSeeAlso:
valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
valueUnbound
publicvoidvalueUnbound(HttpSessionBindingEventevent)
Notifiestheobjectthatitisbeingunboundfromasessionandidentifiesthesession.Parameters:
event-theeventthatidentifiesthesessionSeeAlso:
valueBound(javax.servlet.http.HttpSessionBindingEvent)
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpSessionContext
Deprecated.AsofJava(tm)ServletAPI2.1forsecurityreasons,withnoreplacement.ThisinterfacewillberemovedinafutureversionofthisAPI.
publicabstractinterfaceHttpSessionContext
SeeAlso:HttpSession,HttpSessionBindingEvent,HttpSessionBindingListener
MethodSummary
java.util.Enumeration
getIds()Deprecated.AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnanemptyEnumerationandwillberemovedinafutureversionofthisAPI.
HttpSession
getSession(java.lang.StringsessionId)Deprecated.AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnnullandwillberemovedinafutureversionofthisAPI.
MethodDetail
getSession
publicHttpSessiongetSession(java.lang.StringsessionId)
Deprecated.AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnnullandwillberemovedinafutureversionofthisAPI.
getIds
publicjava.util.EnumerationgetIds()
Deprecated.AsofJavaServletAPI2.1withnoreplacement.ThismethodmustreturnanemptyEnumerationandwillberemovedinafutureversionofthisAPI.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassHttpSessionEventjava.lang.Object
|
+--java.util.EventObject
|
+--javax.servlet.http.HttpSessionEvent
DirectKnownSubclasses:HttpSessionBindingEvent
publicclassHttpSessionEventextendsjava.util.EventObject
Thisistheclassrepresentingeventnotificationsforchangestosessionswithinawebapplication.
Since:v2.3
SeeAlso:SerializedForm
Fieldsinheritedfromclassjava.util.EventObjectsource
ConstructorSummaryHttpSessionEvent(HttpSessionsource)Constructasessioneventfromthegivensource.
MethodSummaryHttpSession
getSession()Returnthesessionthatchanged.
Methodsinheritedfromclassjava.util.EventObject
getSource,toString
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
wait,wait,wait
ConstructorDetail
HttpSessionEvent
publicHttpSessionEvent(HttpSessionsource)
Constructasessioneventfromthegivensource.
MethodDetail
getSession
publicHttpSessiongetSession()
Returnthesessionthatchanged.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpInterfaceHttpSessionListener
publicabstractinterfaceHttpSessionListenerextendsjava.util.EventListener
Implementationsofthisinterfacemayarenotifiedofchangestothelistofactivesessionsinawebapplication.Torecievenotificationevents,theimplementationclassmustbeconfiguredinthedeploymentdescriptorforthewebapplication.
Since:v2.3
SeeAlso:HttpSessionEvent
MethodSummaryvoid
sessionCreated(HttpSessionEventse)Notificationthatasessionwascreated.
voidsessionDestroyed(HttpSessionEventse)Notificationthatasessionwasinvalidated.
MethodDetail
sessionCreated
publicvoidsessionCreated(HttpSessionEventse)
Notificationthatasessionwascreated.Parameters:
se-thenotificationevent
sessionDestroyed
publicvoidsessionDestroyed(HttpSessionEventse)
Notificationthatasessionwasinvalidated.Parameters:
se-thenotificationevent
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servlet.httpClassHttpUtilsjava.lang.Object
|
+--javax.servlet.http.HttpUtils
Deprecated.AsofJava(tm)ServletAPI2.3.Thesemethodswereonlyusefulwiththedefaultencodingandhavebeenmovedtotherequestinterfaces.
publicclassHttpUtilsextendsjava.lang.Object
ConstructorSummaryHttpUtils()Deprecated.ConstructsanemptyHttpUtilsobject.
MethodSummary
staticjava.lang.StringBuffer
getRequestURL(HttpServletRequestreq)Deprecated.ReconstructstheURLtheclientusedtomaketherequest,usinginformationintheHttpServletRequestobject.
staticjava.util.Hashtable
parsePostData(intlen,
ServletInputStreamin)Deprecated.ParsesdatafromanHTMLformthattheclientsendstotheserverusingtheHTTPPOSTmethodandtheapplication/x-www-form-urlencodedMIMEtype.
staticjava.util.Hashtable
parseQueryString(java.lang.Strings)Deprecated.ParsesaquerystringpassedfromtheclienttotheserverandbuildsaHashTableobjectwithkey-valuepairs.
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
HttpUtils
publicHttpUtils()
Deprecated.ConstructsanemptyHttpUtilsobject.
MethodDetail
parseQueryString
publicstaticjava.util.HashtableparseQueryString(java.lang.Strings)
Deprecated.ParsesaquerystringpassedfromtheclienttotheserverandbuildsaHashTableobjectwithkey-valuepairs.ThequerystringshouldbeintheformofastringpackagedbytheGETorPOSTmethod,thatis,itshouldhavekey-valuepairsintheformkey=value,witheachpairseparatedfromthenextbya&character.
Akeycanappearmorethanonceinthequerystringwithdifferentvalues.However,thekeyappearsonlyonceinthehashtable,withitsvaluebeinganarrayofstringscontainingthemultiplevaluessentbythequerystring.
Thekeysandvaluesinthehashtablearestoredintheirdecodedform,soany+charactersareconvertedtospaces,andcharacterssentinhexadecimalnotation(like%xx)areconvertedtoASCIIcharacters.
Parameters:s-astringcontainingthequerytobeparsed
Returns:aHashTableobjectbuiltfromtheparsedkey-valuepairs
Throws:
java.lang.IllegalArgumentException-ifthequerystringisinvalid
parsePostData
publicstaticjava.util.HashtableparsePostData(intlen,
ServletInputStreamin)
Deprecated.ParsesdatafromanHTMLformthattheclientsendstotheserverusingtheHTTPPOSTmethodandtheapplication/x-www-form-urlencodedMIMEtype.
ThedatasentbythePOSTmethodcontainskey-valuepairs.AkeycanappearmorethanonceinthePOSTdatawithdifferentvalues.However,thekeyappearsonlyonceinthehashtable,withitsvaluebeinganarrayofstringscontainingthemultiplevaluessentbythePOSTmethod.
Thekeysandvaluesinthehashtablearestoredintheirdecodedform,soany+charactersareconvertedtospaces,andcharacterssentinhexadecimalnotation(like%xx)areconvertedtoASCIIcharacters.
Parameters:len-anintegerspecifyingthelength,incharacters,oftheServletInputStreamobjectthatisalsopassedtothismethodin-theServletInputStreamobjectthatcontainsthedatasentfromtheclient
Returns:aHashTableobjectbuiltfromtheparsedkey-valuepairs
Throws:java.lang.IllegalArgumentException-ifthedatasentbythePOSTmethodisinvalid
getRequestURL
publicstaticjava.lang.StringBuffergetRequestURL(HttpServletRequest
Deprecated.ReconstructstheURLtheclientusedtomaketherequest,using
informationintheHttpServletRequestobject.ThereturnedURLcontainsaprotocol,servername,portnumber,andserverpath,butitdoesnotincludequerystringparameters.
BecausethismethodreturnsaStringBuffer,notastring,youcanmodifytheURLeasily,forexample,toappendqueryparameters.
Thismethodisusefulforcreatingredirectmessagesandforreportingerrors.
Parameters:req-aHttpServletRequestobjectcontainingtheclient'srequest
Returns:aStringBufferobjectcontainingthereconstructedURL
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceRequestDispatcher
publicabstractinterfaceRequestDispatcher
Definesanobjectthatreceivesrequestsfromtheclientandsendsthemtoanyresource(suchasaservlet,HTMLfile,orJSPfile)ontheserver.TheservletcontainercreatestheRequestDispatcherobject,whichisusedasawrapperaroundaserverresourcelocatedataparticularpathorgivenbyaparticularname.
Thisinterfaceisintendedtowrapservlets,butaservletcontainercancreateRequestDispatcherobjectstowrapanytypeofresource.
SeeAlso:ServletContext.getRequestDispatcher(java.lang.String),ServletContext.getNamedDispatcher(java.lang.String),ServletRequest.getRequestDispatcher(java.lang.String)
MethodSummary
void
forward(ServletRequestrequest,ServletResponseresponse)Forwardsarequestfromaservlettoanotherresource(servlet,JSPfile,orHTMLfile)ontheserver.
void
include(ServletRequestrequest,ServletResponseresponse)Includesthecontentofaresource(servlet,JSPpage,HTMLfile)intheresponse.
MethodDetail
forward
publicvoidforward(ServletRequestrequest,
ServletResponseresponse)
throwsServletException,
java.io.IOException
Forwardsarequestfromaservlettoanotherresource(servlet,JSPfile,orHTMLfile)ontheserver.Thismethodallowsoneservlettodopreliminaryprocessingofarequestandanotherresourcetogeneratetheresponse.
ForaRequestDispatcherobtainedviagetRequestDispatcher(),theServletRequestobjecthasitspathelementsandparametersadjustedtomatchthepathofthetargetresource.
forwardshouldbecalledbeforetheresponsehasbeencommittedtotheclient(beforeresponsebodyoutputhasbeenflushed).Iftheresponsealreadyhasbeencommitted,thismethodthrowsanIllegalStateException.Uncommittedoutputintheresponsebufferisautomaticallyclearedbeforetheforward.
Therequestandresponseparametersmustbeeitherthesameobjectsaswerepassedtothecallingservlet'sservicemethodorbesubclassesoftheServletRequestWrapperorServletResponseWrapperclassesthatwrapthem.
Parameters:request-aServletRequestobjectthatrepresentstherequesttheclientmakesoftheservletresponse-aServletResponseobjectthatrepresentstheresponsetheservletreturnstotheclient
Throws:ServletException-ifthetargetresourcethrowsthisexceptionjava.io.IOException-ifthetargetresourcethrowsthisexceptionIllegalStateException-iftheresponsewasalreadycommitted
include
publicvoidinclude(ServletRequestrequest,
ServletResponseresponse)
throwsServletException,
java.io.IOException
Includesthecontentofaresource(servlet,JSPpage,HTMLfile)inthe
response.Inessence,thismethodenablesprogrammaticserver-sideincludes.
TheServletResponseobjecthasitspathelementsandparametersremainunchangedfromthecaller's.Theincludedservletcannotchangetheresponsestatuscodeorsetheaders;anyattempttomakeachangeisignored.
Therequestandresponseparametersmustbeeitherthesameobjectsaswerepassedtothecallingservlet'sservicemethodorbesubclassesoftheServletRequestWrapperorServletResponseWrapperclassesthatwrapthem.
Parameters:request-aServletRequestobjectthatcontainstheclient'srequestresponse-aServletResponseobjectthatcontainstheservlet'sresponse
Throws:ServletException-iftheincludedresourcethrowsthisexceptionjava.io.IOException-iftheincludedresourcethrowsthisexception
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServlet
AllKnownImplementingClasses:GenericServlet
publicabstractinterfaceServlet
Definesmethodsthatallservletsmustimplement.
AservletisasmallJavaprogramthatrunswithinaWebserver.ServletsreceiveandrespondtorequestsfromWebclients,usuallyacrossHTTP,theHyperTextTransferProtocol.
Toimplementthisinterface,youcanwriteagenericservletthatextendsjavax.servlet.GenericServletoranHTTPservletthatextendsjavax.servlet.http.HttpServlet.
Thisinterfacedefinesmethodstoinitializeaservlet,toservicerequests,andtoremoveaservletfromtheserver.Theseareknownaslife-cyclemethodsandarecalledinthefollowingsequence:
1. Theservletisconstructed,theninitializedwiththeinitmethod.2. Anycallsfromclientstotheservicemethodarehandled.3. Theservletistakenoutofservice,thendestroyedwiththedestroymethod,
thengarbagecollectedandfinalized.
Inadditiontothelife-cyclemethods,thisinterfaceprovidesthegetServletConfigmethod,whichtheservletcanusetogetanystartupinformation,andthegetServletInfomethod,whichallowstheservlettoreturnbasicinformationaboutitself,suchasauthor,version,andcopyright.
SeeAlso:GenericServlet,HttpServlet
MethodSummary
voiddestroy()Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingtakenoutofservice.
ServletConfig
getServletConfig()ReturnsaServletConfigobject,whichcontainsinitializationandstartupparametersforthisservlet.
java.lang.String
getServletInfo()Returnsinformationabouttheservlet,suchasauthor,version,andcopyright.
void
init(ServletConfigconfig)Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingplacedintoservice.
void
service(ServletRequestreq,ServletResponseres)Calledbytheservletcontainertoallowtheservlettorespondtoarequest.
MethodDetail
init
publicvoidinit(ServletConfigconfig)
throwsServletException
Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingplacedintoservice.
Theservletcontainercallstheinitmethodexactlyonceafterinstantiatingtheservlet.Theinitmethodmustcompletesuccessfullybeforetheservletcanreceiveanyrequests.
Theservletcontainercannotplacetheservletintoserviceiftheinitmethod
1. ThrowsaServletException2. DoesnotreturnwithinatimeperioddefinedbytheWebserver
Parameters:
config-aServletConfigobjectcontainingtheservlet'sconfigurationandinitializationparameters
Throws:ServletException-ifanexceptionhasoccurredthatinterfereswiththeservlet'snormaloperation
SeeAlso:UnavailableException,getServletConfig()
getServletConfig
publicServletConfiggetServletConfig()
ReturnsaServletConfigobject,whichcontainsinitializationandstartupparametersforthisservlet.TheServletConfigobjectreturnedistheonepassedtotheinitmethod.
ImplementationsofthisinterfaceareresponsibleforstoringtheServletConfigobjectsothatthismethodcanreturnit.TheGenericServletclass,whichimplementsthisinterface,alreadydoesthis.
Returns:theServletConfigobjectthatinitializesthisservlet
SeeAlso:init(javax.servlet.ServletConfig)
service
publicvoidservice(ServletRequestreq,
ServletResponseres)
throwsServletException,
java.io.IOException
Calledbytheservletcontainertoallowtheservlettorespondtoarequest.
Thismethodisonlycalledaftertheservlet'sinit()methodhascompletedsuccessfully.
Thestatuscodeoftheresponsealwaysshouldbesetforaservletthat
throwsorsendsanerror.
Servletstypicallyruninsidemultithreadedservletcontainersthatcanhandlemultiplerequestsconcurrently.Developersmustbeawaretosynchronizeaccesstoanysharedresourcessuchasfiles,networkconnections,andaswellastheservlet'sclassandinstancevariables.MoreinformationonmultithreadedprogramminginJavaisavailableintheJavatutorialonmulti-threadedprogramming.
Parameters:req-theServletRequestobjectthatcontainstheclient'srequestres-theServletResponseobjectthatcontainstheservlet'sresponse
Throws:ServletException-ifanexceptionoccursthatinterfereswiththeservlet'snormaloperationjava.io.IOException-ifaninputoroutputexceptionoccurs
getServletInfo
publicjava.lang.StringgetServletInfo()
Returnsinformationabouttheservlet,suchasauthor,version,andcopyright.
Thestringthatthismethodreturnsshouldbeplaintextandnotmarkupofanykind(suchasHTML,XML,etc.).
Returns:aStringcontainingservletinformation
destroy
publicvoiddestroy()
Calledbytheservletcontainertoindicatetoaservletthattheservletisbeingtakenoutofservice.Thismethodisonlycalledonceallthreadswithintheservlet'sservicemethodhaveexitedorafteratimeoutperiodhaspassed.Aftertheservletcontainercallsthismethod,itwillnotcallthe
servicemethodagainonthisservlet.
Thismethodgivestheservletanopportunitytocleanupanyresourcesthatarebeingheld(forexample,memory,filehandles,threads)andmakesurethatanypersistentstateissynchronizedwiththeservlet'scurrentstateinmemory.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServletConfig
AllKnownImplementingClasses:GenericServlet
publicabstractinterfaceServletConfig
Aservletconfigurationobjectusedbyaservletcontainerusedtopassinformationtoaservletduringinitialization.
MethodSummary
java.lang.String
getInitParameter(java.lang.Stringname)ReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.
java.util.Enumeration
getInitParameterNames()Returnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
ServletContext
getServletContext()ReturnsareferencetotheServletContextinwhichthecallerisexecuting.
java.lang.StringgetServletName()Returnsthenameofthisservletinstance.
MethodDetail
getServletName
publicjava.lang.StringgetServletName()
Returnsthenameofthisservletinstance.Thenamemaybeprovidedviaserveradministration,assignedinthewebapplicationdeploymentdescriptor,orforanunregistered(andthusunnamed)servletinstanceitwillbetheservlet'sclassname.Returns:
thenameoftheservletinstance
getServletContext
publicServletContextgetServletContext()
ReturnsareferencetotheServletContextinwhichthecallerisexecuting.Returns:
aServletContextobject,usedbythecallertointeractwithitsservletcontainer
SeeAlso:ServletContext
getInitParameter
publicjava.lang.StringgetInitParameter(java.lang.Stringname)
ReturnsaStringcontainingthevalueofthenamedinitializationparameter,ornulliftheparameterdoesnotexist.Parameters:
name-aStringspecifyingthenameoftheinitializationparameterReturns:
aStringcontainingthevalueoftheinitializationparameter
getInitParameterNames
publicjava.util.EnumerationgetInitParameterNames()
Returnsthenamesoftheservlet'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationiftheservlethasnoinitializationparameters.
Returns:anEnumerationofStringobjectscontainingthenamesoftheservlet'sinitializationparameters
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServletContext
publicabstractinterfaceServletContext
Definesasetofmethodsthataservletusestocommunicatewithitsservletcontainer,forexample,togettheMIMEtypeofafile,dispatchrequests,orwritetoalogfile.
Thereisonecontextper"webapplication"perJavaVirtualMachine.(A"webapplication"isacollectionofservletsandcontentinstalledunderaspecificsubsetoftheserver'sURLnamespacesuchas/catalogandpossiblyinstalledviaa.warfile.)
Inthecaseofawebapplicationmarked"distributed"initsdeploymentdescriptor,therewillbeonecontextinstanceforeachvirtualmachine.Inthissituation,thecontextcannotbeusedasalocationtoshareglobalinformation(becausetheinformationwon'tbetrulyglobal).Useanexternalresourcelikeadatabaseinstead.
TheServletContextobjectiscontainedwithintheServletConfigobject,whichtheWebserverprovidestheservletwhentheservletisinitialized.
SeeAlso:Servlet.getServletConfig(),ServletConfig.getServletContext()
MethodSummary
java.lang.Object
getAttribute(java.lang.Stringname)Returnstheservletcontainerattributewiththegivenname,ornullifthereisnoattributebythatname.
java.util.Enumeration
getAttributeNames()ReturnsanEnumerationcontainingtheattributenamesavailablewithinthisservletcontext.
ServletContext
getContext(java.lang.Stringuripath)ReturnsaServletContextobjectthatcorresponds
toaspecifiedURLontheserver.
java.lang.String
getInitParameter(java.lang.Stringname)ReturnsaStringcontainingthevalueofthenamedcontext-wideinitializationparameter,ornulliftheparameterdoesnotexist.
java.util.Enumeration
getInitParameterNames()Returnsthenamesofthecontext'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationifthecontexthasnoinitializationparameters.
int
getMajorVersion()ReturnsthemajorversionoftheJavaServletAPIthatthisservletcontainersupports.
java.lang.String
getMimeType(java.lang.Stringfile)ReturnstheMIMEtypeofthespecifiedfile,ornulliftheMIMEtypeisnotknown.
int
getMinorVersion()ReturnstheminorversionoftheServletAPIthatthisservletcontainersupports.
RequestDispatcher
getNamedDispatcher(java.lang.Stringname)ReturnsaRequestDispatcherobjectthatactsasawrapperforthenamedservlet.
java.lang.String
getRealPath(java.lang.Stringpath)ReturnsaStringcontainingtherealpathforagivenvirtualpath.
RequestDispatcher
getRequestDispatcher(java.lang.Stringpath)ReturnsaRequestDispatcherobjectthatactsasawrapperfortheresourcelocatedatthegivenpath.
java.net.URL
getResource(java.lang.Stringpath)ReturnsaURLtotheresourcethatismappedtoaspecifiedpath.
java.io.InputStream
getResourceAsStream(java.lang.Stringpath)ReturnstheresourcelocatedatthenamedpathasanInputStreamobject.getResourcePaths(java.lang.Stringpath)Returnsadirectory-likelistingofallthepathsto
java.util.Set resourceswithinthewebapplicationwhoselongestsub-pathmatchesthesuppliedpathargument.
java.lang.String
getServerInfo()Returnsthenameandversionoftheservletcontaineronwhichtheservletisrunning.
Servlet
getServlet(java.lang.Stringname)Deprecated.AsofJavaServletAPI2.1,withnodirectreplacement.
ThismethodwasoriginallydefinedtoretrieveaservletfromaServletContext.Inthisversion,thismethodalwaysreturnsnullandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
Inlieuofthismethod,servletscanshareinformationusingtheServletContextclassandcanperformsharedbusinesslogicbyinvokingmethodsoncommonnon-servletclasses.
java.lang.String
getServletContextName()ReturnsthenameofthiswebapplicationcorrepondingtothisServletContextasspecifiedinthedeploymentdescriptorforthiswebapplicationbythedisplay-nameelement.
java.util.Enumeration
getServletNames()Deprecated.AsofJavaServletAPI2.1,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletnamesknowntothiscontext.Inthisversion,thismethodalwaysreturnsanemptyEnumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
getServlets()Deprecated.AsofJavaServletAPI2.0,withnoreplacement.
java.util.Enumeration
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletsknowntothisservletcontext.Inthisversion,thismethodalwaysreturnsanemptyenumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
void
log(java.lang.Exceptionexception,
java.lang.Stringmsg)Deprecated.AsofJavaServletAPI2.1,uselog(Stringmessage,Throwablethrowable)instead.
Thismethodwasoriginallydefinedtowriteanexception'sstacktraceandanexplanatoryerrormessagetotheservletlogfile.
void
log(java.lang.Stringmsg)Writesthespecifiedmessagetoaservletlogfile,usuallyaneventlog.
void
log(java.lang.Stringmessage,
java.lang.Throwablethrowable)WritesanexplanatorymessageandastacktraceforagivenThrowableexceptiontotheservletlogfile.
void
removeAttribute(java.lang.Stringname)Removestheattributewiththegivennamefromtheservletcontext.
void
setAttribute(java.lang.Stringname,
java.lang.Objectobject)Bindsanobjecttoagivenattributenameinthisservletcontext.
MethodDetail
getContext
publicServletContextgetContext(java.lang.Stringuripath)
ReturnsaServletContextobjectthatcorrespondstoaspecifiedURLontheserver.
Thismethodallowsservletstogainaccesstothecontextforvariouspartsoftheserver,andasneededobtainRequestDispatcherobjectsfromthecontext.Thegivenpathmustbebeginwith"/",isinterpretedrelativetotheserver'sdocumentrootandismatchedagainstthecontextrootsofotherwebapplicationshostedonthiscontainer.
Inasecurityconsciousenvironment,theservletcontainermayreturnnullforagivenURL.
Parameters:uripath-aStringspecifyingthecontextpathofanotherwebapplicationinthecontainer.
Returns:theServletContextobjectthatcorrespondstothenamedURL,ornullifeithernoneexistsorthecontainerwishestorestrictthisaccess.
SeeAlso:RequestDispatcher
getMajorVersion
publicintgetMajorVersion()
ReturnsthemajorversionoftheJavaServletAPIthatthisservletcontainersupports.AllimplementationsthatcomplywithVersion2.3musthavethismethodreturntheinteger2.Returns:
2
getMinorVersion
publicintgetMinorVersion()
ReturnstheminorversionoftheServletAPIthatthisservletcontainersupports.AllimplementationsthatcomplywithVersion2.3musthavethismethodreturntheinteger3.
Returns:3
getMimeType
publicjava.lang.StringgetMimeType(java.lang.Stringfile)
ReturnstheMIMEtypeofthespecifiedfile,ornulliftheMIMEtypeisnotknown.TheMIMEtypeisdeterminedbytheconfigurationoftheservletcontainer,andmaybespecifiedinawebapplicationdeploymentdescriptor.CommonMIMEtypesare"text/html"and"image/gif".Parameters:
file-aStringspecifyingthenameofafileReturns:
aStringspecifyingthefile'sMIMEtype
getResourcePaths
publicjava.util.SetgetResourcePaths(java.lang.Stringpath)
Returnsadirectory-likelistingofallthepathstoresourceswithinthewebapplicationwhoselongestsub-pathmatchesthesuppliedpathargument.Pathsindicatingsubdirectorypathsendwitha'/'.Thereturnedpathsareallrelativetotherootofthewebapplicationandhavealeading'/'.Forexample,forawebapplicationcontaining
/welcome.html/catalog/index.html/catalog/products.html/catalog/offers/books.html/catalog/offers/music.html/customer/login.jsp/WEB-INF/web.xml/WEB-INF/classes/com.acme.OrderServlet.class,
getResourcePaths("/")returns{"/welcome.html","/catalog/","/customer/","/WEB-INF/"}
getResourcePaths("/catalog/")returns{"/catalog/index.html","/catalog/products.html","/catalog/offers/"}.Parameters:
the-partialpathusedtomatchtheresources,whichmuststartwitha/Returns:
aSetcontainingthedirectorylisting,ornulliftherearenoresourcesinthewebapplicationwhosepathbeginswiththesuppliedpath.
Since:Servlet2.3
getResource
publicjava.net.URLgetResource(java.lang.Stringpath)
throwsjava.net.MalformedURLException
ReturnsaURLtotheresourcethatismappedtoaspecifiedpath.Thepathmustbeginwitha"/"andisinterpretedasrelativetothecurrentcontextroot.
Thismethodallowstheservletcontainertomakearesourceavailabletoservletsfromanysource.Resourcescanbelocatedonalocalorremotefilesystem,inadatabase,orina.warfile.
TheservletcontainermustimplementtheURLhandlersandURLConnectionobjectsthatarenecessarytoaccesstheresource.
Thismethodreturnsnullifnoresourceismappedtothepathname.
SomecontainersmayallowwritingtotheURLreturnedbythismethodusingthemethodsoftheURLclass.
Theresourcecontentisreturneddirectly,sobeawarethatrequestinga.jsppagereturnstheJSPsourcecode.UseaRequestDispatcherinsteadtoincluderesultsofanexecution.
Thismethodhasadifferentpurposethanjava.lang.Class.getResource,whichlooksupresourcesbasedonaclassloader.Thismethoddoesnotuseclassloaders.
Parameters:path-aStringspecifyingthepathtotheresource
Returns:theresourcelocatedatthenamedpath,ornullifthereisnoresourceatthatpath
Throws:java.net.MalformedURLException-ifthepathnameisnotgiveninthecorrectform
getResourceAsStream
publicjava.io.InputStreamgetResourceAsStream(java.lang.Stringpath)
ReturnstheresourcelocatedatthenamedpathasanInputStreamobject.
ThedataintheInputStreamcanbeofanytypeorlength.ThepathmustbespecifiedaccordingtotherulesgiveningetResource.Thismethodreturnsnullifnoresourceexistsatthespecifiedpath.
Meta-informationsuchascontentlengthandcontenttypethatisavailableviagetResourcemethodislostwhenusingthismethod.
TheservletcontainermustimplementtheURLhandlersandURLConnectionobjectsnecessarytoaccesstheresource.
Thismethodisdifferentfromjava.lang.Class.getResourceAsStream,whichusesaclassloader.Thismethodallowsservletcontainerstomakearesourceavailabletoaservletfromanylocation,withoutusingaclassloader.
Parameters:name-aStringspecifyingthepathtotheresource
Returns:theInputStreamreturnedtotheservlet,ornullifnoresourceexistsatthespecifiedpath
getRequestDispatcher
publicRequestDispatchergetRequestDispatcher(java.lang.Stringpath)
ReturnsaRequestDispatcherobjectthatactsasawrapperfortheresourcelocatedatthegivenpath.ARequestDispatcherobjectcanbeusedtoforwardarequesttotheresourceortoincludetheresourceinaresponse.Theresourcecanbedynamicorstatic.
Thepathnamemustbeginwitha"/"andisinterpretedasrelativetothecurrentcontextroot.UsegetContexttoobtainaRequestDispatcherforresourcesinforeigncontexts.ThismethodreturnsnulliftheServletContextcannotreturnaRequestDispatcher.
Parameters:path-aStringspecifyingthepathnametotheresource
Returns:aRequestDispatcherobjectthatactsasawrapperfortheresourceatthespecifiedpath
SeeAlso:RequestDispatcher,getContext(java.lang.String)
getNamedDispatcher
publicRequestDispatchergetNamedDispatcher(java.lang.Stringname)
ReturnsaRequestDispatcherobjectthatactsasawrapperforthenamedservlet.
Servlets(andJSPpagesalso)maybegivennamesviaserveradministrationorviaawebapplicationdeploymentdescriptor.AservletinstancecandetermineitsnameusingServletConfig.getServletName().
ThismethodreturnsnulliftheServletContextcannotreturnaRequestDispatcherforanyreason.
Parameters:name-aStringspecifyingthenameofaservlettowrap
Returns:aRequestDispatcherobjectthatactsasawrapperforthenamedservlet
SeeAlso:RequestDispatcher,getContext(java.lang.String),ServletConfig.getServletName()
getServlet
publicServletgetServlet(java.lang.Stringname)
throwsServletException
Deprecated.AsofJavaServletAPI2.1,withnodirectreplacement.
ThismethodwasoriginallydefinedtoretrieveaservletfromaServletContext.Inthisversion,thismethodalwaysreturnsnullandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
Inlieuofthismethod,servletscanshareinformationusingtheServletContextclassandcanperformsharedbusinesslogicbyinvokingmethodsoncommonnon-servletclasses.
getServlets
publicjava.util.EnumerationgetServlets()
Deprecated.AsofJavaServletAPI2.0,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletsknowntothisservletcontext.Inthisversion,thismethodalwaysreturnsanemptyenumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
getServletNames
publicjava.util.EnumerationgetServletNames()
Deprecated.AsofJavaServletAPI2.1,withnoreplacement.
ThismethodwasoriginallydefinedtoreturnanEnumerationofalltheservletnamesknowntothiscontext.Inthisversion,thismethodalwaysreturnsanemptyEnumerationandremainsonlytopreservebinarycompatibility.ThismethodwillbepermanentlyremovedinafutureversionoftheJavaServletAPI.
log
publicvoidlog(java.lang.Stringmsg)
Writesthespecifiedmessagetoaservletlogfile,usuallyaneventlog.Thenameandtypeoftheservletlogfileisspecifictotheservletcontainer.Parameters:
msg-aStringspecifyingthemessagetobewrittentothelogfile
log
publicvoidlog(java.lang.Exceptionexception,
java.lang.Stringmsg)
Deprecated.AsofJavaServletAPI2.1,uselog(Stringmessage,Throwablethrowable)instead.
Thismethodwasoriginallydefinedtowriteanexception'sstacktraceandanexplanatoryerrormessagetotheservletlogfile.
log
publicvoidlog(java.lang.Stringmessage,
java.lang.Throwablethrowable)
WritesanexplanatorymessageandastacktraceforagivenThrowableexceptiontotheservletlogfile.Thenameandtypeoftheservletlogfileisspecifictotheservletcontainer,usuallyaneventlog.Parameters:
message-aStringthatdescribestheerrororexceptionthrowable-theThrowableerrororexception
getRealPath
publicjava.lang.StringgetRealPath(java.lang.Stringpath)
ReturnsaStringcontainingtherealpathforagivenvirtualpath.Forexample,thepath"/index.html"returnstheabsolutefilepathontheserver'sfilesystemwouldbeservedbyarequestfor"http://host/contextPath/index.html",wherecontextPathisthecontextpathofthisServletContext..
Therealpathreturnedwillbeinaformappropriatetothecomputerandoperatingsystemonwhichtheservletcontainerisrunning,includingtheproperpathseparators.Thismethodreturnsnulliftheservletcontainercannottranslatethevirtualpathtoarealpathforanyreason(suchaswhenthecontentisbeingmadeavailablefroma.wararchive).
Parameters:path-aStringspecifyingavirtualpath
Returns:aStringspecifyingtherealpath,ornullifthetranslationcannotbeperformed
getServerInfo
publicjava.lang.StringgetServerInfo()
Returnsthenameandversionoftheservletcontaineronwhichtheservletisrunning.
Theformofthereturnedstringisservername/versionnumber.Forexample,theJavaServerWebDevelopmentKitmayreturnthestringJavaServerWebDevKit/1.0.
Theservletcontainermayreturnotheroptionalinformationaftertheprimarystringinparentheses,forexample,JavaServerWebDevKit/1.0(JDK1.1.6;WindowsNT4.0x86).
Returns:
aStringcontainingatleasttheservletcontainernameandversionnumber
getInitParameter
publicjava.lang.StringgetInitParameter(java.lang.Stringname)
ReturnsaStringcontainingthevalueofthenamedcontext-wideinitializationparameter,ornulliftheparameterdoesnotexist.
Thismethodcanmakeavailableconfigurationinformationusefultoanentire"webapplication".Forexample,itcanprovideawebmaster'semailaddressorthenameofasystemthatholdscriticaldata.
Parameters:name-aStringcontainingthenameoftheparameterwhosevalueisrequested
Returns:aStringcontainingatleasttheservletcontainernameandversionnumber
SeeAlso:ServletConfig.getInitParameter(java.lang.String)
getInitParameterNames
publicjava.util.EnumerationgetInitParameterNames()
Returnsthenamesofthecontext'sinitializationparametersasanEnumerationofStringobjects,oranemptyEnumerationifthecontexthasnoinitializationparameters.Returns:
anEnumerationofStringobjectscontainingthenamesofthecontext'sinitializationparameters
SeeAlso:ServletConfig.getInitParameter(java.lang.String)
getAttribute
publicjava.lang.ObjectgetAttribute(java.lang.Stringname)
Returnstheservletcontainerattributewiththegivenname,ornullifthereisnoattributebythatname.Anattributeallowsaservletcontainertogivetheservletadditionalinformationnotalreadyprovidedbythisinterface.Seeyourserverdocumentationforinformationaboutitsattributes.AlistofsupportedattributescanberetrievedusinggetAttributeNames.
Theattributeisreturnedasajava.lang.Objectorsomesubclass.Attributenamesshouldfollowthesameconventionaspackagenames.TheJavaServletAPIspecificationreservesnamesmatchingjava.*,javax.*,andsun.*.
Parameters:name-aStringspecifyingthenameoftheattribute
Returns:anObjectcontainingthevalueoftheattribute,ornullifnoattributeexistsmatchingthegivenname
SeeAlso:getAttributeNames()
getAttributeNames
publicjava.util.EnumerationgetAttributeNames()
ReturnsanEnumerationcontainingtheattributenamesavailablewithinthisservletcontext.UsethegetAttribute(java.lang.String)methodwithanattributenametogetthevalueofanattribute.Returns:
anEnumerationofattributenamesSeeAlso:
getAttribute(java.lang.String)
setAttribute
publicvoidsetAttribute(java.lang.Stringname,
java.lang.Objectobject)
Bindsanobjecttoagivenattributenameinthisservletcontext.Ifthenamespecifiedisalreadyusedforanattribute,thismethodwillreplacetheattributewiththenewtothenewattribute.
IflistenersareconfiguredontheServletContextthecontainernotifiesthemaccordingly.
Ifanullvalueispassed,theeffectisthesameascallingremoveAttribute().
Attributenamesshouldfollowthesameconventionaspackagenames.TheJavaServletAPIspecificationreservesnamesmatchingjava.*,javax.*,andsun.*.
Parameters:name-aStringspecifyingthenameoftheattributeobject-anObjectrepresentingtheattributetobebound
removeAttribute
publicvoidremoveAttribute(java.lang.Stringname)
Removestheattributewiththegivennamefromtheservletcontext.Afterremoval,subsequentcallstogetAttribute(java.lang.String)toretrievetheattribute'svaluewillreturnnull.
IflistenersareconfiguredontheServletContextthecontainernotifiesthemaccordingly.
Parameters:name-aStringspecifyingthenameoftheattributetoberemoved
getServletContextName
publicjava.lang.StringgetServletContextName()
ReturnsthenameofthiswebapplicationcorrepondingtothisServletContextasspecifiedinthedeploymentdescriptorforthiswebapplicationbythedisplay-nameelement.Returns:
Thenameofthewebapplicationornullifnonamehasbeendeclaredinthedeploymentdescriptor.
Since:Servlet2.3
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletContextAttributeEventjava.lang.Object
|
+--java.util.EventObject
|
+--javax.servlet.ServletContextEvent
|
+--javax.servlet.ServletContextAttributeEvent
publicclassServletContextAttributeEventextendsServletContextEvent
Thisistheeventclassfornotificationsaboutchangestotheattributesoftheservletcontextofawebapplication.
Since:v2.3
SeeAlso:ServletContextAttributeListener,SerializedForm
Fieldsinheritedfromclassjava.util.EventObjectsource
ConstructorSummaryServletContextAttributeEvent(ServletContextsource,
java.lang.Stringname,java.lang.Objectvalue)ConstructaServletContextAttributeEventfromthegivencontextforthegivenattributenameandattributevalue.
MethodSummary
java.lang.String
getName()ReturnthenameoftheattributethatchangedontheServletContext.getValue()
java.lang.Object Returnsthevalueoftheattributethathasbeenaddedremovedorreplaced.
Methodsinheritedfromclassjavax.servlet.ServletContextEventgetServletContext
Methodsinheritedfromclassjava.util.EventObjectgetSource,toString
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
wait,wait,wait
ConstructorDetail
ServletContextAttributeEvent
publicServletContextAttributeEvent(ServletContextsource,
java.lang.Stringname,
java.lang.Objectvalue)
ConstructaServletContextAttributeEventfromthegivencontextforthegivenattributenameandattributevalue.
MethodDetail
getName
publicjava.lang.StringgetName()
ReturnthenameoftheattributethatchangedontheServletContext.
getValue
publicjava.lang.ObjectgetValue()
Returnsthevalueoftheattributethathasbeenaddedremovedorreplaced.Iftheattributewasadded,thisisthevalueoftheattribute.Iftheattrubutewasremoved,thisisthevalueoftheremovedattribute.Iftheattributewasreplaced,thisistheoldvalueoftheattribute.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServletContextAttributeListener
publicabstractinterfaceServletContextAttributeListenerextendsjava.util.EventListener
Implementationsofthisinterfacerecievenotificationsofchangestotheattributelistontheservletcontextofawebapplication.Torecievenotificationevents,theimplementationclassmustbeconfiguredinthedeploymentdescriptorforthewebapplication.
Since:v2.3
SeeAlso:ServletContextAttributeEvent
MethodSummaryvoid
attributeAdded(ServletContextAttributeEventscab)Notificationthatanewattributewasaddedtotheservletcontext.
void
attributeRemoved(ServletContextAttributeEventscab)Notificationthatanexistingattributehasbeenremvedfromtheservletcontext.
void
attributeReplaced(ServletContextAttributeEventscab)Notificationthatanattributeontheservletcontexthasbeenreplaced.
MethodDetail
attributeAdded
publicvoidattributeAdded(ServletContextAttributeEventscab)
Notificationthatanewattributewasaddedtotheservletcontext.Called
aftertheattributeisadded.
attributeRemoved
publicvoidattributeRemoved(ServletContextAttributeEventscab)
Notificationthatanexistingattributehasbeenremvedfromtheservletcontext.Calledaftertheattributeisremoved.
attributeReplaced
publicvoidattributeReplaced(ServletContextAttributeEventscab)
Notificationthatanattributeontheservletcontexthasbeenreplaced.Calledaftertheattributeisreplaced.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletContextEventjava.lang.Object
|
+--java.util.EventObject
|
+--javax.servlet.ServletContextEvent
DirectKnownSubclasses:ServletContextAttributeEvent
publicclassServletContextEventextendsjava.util.EventObject
Thisistheeventclassfornotificationsaboutchangestotheservletcontextofawebapplication.
Since:v2.3
SeeAlso:ServletContextListener,SerializedForm
Fieldsinheritedfromclassjava.util.EventObjectsource
ConstructorSummaryServletContextEvent(ServletContextsource)ConstructaServletContextEventfromthegivencontext.
MethodSummaryServletContext
getServletContext()ReturntheServletContextthatchanged.
Methodsinheritedfromclassjava.util.EventObject
getSource,toString
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
wait,wait,wait
ConstructorDetail
ServletContextEvent
publicServletContextEvent(ServletContextsource)
ConstructaServletContextEventfromthegivencontext.Parameters:
source--theServletContextthatissendingtheevent.
MethodDetail
getServletContext
publicServletContextgetServletContext()
ReturntheServletContextthatchanged.Returns:
theServletContextthatsenttheevent.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServletContextListener
publicabstractinterfaceServletContextListenerextendsjava.util.EventListener
Implementationsofthisinterfacerecievenotificationsaboutchangestotheservletcontextofthewebapplicationtheyarepartof.Torecievenotificationevents,theimplementationclassmustbeconfiguredinthedeploymentdescriptorforthewebapplication.
Since:v2.3
SeeAlso:ServletContextEvent
MethodSummaryvoid
contextDestroyed(ServletContextEventsce)Notificationthattheservletcontextisabouttobeshutdown.
voidcontextInitialized(ServletContextEventsce)Notificationthatthewebapplicationisreadytoprocessrequests.
MethodDetail
contextInitialized
publicvoidcontextInitialized(ServletContextEventsce)
Notificationthatthewebapplicationisreadytoprocessrequests.
contextDestroyed
publicvoidcontextDestroyed(ServletContextEventsce)
Notificationthattheservletcontextisabouttobeshutdown.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletExceptionjava.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--javax.servlet.ServletException
DirectKnownSubclasses:UnavailableException
publicclassServletExceptionextendsjava.lang.Exception
Definesageneralexceptionaservletcanthrowwhenitencountersdifficulty.
SeeAlso:SerializedForm
ConstructorSummaryServletException()Constructsanewservletexception.ServletException(java.lang.Stringmessage)Constructsanewservletexceptionwiththespecifiedmessage.ServletException(java.lang.Stringmessage,
java.lang.ThrowablerootCause)Constructsanewservletexceptionwhentheservletneedstothrowanexceptionandincludeamessageaboutthe"rootcause"exceptionthatinterferedwithitsnormaloperation,includingadescriptionmessage.ServletException(java.lang.ThrowablerootCause)Constructsanewservletexceptionwhentheservletneedstothrowanexceptionandincludeamessageaboutthe"rootcause"exceptionthatinterferedwithitsnormaloperation.
MethodSummary
java.lang.Throwable
getRootCause()Returnstheexceptionthatcausedthisservletexception.
Methodsinheritedfromclassjava.lang.ThrowablefillInStackTrace,getLocalizedMessage,getMessage,
printStackTrace,printStackTrace,printStackTrace,toString
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
wait,wait,wait
ConstructorDetail
ServletException
publicServletException()
Constructsanewservletexception.
ServletException
publicServletException(java.lang.Stringmessage)
Constructsanewservletexceptionwiththespecifiedmessage.Themessagecanbewrittentotheserverlogand/ordisplayedfortheuser.Parameters:
message-aStringspecifyingthetextoftheexceptionmessage
ServletException
publicServletException(java.lang.Stringmessage,
java.lang.ThrowablerootCause)
Constructsanewservletexceptionwhentheservletneedstothrowanexceptionandincludeamessageaboutthe"rootcause"exceptionthatinterferedwithitsnormaloperation,includingadescriptionmessage.Parameters:
message-aStringcontainingthetextoftheexceptionmessagerootCause-theThrowableexceptionthatinterferedwiththeservlet'snormaloperation,makingthisservletexceptionnecessary
ServletException
publicServletException(java.lang.ThrowablerootCause)
Constructsanewservletexceptionwhentheservletneedstothrowanexceptionandincludeamessageaboutthe"rootcause"exceptionthatinterferedwithitsnormaloperation.Theexception'smessageisbasedonthelocalizedmessageoftheunderlyingexception.
ThismethodcallsthegetLocalizedMessagemethodontheThrowableexceptiontogetalocalizedexceptionmessage.WhensubclassingServletException,thismethodcanbeoverriddentocreateanexceptionmessagedesignedforaspecificlocale.
Parameters:rootCause-theThrowableexceptionthatinterferedwiththeservlet'snormaloperation,makingtheservletexceptionnecessary
MethodDetail
getRootCause
publicjava.lang.ThrowablegetRootCause()
Returnstheexceptionthatcausedthisservletexception.Returns:
theThrowablethatcausedthisservletexception
Overview Package Class Tree Deprecated IndexHelp
PREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletInputStreamjava.lang.Object
|
+--java.io.InputStream
|
+--javax.servlet.ServletInputStream
publicabstractclassServletInputStreamextendsjava.io.InputStream
Providesaninputstreamforreadingbinarydatafromaclientrequest,includinganefficientreadLinemethodforreadingdataonelineatatime.Withsomeprotocols,suchasHTTPPOSTandPUT,aServletInputStreamobjectcanbeusedtoreaddatasentfromtheclient.
AServletInputStreamobjectisnormallyretrievedviatheServletRequest.getInputStream()method.
Thisisanabstractclassthataservletcontainerimplements.Subclassesofthisclassmustimplementthejava.io.InputStream.read()method.
SeeAlso:ServletRequest
ConstructorSummaryprotected
ServletInputStream()Doesnothing,becausethisisanabstractclass.
MethodSummaryint
readLine(byte[]b,intoff,intlen)Readstheinputstream,onelineatatime.
Methodsinheritedfromclassjava.io.InputStreamavailable,close,mark,markSupported,read,read,read,reset,
skip
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
ServletInputStream
protectedServletInputStream()
Doesnothing,becausethisisanabstractclass.
MethodDetail
readLine
publicintreadLine(byte[]b,
intoff,
intlen)
throwsjava.io.IOException
Readstheinputstream,onelineatatime.Startingatanoffset,readsbytesintoanarray,untilitreadsacertainnumberofbytesorreachesanewlinecharacter,whichitreadsintothearrayaswell.
Thismethodreturns-1ifitreachestheendoftheinputstreambeforereadingthemaximumnumberofbytes.
Parameters:b-anarrayofbytesintowhichdataisreadoff-anintegerspecifyingthecharacteratwhichthismethodbeginsreadinglen-anintegerspecifyingthemaximumnumberofbytestoread
Returns:anintegerspecifyingtheactualnumberofbytesread,or-1iftheend
ofthestreamisreachedThrows:
java.io.IOException-ifaninputoroutputexceptionhasoccurred
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletOutputStreamjava.lang.Object
|
+--java.io.OutputStream
|
+--javax.servlet.ServletOutputStream
publicabstractclassServletOutputStreamextendsjava.io.OutputStream
Providesanoutputstreamforsendingbinarydatatotheclient.AServletOutputStreamobjectisnormallyretrievedviatheServletResponse.getOutputStream()method.
Thisisanabstractclassthattheservletcontainerimplements.Subclassesofthisclassmustimplementthejava.io.OutputStream.write(int)method.
SeeAlso:ServletResponse
ConstructorSummaryprotected
ServletOutputStream()Doesnothing,becausethisisanabstractclass.
MethodSummary
void
print(booleanb)Writesabooleanvaluetotheclient,withnocarriagereturn-linefeed(CRLF)characterattheend.
void
print(charc)Writesacharactertotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
void
print(doubled)Writesadoublevaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
void
print(floatf)Writesafloatvaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
void
print(inti)Writesaninttotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
void
print(longl)Writesalongvaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.
void
print(java.lang.Strings)WritesaStringtotheclient,withoutacarriagereturn-linefeed(CRLF)characterattheend.
voidprintln()Writesacarriagereturn-linefeed(CRLF)totheclient.
void
println(booleanb)Writesabooleanvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
void
println(charc)Writesacharactertotheclient,followedbyacarriagereturn-linefeed(CRLF).
void
println(doubled)Writesadoublevaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
void
println(floatf)Writesafloatvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
void
println(inti)Writesaninttotheclient,followedbyacarriagereturn-linefeed(CRLF)character.
void
println(longl)Writesalongvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).
void
println(java.lang.Strings)WritesaStringtotheclient,followedbyacarriagereturn-linefeed(CRLF).
Methodsinheritedfromclassjava.io.OutputStreamclose,flush,write,write,write
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
ServletOutputStream
protectedServletOutputStream()
Doesnothing,becausethisisanabstractclass.
MethodDetail
publicvoidprint(java.lang.Strings)
throwsjava.io.IOException
WritesaStringtotheclient,withoutacarriagereturn-linefeed(CRLF)characterattheend.Parameters:
s-theStringThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
publicvoidprint(booleanb)
throwsjava.io.IOException
Writesabooleanvaluetotheclient,withnocarriagereturn-linefeed(CRLF)characterattheend.Parameters:
b-thebooleanvaluetosendtotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
publicvoidprint(charc)
throwsjava.io.IOException
Writesacharactertotheclient,withnocarriagereturn-linefeed(CRLF)attheend.Parameters:
c-thecharactertosendtotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
publicvoidprint(inti)
throwsjava.io.IOException
Writesaninttotheclient,withnocarriagereturn-linefeed(CRLF)attheend.Parameters:
i-theinttosendtotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
publicvoidprint(longl)
throwsjava.io.IOException
Writesalongvaluetotheclient,withnocarriagereturn-linefeed(CRLF)
attheend.Parameters:
l-thelongvaluetosendtotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
publicvoidprint(floatf)
throwsjava.io.IOException
Writesafloatvaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.Parameters:
f-thefloatvaluetosendtotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
publicvoidprint(doubled)
throwsjava.io.IOException
Writesadoublevaluetotheclient,withnocarriagereturn-linefeed(CRLF)attheend.Parameters:
d-thedoublevaluetosendtotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln()
throwsjava.io.IOException
Writesacarriagereturn-linefeed(CRLF)totheclient.Throws:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(java.lang.Strings)
throwsjava.io.IOException
WritesaStringtotheclient,followedbyacarriagereturn-linefeed(CRLF).Parameters:
s-theStringtowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(booleanb)
throwsjava.io.IOException
Writesabooleanvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).Parameters:
b-thebooleanvaluetowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(charc)
throwsjava.io.IOException
Writesacharactertotheclient,followedbyacarriagereturn-linefeed(CRLF).Parameters:
c-thecharactertowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(inti)
throwsjava.io.IOException
Writesaninttotheclient,followedbyacarriagereturn-linefeed(CRLF)character.Parameters:
i-theinttowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(longl)
throwsjava.io.IOException
Writesalongvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).Parameters:
l-thelongvaluetowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(floatf)
throwsjava.io.IOException
Writesafloatvaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).Parameters:
f-thefloatvaluetowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
println
publicvoidprintln(doubled)
throwsjava.io.IOException
Writesadoublevaluetotheclient,followedbyacarriagereturn-linefeed(CRLF).Parameters:
d-thedoublevaluetowritetotheclientThrows:
java.io.IOException-ifaninputoroutputexceptionoccurred
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServletRequest
AllKnownSubinterfaces:HttpServletRequest
AllKnownImplementingClasses:ServletRequestWrapper
publicabstractinterfaceServletRequest
Definesanobjecttoprovideclientrequestinformationtoaservlet.TheservletcontainercreatesaServletRequestobjectandpassesitasanargumenttotheservlet'sservicemethod.
AServletRequestobjectprovidesdataincludingparameternameandvalues,attributes,andaninputstream.InterfacesthatextendServletRequestcanprovideadditionalprotocol-specificdata(forexample,HTTPdataisprovidedbyHttpServletRequest.
SeeAlso:HttpServletRequest
MethodSummary
java.lang.Object
getAttribute(java.lang.Stringname)ReturnsthevalueofthenamedattributeasanObject,ornullifnoattributeofthegivennameexists.
java.util.Enumeration
getAttributeNames()ReturnsanEnumerationcontainingthenamesoftheattributesavailabletothisrequest.
java.lang.String
getCharacterEncoding()Returnsthenameofthecharacterencodingusedinthebodyofthisrequest.
int
getContentLength()Returnsthelength,inbytes,oftherequestbodyand
madeavailablebytheinputstream,or-1ifthelengthisnotknown.
java.lang.String
getContentType()ReturnstheMIMEtypeofthebodyoftherequest,ornullifthetypeisnotknown.
ServletInputStream
getInputStream()RetrievesthebodyoftherequestasbinarydatausingaServletInputStream.
java.util.Locale
getLocale()ReturnsthepreferredLocalethattheclientwillacceptcontentin,basedontheAccept-Languageheader.
java.util.Enumeration
getLocales()ReturnsanEnumerationofLocaleobjectsindicating,indecreasingorderstartingwiththepreferredlocale,thelocalesthatareacceptabletotheclientbasedontheAccept-Languageheader.
java.lang.String
getParameter(java.lang.Stringname)ReturnsthevalueofarequestparameterasaString,ornulliftheparameterdoesnotexist.
java.util.Map
getParameterMap()Returnsajava.util.Mapoftheparametersofthisrequest.
java.util.Enumeration
getParameterNames()ReturnsanEnumerationofStringobjectscontainingthenamesoftheparameterscontainedinthisrequest.
java.lang.String[]
getParameterValues(java.lang.Stringname)ReturnsanarrayofStringobjectscontainingallofthevaluesthegivenrequestparameterhas,ornulliftheparameterdoesnotexist.
java.lang.String
getProtocol()Returnsthenameandversionoftheprotocoltherequestusesintheformprotocol/majorVersion.minorVersion,forexample,HTTP/1.1.getReader()
java.io.BufferedReader RetrievesthebodyoftherequestascharacterdatausingaBufferedReader.
java.lang.String
getRealPath(java.lang.Stringpath)Deprecated.AsofVersion2.1oftheJavaServletAPI,useServletContext.getRealPath(java.lang.String)
instead.
java.lang.String
getRemoteAddr()ReturnstheInternetProtocol(IP)addressoftheclientthatsenttherequest.
java.lang.String
getRemoteHost()Returnsthefullyqualifiednameoftheclientthatsenttherequest.
RequestDispatcher
getRequestDispatcher(java.lang.Stringpath)ReturnsaRequestDispatcherobjectthatactsasawrapperfortheresourcelocatedatthegivenpath.
java.lang.String
getScheme()Returnsthenameoftheschemeusedtomakethisrequest,forexample,http,https,orftp.
java.lang.String
getServerName()Returnsthehostnameoftheserverthatreceivedtherequest.
int
getServerPort()Returnstheportnumberonwhichthisrequestwasreceived.
boolean
isSecure()Returnsabooleanindicatingwhetherthisrequestwasmadeusingasecurechannel,suchasHTTPS.
voidremoveAttribute(java.lang.Stringname)Removesanattributefromthisrequest.
void
setAttribute(java.lang.Stringname,
java.lang.Objecto)Storesanattributeinthisrequest.
void
setCharacterEncoding(java.lang.Stringenv)Overridesthenameofthecharacterencodingusedinthebodyofthisrequest.
MethodDetail
getAttribute
publicjava.lang.ObjectgetAttribute(java.lang.Stringname)
ReturnsthevalueofthenamedattributeasanObject,ornullifnoattributeofthegivennameexists.
Attributescanbesettwoways.Theservletcontainermaysetattributestomakeavailablecustominformationaboutarequest.Forexample,forrequestsmadeusingHTTPS,theattributejavax.servlet.request.X509Certificatecanbeusedtoretrieveinformationonthecertificateoftheclient.AttributescanalsobesetprogramaticallyusingsetAttribute(java.lang.String,java.lang.Object).ThisallowsinformationtobeembeddedintoarequestbeforeaRequestDispatchercall.
Attributenamesshouldfollowthesameconventionsaspackagenames.Thisspecificationreservesnamesmatchingjava.*,javax.*,andsun.*.
Parameters:name-aStringspecifyingthenameoftheattribute
Returns:anObjectcontainingthevalueoftheattribute,ornulliftheattributedoesnotexist
getAttributeNames
publicjava.util.EnumerationgetAttributeNames()
ReturnsanEnumerationcontainingthenamesoftheattributesavailabletothisrequest.ThismethodreturnsanemptyEnumerationiftherequesthasnoattributesavailabletoit.Returns:
anEnumerationofstringscontainingthenamesoftherequest's
attributes
getCharacterEncoding
publicjava.lang.StringgetCharacterEncoding()
Returnsthenameofthecharacterencodingusedinthebodyofthisrequest.ThismethodreturnsnulliftherequestdoesnotspecifyacharacterencodingReturns:
aStringcontainingthenameofthechararacterencoding,ornulliftherequestdoesnotspecifyacharacterencoding
setCharacterEncoding
publicvoidsetCharacterEncoding(java.lang.Stringenv)
throwsjava.io.UnsupportedEncodingException
Overridesthenameofthecharacterencodingusedinthebodyofthisrequest.ThismethodmustbecalledpriortoreadingrequestparametersorreadinginputusinggetReader().Parameters:
a-Stringcontainingthenameofthechararacterencoding.Throws:
java.io.UnsupportedEncodingException-ifthisisnotavalidencoding
getContentLength
publicintgetContentLength()
Returnsthelength,inbytes,oftherequestbodyandmadeavailablebytheinputstream,or-1ifthelengthisnotknown.ForHTTPservlets,sameasthevalueoftheCGIvariableCONTENT_LENGTH.Returns:
anintegercontainingthelengthoftherequestbodyor-1ifthelengthisnotknown
getContentType
publicjava.lang.StringgetContentType()
ReturnstheMIMEtypeofthebodyoftherequest,ornullifthetypeisnotknown.ForHTTPservlets,sameasthevalueoftheCGIvariableCONTENT_TYPE.Returns:
aStringcontainingthenameoftheMIMEtypeoftherequest,ornullifthetypeisnotknown
getInputStream
publicServletInputStreamgetInputStream()
throwsjava.io.IOException
RetrievesthebodyoftherequestasbinarydatausingaServletInputStream.EitherthismethodorgetReader()maybecalledtoreadthebody,notboth.Returns:
aServletInputStreamobjectcontainingthebodyoftherequestThrows:
IllegalStateException-ifthegetReader()methodhasalreadybeencalledforthisrequestjava.io.IOException-ifaninputoroutputexceptionoccurred
getParameter
publicjava.lang.StringgetParameter(java.lang.Stringname)
ReturnsthevalueofarequestparameterasaString,ornulliftheparameterdoesnotexist.Requestparametersareextrainformationsentwiththerequest.ForHTTPservlets,parametersarecontainedinthequerystringorpostedformdata.
Youshouldonlyusethismethodwhenyouaresuretheparameterhasonly
onevalue.Iftheparametermighthavemorethanonevalue,usegetParameterValues(java.lang.String).
Ifyouusethismethodwithamultivaluedparameter,thevaluereturnedisequaltothefirstvalueinthearrayreturnedbygetParameterValues.
Iftheparameterdatawassentintherequestbody,suchasoccurswithanHTTPPOSTrequest,thenreadingthebodydirectlyviagetInputStream()orgetReader()caninterferewiththeexecutionofthismethod.
Parameters:name-aStringspecifyingthenameoftheparameter
Returns:aStringrepresentingthesinglevalueoftheparameter
SeeAlso:getParameterValues(java.lang.String)
getParameterNames
publicjava.util.EnumerationgetParameterNames()
ReturnsanEnumerationofStringobjectscontainingthenamesoftheparameterscontainedinthisrequest.Iftherequesthasnoparameters,themethodreturnsanemptyEnumeration.Returns:
anEnumerationofStringobjects,eachStringcontainingthenameofarequestparameter;oranemptyEnumerationiftherequesthasnoparameters
getParameterValues
publicjava.lang.String[]getParameterValues(java.lang.Stringname)
ReturnsanarrayofStringobjectscontainingallofthevaluesthegivenrequestparameterhas,ornulliftheparameterdoesnotexist.
Iftheparameterhasasinglevalue,thearrayhasalengthof1.
Parameters:name-aStringcontainingthenameoftheparameterwhosevalueisrequested
Returns:anarrayofStringobjectscontainingtheparameter'svalues
SeeAlso:getParameter(java.lang.String)
getParameterMap
publicjava.util.MapgetParameterMap()
Returnsajava.util.Mapoftheparametersofthisrequest.Requestparametersareextrainformationsentwiththerequest.ForHTTPservlets,parametersarecontainedinthequerystringorpostedformdata.Returns:
animmutablejava.util.Mapcontainingparameternamesaskeysandparametervaluesasmapvalues.ThekeysintheparametermapareoftypeString.ThevaluesintheparametermapareoftypeStringarray.
getProtocol
publicjava.lang.StringgetProtocol()
Returnsthenameandversionoftheprotocoltherequestusesintheformprotocol/majorVersion.minorVersion,forexample,HTTP/1.1.ForHTTPservlets,thevaluereturnedisthesameasthevalueoftheCGIvariableSERVER_PROTOCOL.Returns:
aStringcontainingtheprotocolnameandversionnumber
getScheme
publicjava.lang.StringgetScheme()
Returnsthenameoftheschemeusedtomakethisrequest,forexample,
http,https,orftp.DifferentschemeshavedifferentrulesforconstructingURLs,asnotedinRFC1738.Returns:
aStringcontainingthenameoftheschemeusedtomakethisrequest
getServerName
publicjava.lang.StringgetServerName()
Returnsthehostnameoftheserverthatreceivedtherequest.ForHTTPservlets,sameasthevalueoftheCGIvariableSERVER_NAME.Returns:
aStringcontainingthenameoftheservertowhichtherequestwassent
getServerPort
publicintgetServerPort()
Returnstheportnumberonwhichthisrequestwasreceived.ForHTTPservlets,sameasthevalueoftheCGIvariableSERVER_PORT.Returns:
anintegerspecifyingtheportnumber
getReader
publicjava.io.BufferedReadergetReader()
throwsjava.io.IOException
RetrievesthebodyoftherequestascharacterdatausingaBufferedReader.Thereadertranslatesthecharacterdataaccordingtothecharacterencodingusedonthebody.EitherthismethodorgetInputStream()maybecalledtoreadthebody,notboth.Returns:
aBufferedReadercontainingthebodyoftherequestThrows:
java.io.UnsupportedEncodingException-ifthecharactersetencodingusedisnotsupportedandthetextcannotbedecodedIllegalStateException-ifgetInputStream()methodhasbeencalledonthisrequestjava.io.IOException-ifaninputoroutputexceptionoccurred
SeeAlso:getInputStream()
getRemoteAddr
publicjava.lang.StringgetRemoteAddr()
ReturnstheInternetProtocol(IP)addressoftheclientthatsenttherequest.ForHTTPservlets,sameasthevalueoftheCGIvariableREMOTE_ADDR.Returns:
aStringcontainingtheIPaddressoftheclientthatsenttherequest
getRemoteHost
publicjava.lang.StringgetRemoteHost()
Returnsthefullyqualifiednameoftheclientthatsenttherequest.Iftheenginecannotorchoosesnottoresolvethehostname(toimproveperformance),thismethodreturnsthedotted-stringformoftheIPaddress.ForHTTPservlets,sameasthevalueoftheCGIvariableREMOTE_HOST.Returns:
aStringcontainingthefullyqualifiednameoftheclient
setAttribute
publicvoidsetAttribute(java.lang.Stringname,
java.lang.Objecto)
Storesanattributeinthisrequest.Attributesareresetbetweenrequests.ThismethodismostoftenusedinconjunctionwithRequestDispatcher.
Attributenamesshouldfollowthesameconventionsaspackagenames.
Namesbeginningwithjava.*,javax.*,andcom.sun.*,arereservedforusebySunMicrosystems.Ifthevaluepassedinisnull,theeffectisthesameascallingremoveAttribute(java.lang.String).
Parameters:name-aStringspecifyingthenameoftheattributeo-theObjecttobestored
removeAttribute
publicvoidremoveAttribute(java.lang.Stringname)
Removesanattributefromthisrequest.Thismethodisnotgenerallyneededasattributesonlypersistaslongastherequestisbeinghandled.
Attributenamesshouldfollowthesameconventionsaspackagenames.Namesbeginningwithjava.*,javax.*,andcom.sun.*,arereservedforusebySunMicrosystems.
Parameters:name-aStringspecifyingthenameoftheattributetoremove
getLocale
publicjava.util.LocalegetLocale()
ReturnsthepreferredLocalethattheclientwillacceptcontentin,basedontheAccept-Languageheader.Iftheclientrequestdoesn'tprovideanAccept-Languageheader,thismethodreturnsthedefaultlocalefortheserver.Returns:
thepreferredLocalefortheclient
getLocales
publicjava.util.EnumerationgetLocales()
ReturnsanEnumerationofLocaleobjectsindicating,indecreasingorderstartingwiththepreferredlocale,thelocalesthatareacceptabletotheclientbasedontheAccept-Languageheader.Iftheclientrequestdoesn'tprovideanAccept-Languageheader,thismethodreturnsanEnumerationcontainingoneLocale,thedefaultlocalefortheserver.Returns:
anEnumerationofpreferredLocaleobjectsfortheclient
isSecure
publicbooleanisSecure()
Returnsabooleanindicatingwhetherthisrequestwasmadeusingasecurechannel,suchasHTTPS.Returns:
abooleanindicatingiftherequestwasmadeusingasecurechannel
getRequestDispatcher
publicRequestDispatchergetRequestDispatcher(java.lang.Stringpath)
ReturnsaRequestDispatcherobjectthatactsasawrapperfortheresourcelocatedatthegivenpath.ARequestDispatcherobjectcanbeusedtoforwardarequesttotheresourceortoincludetheresourceinaresponse.Theresourcecanbedynamicorstatic.
Thepathnamespecifiedmayberelative,althoughitcannotextendoutsidethecurrentservletcontext.Ifthepathbeginswitha"/"itisinterpretedasrelativetothecurrentcontextroot.ThismethodreturnsnulliftheservletcontainercannotreturnaRequestDispatcher.
ThedifferencebetweenthismethodandServletContext.getRequestDispatcher(java.lang.String)isthatthismethodcantakearelativepath.
Parameters:
path-aStringspecifyingthepathnametotheresourceReturns:
aRequestDispatcherobjectthatactsasawrapperfortheresourceatthespecifiedpath
SeeAlso:RequestDispatcher,ServletContext.getRequestDispatcher(java.lang.String)
getRealPath
publicjava.lang.StringgetRealPath(java.lang.Stringpath)
Deprecated.AsofVersion2.1oftheJavaServletAPI,useServletContext.getRealPath(java.lang.String)instead.
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletRequestWrapperjava.lang.Object
|
+--javax.servlet.ServletRequestWrapper
DirectKnownSubclasses:HttpServletRequestWrapper
publicclassServletRequestWrapperextendsjava.lang.ObjectimplementsServletRequest
ProvidesaconvenientimplementationoftheServletRequestinterfacethatcanbesubclassedbydeveloperswishingtoadapttherequesttoaServlet.ThisclassimplementstheWrapperorDecoratorpattern.Methodsdefaulttocallingthroughtothewrappedrequestobject.
Since:v2.3
SeeAlso:ServletRequest
ConstructorSummaryServletRequestWrapper(ServletRequestrequest)CreatesaServletRequestadaptorwrappingthegivenrequestobject.
MethodSummary
java.lang.Object
getAttribute(java.lang.Stringname)ThedefaultbehaviorofthismethodistocallgetAttribute(Stringname)onthewrappedrequestobject.
java.util.Enumeration
getAttributeNames()ThedefaultbehaviorofthismethodistoreturngetAttributeNames()onthewrappedrequestobject.
java.lang.String
getCharacterEncoding()ThedefaultbehaviorofthismethodistoreturngetCharacterEncoding()onthewrappedrequestobject.
int
getContentLength()ThedefaultbehaviorofthismethodistoreturngetContentLength()onthewrappedrequestobject.
java.lang.String
getContentType()ThedefaultbehaviorofthismethodistoreturngetContentType()onthewrappedrequestobject.
ServletInputStream
getInputStream()ThedefaultbehaviorofthismethodistoreturngetInputStream()onthewrappedrequestobject.
java.util.Locale
getLocale()ThedefaultbehaviorofthismethodistoreturngetLocale()onthewrappedrequestobject.
java.util.Enumeration
getLocales()ThedefaultbehaviorofthismethodistoreturngetLocales()onthewrappedrequestobject.
java.lang.String
getParameter(java.lang.Stringname)ThedefaultbehaviorofthismethodistoreturngetParameter(Stringname)onthewrappedrequestobject.
java.util.Map
getParameterMap()ThedefaultbehaviorofthismethodistoreturngetParameterMap()onthewrappedrequestobject.
java.util.Enumeration
getParameterNames()ThedefaultbehaviorofthismethodistoreturngetParameterNames()onthewrappedrequestobject.
java.lang.String[]
getParameterValues(java.lang.Stringname)ThedefaultbehaviorofthismethodistoreturngetParameterValues(Stringname)onthewrappedrequestobject.
java.lang.String
getProtocol()ThedefaultbehaviorofthismethodistoreturngetProtocol()onthewrappedrequestobject.getReader()
java.io.BufferedReader ThedefaultbehaviorofthismethodistoreturngetReader()onthewrappedrequestobject.
java.lang.String
getRealPath(java.lang.Stringpath)ThedefaultbehaviorofthismethodistoreturngetRealPath(Stringpath)onthewrappedrequestobject.
java.lang.String
getRemoteAddr()ThedefaultbehaviorofthismethodistoreturngetRemoteAddr()onthewrappedrequestobject.
java.lang.String
getRemoteHost()ThedefaultbehaviorofthismethodistoreturngetRemoteHost()onthewrappedrequestobject.
ServletRequestgetRequest()Returnthewrappedrequestobject.
RequestDispatcher
getRequestDispatcher(java.lang.Stringpath)ThedefaultbehaviorofthismethodistoreturngetRequestDispatcher(Stringpath)onthewrappedrequestobject.
java.lang.String
getScheme()ThedefaultbehaviorofthismethodistoreturngetScheme()onthewrappedrequestobject.
java.lang.String
getServerName()ThedefaultbehaviorofthismethodistoreturngetServerName()onthewrappedrequestobject.
int
getServerPort()ThedefaultbehaviorofthismethodistoreturngetServerPort()onthewrappedrequestobject.
boolean
isSecure()ThedefaultbehaviorofthismethodistoreturnisSecure()onthewrappedrequestobject.
void
removeAttribute(java.lang.Stringname)ThedefaultbehaviorofthismethodistocallremoveAttribute(Stringname)onthewrappedrequestobject.
void
setAttribute(java.lang.Stringname,
java.lang.Objecto)Thedefaultbehaviorofthismethodistoreturn
setAttribute(Stringname,Objecto)onthewrappedrequestobject.
void
setCharacterEncoding(java.lang.Stringenc)Thedefaultbehaviorofthismethodistosetthecharacterencodingonthewrappedrequestobject.
voidsetRequest(ServletRequestrequest)Setstherequestobjectbeingwrapped.
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
ServletRequestWrapper
publicServletRequestWrapper(ServletRequestrequest)
CreatesaServletRequestadaptorwrappingthegivenrequestobject.Throws:
java.lang.IllegalArgumentException-iftherequestisnull
MethodDetail
getRequest
publicServletRequestgetRequest()
Returnthewrappedrequestobject.
setRequest
publicvoidsetRequest(ServletRequestrequest)
Setstherequestobjectbeingwrapped.
Throws:java.lang.IllegalArgumentException-iftherequestisnull.
getAttribute
publicjava.lang.ObjectgetAttribute(java.lang.Stringname)
ThedefaultbehaviorofthismethodistocallgetAttribute(Stringname)onthewrappedrequestobject.Specifiedby:
getAttributeininterfaceServletRequest
getAttributeNames
publicjava.util.EnumerationgetAttributeNames()
ThedefaultbehaviorofthismethodistoreturngetAttributeNames()onthewrappedrequestobject.Specifiedby:
getAttributeNamesininterfaceServletRequest
getCharacterEncoding
publicjava.lang.StringgetCharacterEncoding()
ThedefaultbehaviorofthismethodistoreturngetCharacterEncoding()onthewrappedrequestobject.Specifiedby:
getCharacterEncodingininterfaceServletRequest
setCharacterEncoding
publicvoidsetCharacterEncoding(java.lang.Stringenc)
throwsjava.io.UnsupportedEncodingException
Thedefaultbehaviorofthismethodistosetthecharacterencodingonthe
wrappedrequestobject.Specifiedby:
setCharacterEncodingininterfaceServletRequest
getContentLength
publicintgetContentLength()
ThedefaultbehaviorofthismethodistoreturngetContentLength()onthewrappedrequestobject.Specifiedby:
getContentLengthininterfaceServletRequest
getContentType
publicjava.lang.StringgetContentType()
ThedefaultbehaviorofthismethodistoreturngetContentType()onthewrappedrequestobject.Specifiedby:
getContentTypeininterfaceServletRequest
getInputStream
publicServletInputStreamgetInputStream()
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistoreturngetInputStream()onthewrappedrequestobject.Specifiedby:
getInputStreamininterfaceServletRequest
getParameter
publicjava.lang.StringgetParameter(java.lang.Stringname)
ThedefaultbehaviorofthismethodistoreturngetParameter(Stringname)onthewrappedrequestobject.Specifiedby:
getParameterininterfaceServletRequest
getParameterMap
publicjava.util.MapgetParameterMap()
ThedefaultbehaviorofthismethodistoreturngetParameterMap()onthewrappedrequestobject.Specifiedby:
getParameterMapininterfaceServletRequest
getParameterNames
publicjava.util.EnumerationgetParameterNames()
ThedefaultbehaviorofthismethodistoreturngetParameterNames()onthewrappedrequestobject.Specifiedby:
getParameterNamesininterfaceServletRequest
getParameterValues
publicjava.lang.String[]getParameterValues(java.lang.Stringname)
ThedefaultbehaviorofthismethodistoreturngetParameterValues(Stringname)onthewrappedrequestobject.Specifiedby:
getParameterValuesininterfaceServletRequest
getProtocol
publicjava.lang.StringgetProtocol()
ThedefaultbehaviorofthismethodistoreturngetProtocol()onthewrappedrequestobject.Specifiedby:
getProtocolininterfaceServletRequest
getScheme
publicjava.lang.StringgetScheme()
ThedefaultbehaviorofthismethodistoreturngetScheme()onthewrappedrequestobject.Specifiedby:
getSchemeininterfaceServletRequest
getServerName
publicjava.lang.StringgetServerName()
ThedefaultbehaviorofthismethodistoreturngetServerName()onthewrappedrequestobject.Specifiedby:
getServerNameininterfaceServletRequest
getServerPort
publicintgetServerPort()
ThedefaultbehaviorofthismethodistoreturngetServerPort()onthewrappedrequestobject.Specifiedby:
getServerPortininterfaceServletRequest
getReader
publicjava.io.BufferedReadergetReader()
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistoreturngetReader()onthewrappedrequestobject.Specifiedby:
getReaderininterfaceServletRequest
getRemoteAddr
publicjava.lang.StringgetRemoteAddr()
ThedefaultbehaviorofthismethodistoreturngetRemoteAddr()onthewrappedrequestobject.Specifiedby:
getRemoteAddrininterfaceServletRequest
getRemoteHost
publicjava.lang.StringgetRemoteHost()
ThedefaultbehaviorofthismethodistoreturngetRemoteHost()onthewrappedrequestobject.Specifiedby:
getRemoteHostininterfaceServletRequest
setAttribute
publicvoidsetAttribute(java.lang.Stringname,
java.lang.Objecto)
ThedefaultbehaviorofthismethodistoreturnsetAttribute(Stringname,Objecto)onthewrappedrequestobject.Specifiedby:
setAttributeininterfaceServletRequest
removeAttribute
publicvoidremoveAttribute(java.lang.Stringname)
ThedefaultbehaviorofthismethodistocallremoveAttribute(Stringname)onthewrappedrequestobject.Specifiedby:
removeAttributeininterfaceServletRequest
getLocale
publicjava.util.LocalegetLocale()
ThedefaultbehaviorofthismethodistoreturngetLocale()onthewrappedrequestobject.Specifiedby:
getLocaleininterfaceServletRequest
getLocales
publicjava.util.EnumerationgetLocales()
ThedefaultbehaviorofthismethodistoreturngetLocales()onthewrappedrequestobject.Specifiedby:
getLocalesininterfaceServletRequest
isSecure
publicbooleanisSecure()
ThedefaultbehaviorofthismethodistoreturnisSecure()onthewrappedrequestobject.Specifiedby:
isSecureininterfaceServletRequest
getRequestDispatcher
publicRequestDispatchergetRequestDispatcher(java.lang.Stringpath)
ThedefaultbehaviorofthismethodistoreturngetRequestDispatcher(Stringpath)onthewrappedrequestobject.Specifiedby:
getRequestDispatcherininterfaceServletRequest
getRealPath
publicjava.lang.StringgetRealPath(java.lang.Stringpath)
ThedefaultbehaviorofthismethodistoreturngetRealPath(Stringpath)onthewrappedrequestobject.Specifiedby:
getRealPathininterfaceServletRequest
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletInterfaceServletResponse
AllKnownSubinterfaces:HttpServletResponse
AllKnownImplementingClasses:ServletResponseWrapper
publicabstractinterfaceServletResponse
Definesanobjecttoassistaservletinsendingaresponsetotheclient.TheservletcontainercreatesaServletResponseobjectandpassesitasanargumenttotheservlet'sservicemethod.
TosendbinarydatainaMIMEbodyresponse,usetheServletOutputStreamreturnedbygetOutputStream().Tosendcharacterdata,usethePrintWriterobjectreturnedbygetWriter().Tomixbinaryandtextdata,forexample,tocreateamultipartresponse,useaServletOutputStreamandmanagethecharactersectionsmanually.
ThecharsetfortheMIMEbodyresponsecanbespecifiedwithsetContentType(java.lang.String).Forexample,"text/html;charset=Shift_JIS".ThecharsetcanalternatelybesetusingsetLocale(java.util.Locale).Ifnocharsetisspecified,ISO-8859-1willbeused.ThesetContentTypeorsetLocalemethodmustbecalledbeforegetWriterforthecharsettoaffecttheconstructionofthewriter.
SeetheInternetRFCssuchasRFC2045formoreinformationonMIME.ProtocolssuchasSMTPandHTTPdefineprofilesofMIME,andthosestandardsarestillevolving.
SeeAlso:ServletOutputStream
MethodSummary
voidflushBuffer()Forcesanycontentinthebuffertobewrittentotheclient.
intgetBufferSize()Returnstheactualbuffersizeusedfortheresponse.
java.lang.String
getCharacterEncoding()ReturnsthenameofthecharsetusedfortheMIMEbodysentinthisresponse.
java.util.LocalegetLocale()Returnsthelocaleassignedtotheresponse.
ServletOutputStream
getOutputStream()ReturnsaServletOutputStreamsuitableforwritingbinarydataintheresponse.
java.io.PrintWriter
getWriter()ReturnsaPrintWriterobjectthatcansendcharactertexttotheclient.
boolean
isCommitted()Returnsabooleanindicatingiftheresponsehasbeencommitted.
void
reset()Clearsanydatathatexistsinthebufferaswellasthestatuscodeandheaders.
void
resetBuffer()Clearsthecontentoftheunderlyingbufferintheresponsewithoutclearingheadersorstatuscode.
void
setBufferSize(intsize)Setsthepreferredbuffersizeforthebodyoftheresponse.
void
setContentLength(intlen)SetsthelengthofthecontentbodyintheresponseInHTTPservlets,thismethodsetstheHTTPContent-Lengthheader.
void
setContentType(java.lang.Stringtype)Setsthecontenttypeoftheresponsebeingsenttotheclient.
voidsetLocale(java.util.Localeloc)Setsthelocaleoftheresponse,settingtheheaders(includingtheContent-Type'scharset)asappropriate.
MethodDetail
getCharacterEncoding
publicjava.lang.StringgetCharacterEncoding()
ReturnsthenameofthecharsetusedfortheMIMEbodysentinthisresponse.
Ifnocharsethasbeenassigned,itisimplicitlysettoISO-8859-1(Latin-1).
SeeRFC2047(http://ds.internic.net/rfc/rfc2045.txt)formoreinformationaboutcharacterencodingandMIME.
Returns:aStringspecifyingthenameofthecharset,forexample,ISO-8859-1
getOutputStream
publicServletOutputStreamgetOutputStream()
throwsjava.io.IOException
ReturnsaServletOutputStreamsuitableforwritingbinarydataintheresponse.Theservletcontainerdoesnotencodethebinarydata.
Callingflush()ontheServletOutputStreamcommitstheresponse.EitherthismethodorgetWriter()maybecalledtowritethebody,notboth.
Returns:aServletOutputStreamforwritingbinarydata
Throws:IllegalStateException-ifthegetWritermethodhasbeencalledonthisresponse
java.io.IOException-ifaninputoroutputexceptionoccurredSeeAlso:
getWriter()
getWriter
publicjava.io.PrintWritergetWriter()
throwsjava.io.IOException
ReturnsaPrintWriterobjectthatcansendcharactertexttotheclient.Thecharacterencodingusedistheonespecifiedinthecharset=propertyofthesetContentType(java.lang.String)method,whichmustbecalledbeforecallingthismethodforthecharsettotakeeffect.
Ifnecessary,theMIMEtypeoftheresponseismodifiedtoreflectthecharacterencodingused.
Callingflush()onthePrintWritercommitstheresponse.
EitherthismethodorgetOutputStream()maybecalledtowritethebody,notboth.
Returns:aPrintWriterobjectthatcanreturncharacterdatatotheclient
Throws:java.io.UnsupportedEncodingException-ifthecharsetspecifiedinsetContentTypecannotbeusedIllegalStateException-ifthegetOutputStreammethodhasalreadybeencalledforthisresponseobjectjava.io.IOException-ifaninputoroutputexceptionoccurred
SeeAlso:getOutputStream(),setContentType(java.lang.String)
setContentLength
publicvoidsetContentLength(intlen)
SetsthelengthofthecontentbodyintheresponseInHTTPservlets,this
methodsetstheHTTPContent-Lengthheader.Parameters:
len-anintegerspecifyingthelengthofthecontentbeingreturnedtotheclient;setstheContent-Lengthheader
setContentType
publicvoidsetContentType(java.lang.Stringtype)
Setsthecontenttypeoftheresponsebeingsenttotheclient.Thecontenttypemayincludethetypeofcharacterencodingused,forexample,text/html;charset=ISO-8859-4.
IfobtainingaPrintWriter,thismethodshouldbecalledfirst.
Parameters:type-aStringspecifyingtheMIMEtypeofthecontent
SeeAlso:getOutputStream(),getWriter()
setBufferSize
publicvoidsetBufferSize(intsize)
Setsthepreferredbuffersizeforthebodyoftheresponse.Theservletcontainerwilluseabufferatleastaslargeasthesizerequested.TheactualbuffersizeusedcanbefoundusinggetBufferSize.
Alargerbufferallowsmorecontenttobewrittenbeforeanythingisactuallysent,thusprovidingtheservletwithmoretimetosetappropriatestatuscodesandheaders.Asmallerbufferdecreasesservermemoryloadandallowstheclienttostartreceivingdatamorequickly.
Thismethodmustbecalledbeforeanyresponsebodycontentiswritten;ifcontenthasbeenwritten,thismethodthrowsanIllegalStateException.
Parameters:size-thepreferredbuffersize
Throws:IllegalStateException-ifthismethodiscalledaftercontenthasbeenwritten
SeeAlso:getBufferSize(),flushBuffer(),isCommitted(),reset()
getBufferSize
publicintgetBufferSize()
Returnstheactualbuffersizeusedfortheresponse.Ifnobufferingisused,thismethodreturns0.Returns:
theactualbuffersizeusedSeeAlso:
setBufferSize(int),flushBuffer(),isCommitted(),reset()
flushBuffer
publicvoidflushBuffer()
throwsjava.io.IOException
Forcesanycontentinthebuffertobewrittentotheclient.Acalltothismethodautomaticallycommitstheresponse,meaningthestatuscodeandheaderswillbewritten.SeeAlso:
setBufferSize(int),getBufferSize(),isCommitted(),reset()
resetBuffer
publicvoidresetBuffer()
Clearsthecontentoftheunderlyingbufferintheresponsewithoutclearingheadersorstatuscode.Iftheresponsehasbeencommitted,thismethodthrowsanIllegalStateException.Since:
2.3SeeAlso:
setBufferSize(int),getBufferSize(),isCommitted(),reset()
isCommitted
publicbooleanisCommitted()
Returnsabooleanindicatingiftheresponsehasbeencommitted.Acommitedresponsehasalreadyhaditsstatuscodeandheaderswritten.Returns:
abooleanindicatingiftheresponsehasbeencommittedSeeAlso:
setBufferSize(int),getBufferSize(),flushBuffer(),reset()
reset
publicvoidreset()
Clearsanydatathatexistsinthebufferaswellasthestatuscodeandheaders.Iftheresponsehasbeencommitted,thismethodthrowsanIllegalStateException.Throws:
IllegalStateException-iftheresponsehasalreadybeencommittedSeeAlso:
setBufferSize(int),getBufferSize(),flushBuffer(),isCommitted()
setLocale
publicvoidsetLocale(java.util.Localeloc)
Setsthelocaleoftheresponse,settingtheheaders(includingtheContent-Type'scharset)asappropriate.ThismethodshouldbecalledbeforeacalltogetWriter().Bydefault,theresponselocaleisthedefaultlocalefortheserver.
Parameters:loc-thelocaleoftheresponse
SeeAlso:getLocale()
getLocale
publicjava.util.LocalegetLocale()
Returnsthelocaleassignedtotheresponse.SeeAlso:
setLocale(java.util.Locale)
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassServletResponseWrapperjava.lang.Object
|
+--javax.servlet.ServletResponseWrapper
DirectKnownSubclasses:HttpServletResponseWrapper
publicclassServletResponseWrapperextendsjava.lang.ObjectimplementsServletResponse
ProvidesaconvenientimplementationoftheServletResponseinterfacethatcanbesubclassedbydeveloperswishingtoadapttheresponsefromaServlet.ThisclassimplementstheWrapperorDecoratorpattern.Methodsdefaulttocallingthroughtothewrappedresponseobject.
Since:v2.3
SeeAlso:ServletResponse
ConstructorSummaryServletResponseWrapper(ServletResponseresponse)CreatesaServletResponseadaptorwrappingthegivenresponseobject.
MethodSummary
void
flushBuffer()ThedefaultbehaviorofthismethodistocallflushBuffer()onthewrappedresponseobject.
int
getBufferSize()ThedefaultbehaviorofthismethodistoreturngetBufferSize()onthewrappedresponseobject.
java.lang.String
getCharacterEncoding()ThedefaultbehaviorofthismethodistoreturngetCharacterEncoding()onthewrappedresponseobject.
java.util.Locale
getLocale()ThedefaultbehaviorofthismethodistoreturngetLocale()onthewrappedresponseobject.
ServletOutputStream
getOutputStream()ThedefaultbehaviorofthismethodistoreturngetOutputStream()onthewrappedresponseobject.
ServletResponsegetResponse()ReturnthewrappedServletResponseobject.
java.io.PrintWriter
getWriter()ThedefaultbehaviorofthismethodistoreturngetWriter()onthewrappedresponseobject.
boolean
isCommitted()ThedefaultbehaviorofthismethodistoreturnisCommitted()onthewrappedresponseobject.
void
reset()Thedefaultbehaviorofthismethodistocallreset()onthewrappedresponseobject.
void
resetBuffer()ThedefaultbehaviorofthismethodistocallresetBuffer()onthewrappedresponseobject.
void
setBufferSize(intsize)ThedefaultbehaviorofthismethodistocallsetBufferSize(intsize)onthewrappedresponseobject.
void
setContentLength(intlen)ThedefaultbehaviorofthismethodistocallsetContentLength(intlen)onthewrappedresponseobject.
void
setContentType(java.lang.Stringtype)ThedefaultbehaviorofthismethodistocallsetContentType(Stringtype)onthewrappedresponseobject.
void
setLocale(java.util.Localeloc)ThedefaultbehaviorofthismethodistocallsetLocale(Localeloc)onthewrappedresponseobject.
voidsetResponse(ServletResponseresponse)Setstheresponsebeingwrapped.
Methodsinheritedfromclassjava.lang.Objectclone,equals,finalize,getClass,hashCode,notify,notifyAll,
toString,wait,wait,wait
ConstructorDetail
ServletResponseWrapper
publicServletResponseWrapper(ServletResponseresponse)
CreatesaServletResponseadaptorwrappingthegivenresponseobject.Throws:
java.lang.IllegalArgumentException-iftheresponseisnull.
MethodDetail
getResponse
publicServletResponsegetResponse()
ReturnthewrappedServletResponseobject.
setResponse
publicvoidsetResponse(ServletResponseresponse)
Setstheresponsebeingwrapped.Throws:
java.lang.IllegalArgumentException-iftheresponseisnull.
getCharacterEncoding
publicjava.lang.StringgetCharacterEncoding()
ThedefaultbehaviorofthismethodistoreturngetCharacterEncoding()onthewrappedresponseobject.Specifiedby:
getCharacterEncodingininterfaceServletResponse
getOutputStream
publicServletOutputStreamgetOutputStream()
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistoreturngetOutputStream()onthewrappedresponseobject.Specifiedby:
getOutputStreamininterfaceServletResponse
getWriter
publicjava.io.PrintWritergetWriter()
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistoreturngetWriter()onthewrappedresponseobject.Specifiedby:
getWriterininterfaceServletResponse
setContentLength
publicvoidsetContentLength(intlen)
ThedefaultbehaviorofthismethodistocallsetContentLength(intlen)onthewrappedresponseobject.Specifiedby:
setContentLengthininterfaceServletResponse
setContentType
publicvoidsetContentType(java.lang.Stringtype)
ThedefaultbehaviorofthismethodistocallsetContentType(Stringtype)onthewrappedresponseobject.Specifiedby:
setContentTypeininterfaceServletResponse
setBufferSize
publicvoidsetBufferSize(intsize)
ThedefaultbehaviorofthismethodistocallsetBufferSize(intsize)onthewrappedresponseobject.Specifiedby:
setBufferSizeininterfaceServletResponse
getBufferSize
publicintgetBufferSize()
ThedefaultbehaviorofthismethodistoreturngetBufferSize()onthewrappedresponseobject.Specifiedby:
getBufferSizeininterfaceServletResponse
flushBuffer
publicvoidflushBuffer()
throwsjava.io.IOException
ThedefaultbehaviorofthismethodistocallflushBuffer()onthewrappedresponseobject.Specifiedby:
flushBufferininterfaceServletResponse
isCommitted
publicbooleanisCommitted()
ThedefaultbehaviorofthismethodistoreturnisCommitted()onthewrappedresponseobject.Specifiedby:
isCommittedininterfaceServletResponse
reset
publicvoidreset()
Thedefaultbehaviorofthismethodistocallreset()onthewrappedresponseobject.Specifiedby:
resetininterfaceServletResponse
resetBuffer
publicvoidresetBuffer()
ThedefaultbehaviorofthismethodistocallresetBuffer()onthewrappedresponseobject.Specifiedby:
resetBufferininterfaceServletResponse
setLocale
publicvoidsetLocale(java.util.Localeloc)
ThedefaultbehaviorofthismethodistocallsetLocale(Localeloc)onthewrappedresponseobject.Specifiedby:
setLocaleininterfaceServletResponse
getLocale
publicjava.util.LocalegetLocale()
ThedefaultbehaviorofthismethodistoreturngetLocale()onthewrappedresponseobject.Specifiedby:
getLocaleininterfaceServletResponse
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD
javax.servletClassUnavailableExceptionjava.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--javax.servlet.ServletException
|
+--javax.servlet.UnavailableException
publicclassUnavailableExceptionextendsServletException
Definesanexceptionthataservletorfilterthrowstoindicatethatitispermanentlyortemporarilyunavailable.
Whenaservletorfilterispermanentlyunavailable,somethingiswrongwiththeit,anditcannothandlerequestsuntilsomeactionistaken.Forexample,aservletmightbeconfiguredincorrectly,orafilter'sstatemaybecorrupted.Thecomponentshouldlogboththeerrorandthecorrectiveactionthatisneeded.
Aservletorfilteristemporarilyunavailableifitcannothandlerequestsmomentarilyduetosomesystem-wideproblem.Forexample,athird-tierservermightnotbeaccessible,ortheremaybeinsufficientmemoryordiskstoragetohandlerequests.Asystemadministratormayneedtotakecorrectiveaction.
Servletcontainerscansafelytreatbothtypesofunavailableexceptionsinthesameway.However,treatingtemporaryunavailabilityeffectivelymakestheservletcontainermorerobust.Specifically,theservletcontainermightblockrequeststotheservletorfilterforaperiodoftimesuggestedbytheexception,ratherthanrejectingthemuntiltheservletcontainerrestarts.
SeeAlso:SerializedForm
ConstructorSummaryUnavailableException(intseconds,Servletservlet,
java.lang.Stringmsg)Deprecated.AsofJavaServletAPI2.2,useUnavailableException(String,int)instead.UnavailableException(Servletservlet,java.lang.Stringmsg)Deprecated.AsofJavaServletAPI2.2,useUnavailableException(String)instead.UnavailableException(java.lang.Stringmsg)Constructsanewexceptionwithadescriptivemessageindicatingthattheservletispermanentlyunavailable.UnavailableException(java.lang.Stringmsg,intseconds)Constructsanewexceptionwithadescriptivemessageindicatingthattheservletistemporarilyunavailableandgivinganestimateofhowlongitwillbeunavailable.
MethodSummary
Servlet
getServlet()Deprecated.AsofJavaServletAPI2.2,withnoreplacement.Returnstheservletthatisreportingitsunavailability.
int
getUnavailableSeconds()Returnsthenumberofsecondstheservletexpectstobetemporarilyunavailable.
boolean
isPermanent()Returnsabooleanindicatingwhethertheservletispermanentlyunavailable.
Methodsinheritedfromclassjavax.servlet.ServletExceptiongetRootCause
Methodsinheritedfromclassjava.lang.ThrowablefillInStackTrace,getLocalizedMessage,getMessage,
printStackTrace,printStackTrace,printStackTrace,toString
Methodsinheritedfromclassjava.lang.Object
clone,equals,finalize,getClass,hashCode,notify,notifyAll,
wait,wait,wait
ConstructorDetail
UnavailableException
publicUnavailableException(Servletservlet,
java.lang.Stringmsg)
Deprecated.AsofJavaServletAPI2.2,useUnavailableException(String)instead.Parameters:
servlet-theServletinstancethatisunavailablemsg-aStringspecifyingthedescriptivemessage
UnavailableException
publicUnavailableException(intseconds,
Servletservlet,
java.lang.Stringmsg)
Deprecated.AsofJavaServletAPI2.2,useUnavailableException(String,int)instead.Parameters:
seconds-anintegerspecifyingthenumberofsecondstheservletexpectstobeunavailable;ifzeroornegative,indicatesthattheservletcan'tmakeanestimateservlet-theServletthatisunavailablemsg-aStringspecifyingthedescriptivemessage,whichcanbewrittentoalogfileordisplayedfortheuser.
UnavailableException
publicUnavailableException(java.lang.Stringmsg)
Constructsanewexceptionwithadescriptivemessageindicatingthattheservletispermanentlyunavailable.Parameters:
msg-aStringspecifyingthedescriptivemessage
UnavailableException
publicUnavailableException(java.lang.Stringmsg,
intseconds)
Constructsanewexceptionwithadescriptivemessageindicatingthattheservletistemporarilyunavailableandgivinganestimateofhowlongitwillbeunavailable.
Insomecases,theservletcannotmakeanestimate.Forexample,theservletmightknowthataserveritneedsisnotrunning,butnotbeabletoreporthowlongitwilltaketoberestoredtofunctionality.Thiscanbeindicatedwithanegativeorzerovalueforthesecondsargument.
Parameters:msg-aStringspecifyingthedescriptivemessage,whichcanbewrittentoalogfileordisplayedfortheuser.seconds-anintegerspecifyingthenumberofsecondstheservletexpectstobeunavailable;ifzeroornegative,indicatesthattheservletcan'tmakeanestimate
MethodDetail
isPermanent
publicbooleanisPermanent()
Returnsabooleanindicatingwhethertheservletispermanentlyunavailable.Ifso,somethingiswrongwiththeservlet,andthesystemadministratormusttakesomecorrectiveaction.Returns:
trueiftheservletispermanentlyunavailable;falseiftheservletisavailableortemporarilyunavailable
getServlet
publicServletgetServlet()
Deprecated.AsofJavaServletAPI2.2,withnoreplacement.Returnstheservletthatisreportingitsunavailability.Returns:
theServletobjectthatisthrowingtheUnavailableException
getUnavailableSeconds
publicintgetUnavailableSeconds()
Returnsthenumberofsecondstheservletexpectstobetemporarilyunavailable.
Ifthismethodreturnsanegativenumber,theservletispermanentlyunavailableorcannotprovideanestimateofhowlongitwillbeunavailable.Noeffortismadetocorrectforthetimeelapsedsincetheexceptionwasfirstreported.
Returns:anintegerspecifyingthenumberofsecondstheservletwillbetemporarilyunavailable,oranegativenumberiftheservletispermanentlyunavailableorcannotmakeanestimate
Overview Package Class Tree Deprecated IndexHelpPREVCLASSNEXTCLASS FRAMESNOFRAMESSUMMARY:INNER|FIELD|CONSTR|METHOD DETAIL:FIELD|CONSTR|METHOD