2
SATEESH N
GET Environment variablesPOST StreamsHEAD Commandline args
URL Coding :
Whenever a WEB Browser is required to send data to the WEB Server the WEB Browserconverts the data in a particualar format, which is known as URL coding. The server isde program receives theconverted data undos the conversion and process the data.The following 4 rules will be used by the WEB Browsers for URL coding.1. All the fields will be separated by & symbol.2. Each field contains the name of the field and the value of the field separated by = symbol.3. All spaces will be converted to + symbols.4. All special characters such as +, & etc., will be converted to hexadecimal values prefixed with %symbol.Ex:http://myserver.com/SSPname?Empno=101&Ename=abc+xyz&Job=clk%xxAccServer ssp param1 value1 p2 v2 p3 v3In Java the SSPs can be written in sevlets and jsp.
Creating a Servlet :
To create a servlet create a class that extends the “HttpServlet” class and overrideany or both of the following methods (i) doGet( ) (ii) doPost( )
à
If the WEB Browser sends the data in the “Get( ) “ method then “doGet( )” method of servlet will beexecuted.
à
If the WEB Browser sends the data in the “Post” method then the “doPost( )” method of the servletwill be execued.
à
If the WEB Browser doesnot specify any method, then the “doGet( )” will be executed.Syntax :DoGet( ) : public void doGet(HttpServletRequest, HttpServletResponse) throws ServletException,IO ExceptionDoPost( ):public void doPost(HttpServletRequest,HttpServletResponse) throws ServletException,IO ExceptionThe “request” object contains the data that was received from the WebBrowser and the “response”allows us to send the output back to the WebBrowser.While exchanging data between the WEB Browser and WEB Server the following 2 objects are used:Request and Response.tomcatrequestresponse
user name :password :Login
WEB ServerServer Side Program
user name :password :Login
WEB ServerServer Side Program
Leave a Comment