In java Thread means two different things
---instance of class java.lang.Thread
it is just an object. Like other object it has variable and methods, and lives and dies on the heap.
---A thread of execution
It is individual process (a "lightwaight" process) that has it's own call stack. In java there is one thread per call stack----in revers, one call stack per thread.
----main(), runs in one thread call main thread
Tuesday, August 5, 2008
Friday, July 25, 2008
----Web Server Application serves only static page
----There is a separate Helper Application to which Web Server communicate to build non static just-in-time page.
----Just-in-time page does not exist before the request comes in
----It is like making the HTML page out of thin air
----The request comes in, the helper app "writes" the HTML, and the web server gets it back the the client.
----Servlet : putting HTML inside java class
----JSP: putting java class inside the HTML
----HTTP runs on top of TCP/IP.
-----servlets don't have a main method. They are under the control of another java application called container
------Tomcat is an example of Container
----Web server application like Apache gets a request for servlet, the server hands the request not to the servelet itself, but to the container in which the servlet is deployed. It is the container that calls the servlet's method like doPost() or doGet().
-----Container does the following jobs
a. Communication Support
b. Lifecycle management
c. Multithreading support
d. Declarative security
e. JSP support
-----A servlet can have three names
a. Client known public URL name
b. Deployer Known secret internal name
c. Actual file name
All the above names are mapped in Depoyment descriptor i.e web.xml file
------JAVA 2 Enterprose edition Web Container (Servlet and JSP) and EJB container (business components)
-------Fully complient J2EE application server must have both a web container and an EJB Container including JNDI and JMS
------Tomcat is just a web Container. It is still compliant with the portions of the J2EE spec that address the web container
------Standalone web containers are usually configured to work with an HTTP Web server (like Apache), although the Tomcat Container does have the ability to act as a basic HTTP server. But for HTTP server capability, Tomcat is not nearly as robust as Apache, so the most common non EJB web apps usually use the Apache and the Tomcat configured together--with Apache as the HTTP server, and the Tomcat as the Web Container.
-------Some of the most common J2EE servers are
a. BEA
b. WebLogic
c. JBoss AS
d. IBM WebSphere
----HTTPServlet extends GenericServlet, which implements the Servlet interface
----Servlet Interface
a. All life cycle method
service(ServletRequest, ServletResponse)
init(ServletConfig)
destroy()
b.others
getServletConfig()
getServletInfo()
------GenericServlet abstract class implements Servlet interface. Most of the servlet behavior comes from this class
service(ServletRequest, ServletResponse)
init(ServletConfig)
destroy()
init()
getServletConfig()
getServletInfo()
getInitParameter(String)
getInitParameterNames()
getServletContext()
log(String)
log(String,Throwable)
----HTTPServlet class extends GenericServlet and it is an abstract class. It implements service() method to reflect the HTTPness of the servlet----service() method doesn't take ANY old servlet request and response, but an HTTP -specific request and response
service(HttpServletRequest,HttpServleResponse)
service(ServletRequest, ServletResponse)
doPost(HttpServletRequest,HttpServletResponse)
doGet(HttpServletRequest,HttpRequestResponse)
doHead(HttpServletRequest,HttpRequestResponse)
doOptions(HttpServletRequest,HttpRequestResponse)
doPut(HttpServletRequest,HttpRequestResponse)
doTrace(HttpServletRequest,HttpRequestResponse)
doDelete(HttpServletRequest,HttpRequestResponse)
doLastModified(HttpServletRequest)
---Object of Servlet instanciated once
---Each request runs in a seperate thread
----a servlet has only two states "initialized" or "does not exist"
----when an object is initialized by ServletConfig then it become Servlet
----POST is not the default
----GET is idempotent
----POST is not idempotent
----getServerPort()
---getLocalPort()
---getRemotePort()
---Two choices for output
characters--PrintWriter
bytes-------ServletOutputStream
---server redirect makes browser to do the work
in this case URL at browser get change
---request dispatch does the work on the server side
in this case URL at browser does not change
----There is a separate Helper Application to which Web Server communicate to build non static just-in-time page.
----Just-in-time page does not exist before the request comes in
----It is like making the HTML page out of thin air
----The request comes in, the helper app "writes" the HTML, and the web server gets it back the the client.
----Servlet : putting HTML inside java class
----JSP: putting java class inside the HTML
----HTTP runs on top of TCP/IP.
-----servlets don't have a main method. They are under the control of another java application called container
------Tomcat is an example of Container
----Web server application like Apache gets a request for servlet, the server hands the request not to the servelet itself, but to the container in which the servlet is deployed. It is the container that calls the servlet's method like doPost() or doGet().
-----Container does the following jobs
a. Communication Support
b. Lifecycle management
c. Multithreading support
d. Declarative security
e. JSP support
-----A servlet can have three names
a. Client known public URL name
b. Deployer Known secret internal name
c. Actual file name
All the above names are mapped in Depoyment descriptor i.e web.xml file
------JAVA 2 Enterprose edition Web Container (Servlet and JSP) and EJB container (business components)
-------Fully complient J2EE application server must have both a web container and an EJB Container including JNDI and JMS
------Tomcat is just a web Container. It is still compliant with the portions of the J2EE spec that address the web container
------Standalone web containers are usually configured to work with an HTTP Web server (like Apache), although the Tomcat Container does have the ability to act as a basic HTTP server. But for HTTP server capability, Tomcat is not nearly as robust as Apache, so the most common non EJB web apps usually use the Apache and the Tomcat configured together--with Apache as the HTTP server, and the Tomcat as the Web Container.
-------Some of the most common J2EE servers are
a. BEA
b. WebLogic
c. JBoss AS
d. IBM WebSphere
----HTTPServlet extends GenericServlet, which implements the Servlet interface
----Servlet Interface
a. All life cycle method
service(ServletRequest, ServletResponse)
init(ServletConfig)
destroy()
b.others
getServletConfig()
getServletInfo()
------GenericServlet abstract class implements Servlet interface. Most of the servlet behavior comes from this class
service(ServletRequest, ServletResponse)
init(ServletConfig)
destroy()
init()
getServletConfig()
getServletInfo()
getInitParameter(String)
getInitParameterNames()
getServletContext()
log(String)
log(String,Throwable)
----HTTPServlet class extends GenericServlet and it is an abstract class. It implements service() method to reflect the HTTPness of the servlet----service() method doesn't take ANY old servlet request and response, but an HTTP -specific request and response
service(HttpServletRequest,HttpServleResponse)
service(ServletRequest, ServletResponse)
doPost(HttpServletRequest,HttpServletResponse)
doGet(HttpServletRequest,HttpRequestResponse)
doHead(HttpServletRequest,HttpRequestResponse)
doOptions(HttpServletRequest,HttpRequestResponse)
doPut(HttpServletRequest,HttpRequestResponse)
doTrace(HttpServletRequest,HttpRequestResponse)
doDelete(HttpServletRequest,HttpRequestResponse)
doLastModified(HttpServletRequest)
---Object of Servlet instanciated once
---Each request runs in a seperate thread
----a servlet has only two states "initialized" or "does not exist"
----when an object is initialized by ServletConfig then it become Servlet
----POST is not the default
----GET is idempotent
----POST is not idempotent
----getServerPort()
---getLocalPort()
---getRemotePort()
---Two choices for output
characters--PrintWriter
bytes-------ServletOutputStream
---server redirect makes browser to do the work
in this case URL at browser get change
---request dispatch does the work on the server side
in this case URL at browser does not change
Subscribe to:
Comments (Atom)
