Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Java EE - Interview Questions and Answers for 'J2ee' - 46 question(s) found - Order By Newest | ||||
![]() | ||||
![]() | ||||
| ||||
Ans. The DispatcherServlet configured in web.xml file receives the request. The DispatcherServlet finds the appropriate Controller with the help of HandlerMapping and then invokes associated Controller. Then the Controller executes the logic business logic and then returns ModeAndView object to the DispatcherServlet. The DispatcherServlet determines the view from the ModelAndView object. Then the DispatcherServlet passes the model object to the View. The View is rendered and the Dispatcher Servlet sends the output to the Servlet container. Finally Servlet Container sends the result back to the user. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Session tracking is a mechanism that servlets use to maintain state about a series requests from the same user across some period of time. The methods used for session tracking are: User Authentication - occurs when a web server restricts access to some of its resources to only those clients that log in using a recognized username and password Hidden form fields - fields are added to an HTML form that are not displayed in the client's browser. When the form containing the fields is submitted, the fields are sent back to the server URL rewriting - every URL that the user clicks on is dynamically modified or rewritten to include extra information. The extra information can be in the form of extra path information, added parameters or some custom, server-specific URL change. Cookies - a bit of information that is sent by a web server to a browser and which can later be read back from that browser. HttpSession- places a limit on the number of sessions that can exist in memory. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. REST or Representational State Transfer is a flexible architecture style for creating web services that recommends the following guidelines - 1. http for client server communication, 2. XML / JSON as formatiing language , 3. Simple URI as address for the services and, 4. stateless communication. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application 1. Controller receives the requests and handles overall control of the request 2. Model holds majority of the Business logic, and 3. View comprise of the view objects and GUI component | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. Struts 1 actions are singleton. So all threads operates on the single action object and hence makes it thread unsafe. Struts 2 actions are not singleton and a new action object copy is created each time a new action request is made and hence its thread safe. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. The jsp scriptlet tag can only declare variables not methods whereas jsp declaration tag can declare variables as well as methods. The declaration of scriptlet tag is placed inside the _jspService() method whereas The declaration of jsp declaration tag is placed outside the _jspService() method. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Web server. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. An API is a kind of technical contract which defines functionality that two parties must provide: a service provider (often called an implementation) and an application. an API simply defines services that a service provider (i.e., the implementation) makes available to applications. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. URL is Uniform Resource Locator which is representation of HTTP address. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. HTTP or Hypertext Transfer Protocol is internet protocol for tranmission of hypertext ( text with meta data ) over internet. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Tomcat is a web server and a Servlet container. It is often used as an application server for web-based applications but does not include the complete suite of capabilities that a Java EE application server would supply. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. An asynchronous event is one that occurs at an unpredictable time outside the control of the program that the CPU is running. It is not "synchronized" with the program. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Yes by making entries in web.xml | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Within message.properties file. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. applets Client component like Client side Java codes. Web component like JSP, Servlet WAR Enterprise JavaBeans like Session beans, Entity beans, Message driven beans Enterprise application like WAR, JAR, EAR | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. The Spring Framework supports following five scopes - Singleton prototype request session global-session | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. servlet is a small, server-resident program that typically runs automatically in response to user input. A network socket is an endpoint of an inter-process communication flow across a computer network. We can think of it as a difference between door and gate. They are similar as they both are entry points but they are different as they are put up at different areas. Sockets are for low-level network communication whereas Servlets are for implementing websites and web services | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Session cookies , which are deleted once the session is over. Permanent cookies , which stays at client PC even if the session is disconnected. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Jar is Java Archieve i.e compressed Class or Class / Java files. War comprises of compressed Servlet class files,JSP FIles,supporting files, GIF and HTML files. Ear comprise of compressed Java and web module files ( was files ). | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. A cookie is a small piece of text stored on a user's computer by the browser for a specific domain. Commonly used for authentication, storing site preferences, and server session identification. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. JMS Provides high-performance asynchronous messaging. It enables Java EE applications to communicate with non-Java systems on top of various transports. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. EJB Provides a mechanism that make easy for Java developers to use advanced features in their components, such as remote method invocation (RMI), object/ relational mapping (that is, saving Java objects to a relational database), and distributed transactions across multiple data sources. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. MVC2 | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. 1) It is an Action based MVC based framework which has adopt mvc2. 2) Struts2 is a pull-MVC (or MVC2) framework where action takes the role of the model rather than the controller. The “pull†concepts means views ability to pull data from an action, rather than having a separate model object available. 3) The Model View-Controller pattern in Struts2 is implemented with five core components – actions, interceptors, value stack / OGNL, result types and results / view technologies. 4) XML configuration as well as Annotation option available. 5) POJO based action available so we can write test cases easily. 6) Integration with Spring, tiles and OGNL based expression langugae. 7) Theme based tag libraries integrated with struts tag as well as support of Ajax tag. 8) Can have various view options like jsp, velocity, freemarker etc. 9) We can embed plugin through which we can modify and extend framework features. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Suppose we want to visit a site for any information, information can be represented in different languages like English,German or may be other and their format for presentation can also differ from HTML to PDF or may be Plain text. In this case when an client makes an HTTP request to a server, client can also specify the media types here. Client can specify what it can accept back from host and on the basis of availability the host will return to the client. This is called content negotiation because client and server negotiated on the language and format of the content to be shared. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet. This object allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file location. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page. This object stores references to the request and response objects for each request. The application, config, session, and out objects are derived by accessing attributes of this object.The pageContext object also contains information about the directives issued to the JSP page, including the buffering information, the errorPageURL, and page scope. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. J2EE or Java 2 Enterprise Edition is an environment for developing and deploying enterprise applications. The J2EE platform consists of J2EE components, services, Application Programming Interfaces (APIs) and protocols that provide the functionality for developing multi-tiered and distributed Web based applications. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. LDAP servers are typically used in J2EE applications to authenticate and authorise users. LDAP servers are hierarchical and are optimized for read access, so likely to be faster than database in providing read access. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. There are seven core modules in spring Spring MVC The Core container O/R mapping DAO Application context Aspect Oriented Programming or AOP Web module | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||