61, the life cycle of servlet
The web container loads servlet, and the life cycle begins. The initialization of the servlet is performed by calling the servlet's init () method. Different DO *** () methods are called depending on the request different by calling the service () method. End the service, the Web container calls the servlet's Destroy () method.
62, how to real real servlet single-thread mode
<% @ page isthreadsafe = "false"%>
63. Method of page object delivery
REQUEST, SESSION, Application, Cookie, etc.
64. What are the same and different from JSP and servlets, what is the connection between them?
JSP is an extension of servlet technology, essentially a simple way of servlet, and emphasizes the application's appearance expression. After JSP compiles "class servlet". The most important point of Servlet and JSP is that the application logic of servlet is in the Java file and is completely separated from the HTML in the representation. The case of JSP is that Java and HTML can be combined into a file that extension .jsp. JSP focuses on views, servlet is mainly used to control logic.
65, four session tracking technology
Session Scope ServletsJSP page description
Page No is a representative object and attribute related to a page. A page is represented by a compiled Java Servlet class (which can have any include instructions, but no include action). This includes both servlets and JSP pages compiled into a servlet.
Request is an object and attribute that represents a request issued to a web client. A request may span multiple pages, involving multiple web components (due to the relationship between the Forward Directive and the Include action)
Session is an object and attribute that represents a user experience with a web client. A web session can also request a number of client requests
Application is the object and attribute that represents the entire web application. This is essentially a global scope of the entire web application, including multiple pages, requests, and sessions.
66. The main method of the Request object:
SetAttribute (String Name, Object): Sets the parameter value of the request named name Name
GetaTtribute (String Name): Returns the value specified by name
GetAttributeNames (): Returns the name collection of all properties of the Request object, the result is an instance of an enumeration
getCookies (): Returns all Cookie objects of the client, the result is a cookie array
GetCharacterencoding (): Returns the character encoding method in the request
getContentLength (): Returns the length of the request
GetHeader: Get the file header information defined by the HTTP protocol
GetHeaders: Returns all values of the Request Header of the specified name, the result is an instance of an enumeration
GetHeadernames (): Returns the name of the Request Header, the result is an instance of an enumeration
GetInputStream (): Returns the requested input stream for obtaining the data in the request
GetMethod (): Get the method of transmitting data to server-side
GetParameter (String Name): Get the client to send to the server-side parameter value
getParameterNames (): Get the name of all the parameters of the client to the server side, the result is an enumerated instance getParameterValues (String Name): Get all the values of the parameters specified by Name
GetProtocol (): Get the name of the protocol that the client is transferred to the server.
getQueryString (): Get query strings
getRequesturi (): Get the client address that issues a request string
getRemoteAddr (): Get the IP address of the client
getRemotehost (): Get the name of the client
GetSession ([Boolean Create]): Return and request related session
GetServerName (): Get the name of the server
GetServletPath (): Get the path to the script file requested by the client
GetServerPort (): Get the port number of the server
Removettribute (String Name): Delete a property in the request
67. J2EE is a platform or a framework?
J2EE itself is a standard, a standard platform provided for the development of a distributed application.
J2EE is also a framework, including JDBC, JNDI, RMI, JMS, EJB, JTA and other technologies.
68. We often encounter some coded characters in the web application development process, such as ISO8859-1, how to output a certain coded string?
Public String Translate (String Str) {
String tempstr = ""
Try {
Tempstr = New String (Str.GetBytes ("ISO-8859-1"), "GBK");
Tempstr = tempstr.trim ();
}
Catch (Exception E) {
System.err.println (E.GetMessage ());
}
Return Tempstr;
}
69. Brief description of the difference between logic operation (&, |, ^) and conditional operation (&&, ||).
The difference between the two points: a. Condition operation can only be operated by Boolean, but logic operations can not only manipulate Boolean, but also operate value
b. Logic operations do not produce short circuits
70, how many forms of XML document definition? What is the essence difference between them? What kind of way to parse XML documents?
A: Two forms of DTD Schema, B: Essentially difference: Schema itself is XML, can be parsed by XML parser (this is also developing SCHEMA from DTD), C: There are DOM, SAX, Stax, etc.
DOM: It is very powerful when processing large files. This problem is caused by the tree structure of the DOM. This structure is more memory, and the DOM must load the entire document into memory before parsing the file. Suitable for random access to XML
SAX: Not present in DOM, SAX is an event-driven XML parsing method. It sequentially reads the XML file, and does not need to load all files all. When encountered at the beginning of the file, the end of the document, or the label is ended, it triggers an event, and the user handles the XML file by writing processing code in its callback event, suitable for the order of XML.
Stax: streaming API for XML (stax)
71, briefly describe the Similarities and As of Synchronized and java.util.concurrent.locks.lock?
Mainly identical: Lock can complete all the features implemented by SYNCHRONIZED
The main differences: LOCK has more accurate thread semanties and better performance than Synchronized. Synchronized will automatically release the lock, and LOCK must request the programmer manually to release and must be released in the finally clause. 72, EJB role and three objects
A complete EJB-based distributed computing structure consists of six roles, which can be provided by different developers, and every role must follow the EJB specification provided by Sun to ensure compatibility between each other. Sex. These six characters are EJB component developers, Application ASSEMBLERs, deployers, EJB server providers, EJB container providers (EJB container providers, System administrator
Three objects are Remote (local) interface, home (localhome) interface, Bean class
73, the service provided by EJB container
It mainly provides services such as declaration cycle management, code generation, continuous management, security, transaction management, lock and distribution management.
74. What are the prohibition of the prohibited operation in EJB?
1. Can't operate threads and threads API (thread API means NOTINE, WAIT, etc.), 2. Can not operate AWT, 3. Can not implement server functionality, 4. Can not be given to static life, 5. Cannot be used IO operation directly access file system, 6. You can't load local libraries.
75, the main role of the Remote interface and HOME interface
The Remote Interface defines a business method for the EJB client calling business method.
The HOME interface is an EJB factory for creating and removing a lookup EJB instance
76, lifecycle of bean instance
For Stateless Session Bean, Entity Bean, Message Driven Bean typically exists in cache management, which typically contains Cache management, set up the context, create EJB Object (create), business method call, remove, etc. Procedure, for the bean in which the buffer is managed, the instance is not removed from memory, but the buffer pool scheduling mechanism continues to reuse the instance, and the bean in which Cache Management is used, the BEAN is maintained by activating and deactivating the mechanism. Limit the number of instances in memory.
77, EJB activation mechanism
Take Stateful Session Bean as an example: The Cache size determines the number of bean instances that can exist in memory. According to the MRU or NRU algorithm, instance is migrated between activation and deactivation, and the activation mechanism is when the client calls an EJB. When an instance business method, if the corresponding EJB Object discovers that it does not bind the corresponding bean instance, the reactive bean storage (by serializing mechanism storage instance) is replied (activated) this instance. The corresponding EJBACTIVE and EJBPASSIVATE methods are called before the state change.
Several types of 78, EJB
Session Bean, entity (Entity) bean message driver (Message Driven) bean
Session bean can be divided into stateful and stateless, two entity beans can be divided into two kinds of sustainability (BMP) and container management of BEAN management (CMP).
79. Several basic steps for customer service calls EJB objects
Set the JNDI service factory and the JNDI service address system property, find the Home interface, call the CREATE method from the Home interface to create a Remote interface, and call its business method through the Remote interface.
80, how to specify the size of the size to WebLogic?
In the Script of WebLogic (bitservername in the Domian corresponding server directory), add SET MEM_ARGS = -XMS32M -XMX200M, adjust the minimum memory to 32M, maximum 200M