Javaweb face question
1. What are the advantages of CSS and div development?
Separation of display and content enables search engine search to facilitate maintenance and program expansion
2. What are the ways to transfer parameters between pages?
Parameter passing through the session of the scope object, the setattribute () and the GetAttribute () method of the request.
<jsp:forward> <jsp:param name= value=></jsp:forward>
Request.gerrequestdispatcher ("1.jsp?name=xx"). Forward (Request,response);
<jsp:usebean id= class= scope=request/session>
3. What is the role of the hidden form field?
4. What are the built-in objects for JSP?
Pagecontex,request,session,application,out,exception,config,page,
5. What is the role of request?
Gets the parameter value passed by the client gets the client request header information gets the session gets the forwarding object can be used as a container, using the setattribute () and GetAttribute () methods for parameter passing
6. What is the function of the session?
7. What is the role of application?
8. How to manipulate page scopes in JSP
9. What are the actions of JSP?
<jsp:include/> <jsp:forward/><jsp:usebean/> <jsp:setProperty/><jsp:getProper>
Request.getrequestdispatcher ("1.jsp?name=xx"). Forward (Request,response);
What is the difference between forward () and redirect () in the Java servlet API?
What is the role of Class.forName?
Load class; This method is typically used to create objects in a reflection fashion, so that some class information can be written in a file, avoiding hard coding and increasing flexibility.
How does paging be implemented?
How do I use a session after a cookie is banned?
How many stages has the project been developed?
about the project body system Architecture : (Customer layer, presentation layer) Web tier, business layer, data tier?
What are the component technologies in the Java EE specification that are used in the project?
Jdbc,jsp,servlet,javabean,xml,jndi
What is the difference between TCP/IP Communications and UDP communication?
What protocol does the browser and Web server use for communication?
The application layer uses the HTTP protocol, and the transport and routing uses TCP/IP
in network communication, what does the port mean? What is the value range of the port?
Ports are used to differentiate between different applications based on TCP/IP communication, and each TCP/IP-based application applies to the operating system to register a service that is represented by a port. Essentially, a port is a buffer in memory. It can be regarded as the export of computer communication with the outside world.
Recommended port number for users-----65535 system uses a range of ports 0---1024
say the default port for 3 common protocols.
Web server 80,ftp 21,telenet 23,smtp 25
What is a socket and what does it do?
The socket is the endpoint of the communication and the endpoint that the client and the server communicate with.
What are the basic steps of TCP/IP communication?
What are the basic steps for UDP communication?
What are the basic steps for JDBC to access a database?
Tell me the difference between PreparedStatement and statement .
about the concept of transactions, the steps to handle transactions in JDBC programming.
1) A transaction is a series of operations performed as a single logical unit of work.
2) A logical unit of work must have four properties, called atomicity, consistency, isolation, and persistence (ACID) properties, to be a transaction
Transaction process steps:
3) Conn.setautocomit (false); Set submit by hand
4) Conn.commit () COMMIT Transaction
5) exception occurred, rollback Conn.rollback ();
principle of database connection pooling . Why you use connection pooling.
1) A database connection is a time-consuming operation, and a connection pool enables multiple operations to share a single connection.
2) The basic idea of database connection pooling is to establish a "buffer pool" for database connection. A certain number of connections are pre-placed in the buffer pool, and when a database connection needs to be established, simply take one out of the buffer pool and put it back when you are finished. We can prevent the system from endlessly connecting to the database by setting the maximum number of connections to the connection pool. More importantly, we can monitor the number of connections to the database through the management mechanism of the connection pool? Usage, provide basis for system development, test and performance adjustment.
3) connection pooling is used to improve the management of database connection resources
about the principle of the DAO pattern.
DAO is a design pattern
Includes three parts 1) DAO interface
2) DAO interface implementation class,
3) Po Persistence object, which corresponds to the database
What is the relationship between Servlets and JSPs?
Both Servlets and JSPs are components of the server.
JSP heavy in the expression, resolves the servlet page output difficult problem. While the servlet is heavy on the business process, avoids the difficulty of reading and maintainability caused by excessive business processing on the page. They can be very well combined.
After the servlet has been written, it needs to be registered in Web application's XML., allowing the Web container to recognize the user-encoded servlet. However, the JSP is managed by the container, so there is no need to register.
How is JSP invoked and executed by a container?
to write a servlet step.
How does the doget and Dopost methods work?
Why do you want to configure URL mappings for the servlet?
What is the class architecture of the servlet.
Talk about the life cycle of the servlet?
is the servlet thread -safe? Why?
Not secure. Because the Servlet object has only one object in the process, from beginning to end. To conserve the consumption of server resources, which means that many threads will access a Servlet object at the same time. So the thread is not secure.
Panax Notoginseng. where do you go with the servlet thread safety issue?
There are three ways to solve the servlet thread safety problem
1) When writing a servlet class, implement the Singlethreadmodel interface and turn the servlet into a single-threaded mechanism.
2) When it comes to access to shared resources, use synchronized to synchronize and lock to achieve the protection of shared resources.
3) Try not to define member variables in the servlet, using local variables.
Of the three methods, it is best to use a third, which is thread-safe and has the highest performance.
How to get the request parameters of the client?
Request.getparameter () Single data
Request.getparametervalues () a set of data
Request.getparametermap () returns all key-value pairs
What is the difference between Request.getparameter and request.getparametervalues, and what type of return value are they?
What is the role of the response object?
What is the scope of the request object?
What is the scope of the Session object?
What is the scope of the Application object.
What time did the session object occur and when was it destroyed?
The Session object is used in the project, where is it used?
What is the difference between a session and a cookie?
47.. The Http protocol is stateless, how does the server save state for a client?
can a servlet or JSP respond to requests from multiple clients at the same time? By what means?
Please briefly describe how the servlet multithreading is implemented.
Define member variables (global variables) in the servlet, thread security issues? How to deal with?
The difference between request forwarding and redirection.
The difference between dynamic and static inclusions in a JSP.
1) static contains the files that will be included when converting to a Java file, compiled as a whole. A dynamic inclusion is a separate conversion of each containing file, compiled separately.
2) statically contained in two files cannot have the same variable, dynamically containing allowed
3) static contains only files, dynamic inclusions can also contain results of servlet output
4) static contains cannot use variable as file name, dynamic inclusion can use variable as filename
5) Dynamic include file changes, including the file will be aware of changes.
Talk about the concept of MVC design patterns and the benefits of using MVC.
The difference between Mode 1 and Mode 2.
Mode 1:jsp+javabean
Mode 2:jsp+servlet+javabean
How many tables are there in your project, and which one is the most field? What fields are there in each table?
tell me about your project development process.
about the business process of the module you are developing, what is the business?
about the principle, configuration and use of the listener. How do you use it in the project?
about the principle, configuration and use of the filter. How are multiple filters configured?
What is your role in the project and how do you work?
What do you do, how do you coordinate with the work of other team members ( database design , program module preparation, etc. two aspects);
A page with two form, how to handle the submission?
You can use the name of the submit button to judge, or you can use hidden to hide the form to differentiate values.
What is the difference between a Web project and a Java project?
How do I manually publish a Tomcat project without eclipse?
How does the MVC pattern work in a project?
Please talk about the principle of request forwarding?
67. Please explain the principle of redirection?
How do you reconcile the data that you call from other people's tables?
How do I get the company to merge with the team members when I develop the module at home?
How do you deal with garbled characters in a project?
Talk about the implementation of pagination in the project.
What are the options for CSS? What's the difference?
What are the ways you share data in a Web project? What if it's implemented?
What kind of documentation will be generated at each stage of the project? What's the effect?
How is the project structure divided? What should I pay attention to?
How do I get the HTTP header information in the. servlet?
Can you get the IP address of the client in the. servlet program? How to get it?
What is the difference between a URL and a URI?
When is the service method in the servlet called?
What is the principle of file upload multipart/form-data "What does that mean?"
What should I pay attention to when I write the file upload form?
What did you do with the project when the file was uploaded to the server?
How to Package a Web project?
JAR–CF Xx.war web-inf *.html *.jsp *.jpg
What is the role of MIME?
Tell the client browser what type of content you are returning, and let the browser take the appropriate policy to display the document or file that you are returning.
How does the Tomcat container create instances of servlet classes? What's the principle?
<load-on-startup>1</load-on-startup> if it is a positive number, it is instantiated at the beginning, and if it is not written or negative, the first request is instantiated.
If you can execute initialization code in the Servlet constructor, why do you want the Init method?
Where were the HttpServletRequest and HttpServletResponse created?
What is the difference and connection between ServletRequest and HttpServletRequest?
ServletRequest is the parent interface of HttpServletRequest
How do I get to an absolute path to a project in a servlet?
Request.getcontextpath ();
What is the role of the Taglib directive in JSP?
This directive is a tag library directive. Indicates the logical path of the tag library and the use prefix of the tag library.
Use the taglib Directive <% @taglib uri= "" prefix= ""%>
How is file download implemented? How to guarantee The download of authorized users?
1) Set Setcontexttype (), MIME type.
2) Open the file and send the number of bytes to the client in the binary stream mode.
in the servlet, how do I get the initialization parameters configured in Web. xml?
Servletconfig.getinitparameter ()
How do i make a URL rewrite? What's the way to use it?
Response.encodeurl ();
How does the session expire? How is the project applied?
What is the role of the. Tomcat container?
98. in a servlet, how do I output information directly to the client?
How does the import directive in JSP work?
101. How do I use a bean in a JSP?
103. When publishing a project, what is the difference between putting a JSP file under Webroot, and placing it under Web-inf?
What is the role of the Welcome-file configuration item in 104. xml?
What is the role of response.senderror in the servlet?
106. How to use filter to achieve user login authentication?
What is Jstl?
What can be done to validate the legitimacy of the data format for the data entered by the customer?
118. What is the basic principle of Ajax?
119.What are the differences between 119, JSP, and JavaScript ?
Web Face questions