J2EE Interview Questions and Answers Frequently Asked Questions

Source: Internet
Author: User
1. Difference between forward and redirect
A: forward is the server that requests resources. The server directly accesses the URL of the target address, reads the response content of the URL, and sends the content to the browser, the browser does not know where the content sent by the server comes from, so its address bar is still the original address. Redirect means that the server sends a status code based on logic to tell the browser to request the address again. Generally, the browser will re-request the address with all the parameters just requested, so the session and request parameters can be obtained.
2. What is Web container? A: implement the Web Protocol application in the J2EE specification. this Protocol defines the runtime environment of web programs, including concurrency, security, and lifecycle management. 3. a: (1) JNDI: Java Naming & Directory Interface, Java Naming directory service. the main function is to provide a directory system that allows applications from other places to leave their own indexes on it to quickly find and locate distributed applications.
(2) JMS: Java Message Service, Java Message Service. It mainly implements communication between applications, including point-to-point and broadcast.
(3) JTA: Java transaction API, Java Transaction Service. It provides various distributed transaction services. The application only needs to call the interfaces it provides.
(4) JAF: Java action framework, Java Security Authentication Framework. It provides some security control frameworks for developers to implement their own personalized security control policies through various deployment and customization.
(5) RMI: Remote Method interface, remote method call
4. What technologies are EJB implemented based on? It also describes the differences between sessionbean and entitybean, and between statefulbean and statelessbean.
A: EJB includes Session Bean, Entity Bean, and message driven bean. It is implemented based on JNDI, RMI, Jat, and other technologies. sessionbean is used in J2EE applications to perform some server-side business operations, such as accessing the database and calling other EJB components. entitybean is used to represent the data used in the application system. for clients, sessionbean is a non-persistent object that implements some business logic running on the server. entitybean is a persistent object, it represents an object view of an object stored in persistent storage, or an object implemented by an existing enterprise application.
5. What is the difference between dynamic include and static include in JSP?
A: Implement Dynamic include with JSP: include action <JSP: Include page = "included ded. JSP "Flush =" true "/> always checks for changes in the contained files. It is suitable for inclusion of dynamic pages and can contain parameters. Static include is implemented using the include pseudo code, and changes to the included files are not checked. This applies to static pages containing <% @ include file = "included.htm" %>
6. What are the similarities and differences between JSP and Servlet, and what are their relationships?
A: JSP is an extension of Servlet technology. It is essentially a simple servlet method, with more emphasis on the external expression of the application. After JSP compilation, it is "servlet-like ". The main difference between Servlet and JSP is that the application logic of servlet is in the Java file and is completely separated from the HTML in the presentation layer. In JSP, Java and HTML can be combined into a file with the extension. jsp. JSP focuses on views. servlet is mainly used for control logic.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.