Java - Interview Questions and Answers for 'J2ee' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'J2ee' - 44 question(s) found - Order By Newest

Recently asked in Accenture and Fidelity.
 Q1. Explain Flow of Spring MVC ?Spring
Admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   architecture     Accenture  fidelity  IBM India      Basic        frequent


 Q2. What is session tracking and how do you track a user session in servlets?Java EE
Admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   url rewriting   architecture     Infosys


 Q3. What is an API ( Application Programming Interface ) ?
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   api   java      basic        frequent


 Q4. What is URL?
Java EE
Anonymous
Ans. URL is Uniform Resource Locator which is representation of HTTP address.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   http   internet   url      basic        rare


 Q5. What is HTTP ?Java EE
Anonymous
Ans. HTTP or Hypertext Transfer Protocol is internet protocol for tranmission of hypertext ( text with meta data ) over internet.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   http   internet  fidelity     Myntra  AOL Inc      basic        frequent


 Q6. Is tomcat an application or Web server ?
Anonymous
Ans. Application server.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     tomcat   j2ee   web server   application server   build management


 Q7. Is Apache an application or Web server ?
Anonymous
Ans. Web server.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     apache   web server   j2ee


 Q8. What is meant by an "asynchronous event." Give some examples ?Operating System
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   internet   web application   asynchronus   asynchronus communication   architecture     Alten India


 Q9. Can we have multiple servlets in a web application and How can we do that ?Java EE
Anonymous
Ans. Yes by making entries in web.xml

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   servelets   web application   java   web.xml   yes-no   architecture



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. How can we manage Error Messages in the web application ?Solution
Anonymous
Ans. Within message.properties file.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   web application   struts   spring     Trimax IT Infrastructure


 Q11. Why Struts 1 Classes are not Thread Safe whereas Struts 2 classes are thread safe ?
Admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   mvc frameworks   struts   struts1   struts2   struts 1   struts 2   architecture

Try 1 Question(s) Test


 Q12. What are the components of J2EE ?
Admin
info@buggybread.com
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

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   j2ee components


 Q13. What bean scopes does Spring support? Explain them.Spring
Admin
info@buggybread.com
Ans. The Spring Framework supports following five scopes -

Singleton
prototype
request
session
global-session

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   beans   beans scope   at&t  fidelity


 Q14. Difference between socket and servlet ?Java EE
Admin
info@buggybread.com
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

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   networking   servlet   socket   difference between.java.net   technologies   architecture


Very frequently asked.Usually among first few questions.
  Q15. What is MVC ? Design
Anonymous
Ans. The Model/View/Controller pattern, a strategy for dividing responsibility in a GUI component.

The model is the data for the component.

The view is the visual presentation of the component on the screen.

The controller is responsible for reacting to events by changing the model.

According to the MVC pattern, these responsibilities should be handled by different objects.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   mvc   mvc design pattern   design pattern   struts   spring   web application   web frameworks   ebay     HCL Technologies  Tata Consultancy (TCS)  Wipro  United Health Group (UHG)  Accenture  Fidelity  Fidelity Investments   Tieto  Walt Disney  Sharon Software Systems  Tech Mahindra  Amdocs  Deegit  Lexis Nexis  Elsevier      basic        frequent

Try 1 Question(s) Test


Very frequently asked in companies using SOA.
  Q16. What are RESTful Web Services ?Rest
Admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   web services   rest   java   j2ee  architecture     Synechron  CapitalOne  Overstock.com  Ebay  At&t  HCL Technologies  Barclays  Tata Consultancy (TCS)  Cognizant (CTS)  Wipro  Infosys  EPAM  Mphasis      intermediate        frequent


 Q17. What are different types of cookies ?Java EE
Admin
info@buggybread.com
Ans. Session cookies , which are deleted once the session is over.

Permanent cookies , which stays at client PC even if the session is disconnected.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession


 Q18. What is a cookie ?Java EE
admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     cookie   javascript   web application   session management   browser   j2ee     Wayfair  OpenBet  Akamai      basic        frequent


 Q19. Explain JMS ( Java Messaging Services ) ?JMS
Anonymous
Ans. JMS Provides high-performance asynchronous messaging. It enables Java EE applications to communicate with non-Java systems on top of various transports.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   jms     ECI Telecom



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. Explain EJB (Enterprise Java Beans) ?
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     ejb   java   j2ee


 Q21. Which MVC is struts2 based on ?
Anonymous
Ans. MVC2

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     struts2   struts   mvc2   j2ee


 Q22. Explain features of struts2 ?
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     struts2   struts   j2ee


 Q23. what is content negotiation?
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   internet   content negotiation   http   architecture


 Q24. What is a config Object?
Java EE
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlet   jsp   servlet config   servletconfig   javax


 Q25. What is a pageContext Object?
Java EE
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlet   jsp   pagecontext   page context


 Q26. What is J2EE? What are J2EE components and services?
Admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee


 Q27. What are LDAP servers used for ?Java EE
Admin
info@buggybread.com
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   ldap   servers   authentication   authorization   architecture   technical lead   technical architect


 Q28. What are different modules of spring ?
Spring
Admin
info@buggybread.com
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

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications


 Q29. What is Spring configuration file?Spring
Anonymous
Ans. Spring configuration file is an XML file. This file contains the classes information and describes how these classes are configured and introduced to each other.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   spring configuration file     Bosch



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q30. Q: What is default scope of bean in Spring framework?
Spring
Admin
info@buggybread.com
Ans. The default scope of bean is Sing leton for Spring framework.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   bean


Very Frequently asked Spring question.
  Q31. What is bean auto wiring?Spring
Admin
info@buggybread.com
Ans. The Spring container is able to autowire relationships between collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using and elements.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   autowiring   beans   at&t   ge     Infosys  HCL Technologies  Tata Consultancy  Wipro  PwC  Tech Mahindra  AT&T  General Electric  Sophos        frequent


 Q32. What are the phases of the JSP life cycle ?Java EE
Admin
info@buggybread.com
Ans. Translation of JSP PageCompilation of JSP PageClassloading (class file is loaded by the classloader)Instantiation (Object of the Generated Servlet is created).Initialization ( jspInit() method is invoked by the container).Reqeust processing ( _jspService() method is invoked by the container).Destroy ( jspDestroy() method is invoked by the container).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   servelets   web application   jsp   jsp life cycle   mindtree     Span Infotech  PTC  Cybage  iNautix Technologies  TechAspect  Brillio  Modus Information Systems  SAG Infotech   TechProcess Payment Services


 Q33. Difference between the jsp scriptlet tag and jsp declaration tag?Java EE
Anonymous
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.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   jsp   scriptlet tag   declaraation tag   web application


 Q34. What are JSP directives ? What are different types of directives ?Java EE
Admin
info@buggybread.com
Ans. The jsp directives are messages that tells the web container how to translate a JSP page into the corresponding servlet.

There are three types of directives -

page directive
include directive
taglib directive

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   servelets   web application   jsp   jsp ldirectives


 Q35. Which markup languages can be used in restful web services ? Rest
Admin
info@buggybread.com
Ans. XML and JSON ( Javascript Object Notation ).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   web services   rest   java   j2ee   xml   json   architecture      basic        frequent


 Q36. What are advantages of using Servlets over CGI ?Java EE
Admin
info@buggybread.com
Ans. Better Performance as Servlets doesn't require a separate process for a single request.

Servlets are platform independent as they are written in Java.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   servlets   servelets   cgi


 Q37. What is the use of HTTPSession in relation to http protocol ?Java EE
Admin
Admin
Ans. http protocol on its own is stateless. So it helps in identifying the relationship between multiple stateless request as they come from a single source.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   web application   session   httpsession   architecture     uCertify


 Q38. Why using cookie to store session info is a better idea than just using session info in the request ?Java EE
Admin
info@buggybread.com
Ans. Session info in the request can be intercepted and hence a vulnerability. Cookie can be read and write by respective domain only and make sure that right session information is being passed by the client.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture


 Q39. http protocol is by default ... ?Java EE
Admin
info@buggybread.com
Ans. stateless

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



  Q40. Difference between jar , war and ear ?Java EE
Admin
info@buggybread.com
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 ).

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   j2ee   jar   web development   war   ear   build management   release management     Sirius Computer Solutions  HCL Technologies  Wipro  Deloitte  Tech Mahindra  eGain  Southwest Airlines  Aveiro  Accenture  MIMOS Berhad      basic        frequent


 Q41. Action Class is singleton and hence not thread safe in ..

a. All versions of Struts
b. Struts 1
c. Struts 2
d. None of Struts versions
Anonymous
Ans. Struts 1

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     struts   j2ee   mvc frameworks   struts1   struts2


 Q42. Are Servlet classes Thread Safe ?Java EE
Prabhakar
kumar12abhakar@gmail.com
Ans. No

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     servlets   j2ee    web


 Q43. What are the different J2EE modules ?Java EE2017-01-23 12:50:20

Ans. 1. Application Client Module
2. Web Module
3. EJB
4. Resource Adapter

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee  j2ee modules


 Q44. What does the Web module contains ?Java EE2017-01-23 12:51:40

Ans. JSP files, media files and deployment descriptor ( web.xml )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     j2ee  j2ee web module




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

Java/J2EE Job Interview Companion by Arulkumaran Kumaraswamipillai: I would rate this as above average ... Anonymous

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: