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

Search Interview Questions


 2796 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Java EE - Interview Questions and Answers for 'Java EE' - 60 question(s) found - Order By Newest

next 40
 Q1. 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


Frequently asked. Among first few questions in the J2EE segment of interview.
  Q2. What is deployment descriptor ?

or

What is the use of deployment descriptor ?
Java EE2016-06-04 22:46:40

Ans. Deployment Descriptor which is usually web.xml is used to specify the classes, resources and configuration of the application and how the web server uses them to serve web requests.This file is usually added to WEB-INF folder and contains following

* Servlet entries and url mapping
* Plugins
* Some info regarding authentication / filters
* Landing Page
* Event Handlers

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

   Like      Discuss      Correct / Improve     web.xml   servlets  deployment descriptor     The NewBury Corp  Fast Dolphin  uCertify  General Electric  Cognizant (CTS)  Web coop  HCL Technologies  Tara Consultancy (TCS)  Wipro  Infosys  Cognizant (CTS)  Sonatype  IBM  computer science corporation (CSC)  American Express      basic        frequent

Try 1 Question(s) Test


 Q3. Which of the following file is called deployment descriptor ?

a. application.xml
b. project.xml
c. web.xml
d. build.xml
Java EE
Anonymous
Ans. web.xml

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

   Like      Discuss      Correct / Improve     configuration files   deployment   server   java


 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. 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


 Q7. 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


 Q8. 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


  Q9. 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  Alicen  HCL Technologies  Tata Consultancy (TCS)  Wipro  Infosys  Mindtree  Global Logic  Accenture  Lexis Nexis  Elsevier  Vyom Labs  SVV Geotech      basic        frequent



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. What is servlet Chaining ?Java EE
Anonymous
Ans. Multiple servlets serving the request in chain.

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

   Like      Discuss      Correct / Improve     java   web application   servlets     Barclays        rare


 Q11. what is the use of cookie and session ? and What is the difference between them ?Java EE
Anonymous
Ans. Cookie and Session are used to store the user information. Cookie stores user information on client side and Session does it on server side. Primarily, Cookies and Session are used for authentication, user preferences, and carrying information across multiple requests. Session is meant for the same purpose as the cookie does. Session does it on server side and Cookie does it on client side. One more thing that quite differentiates between Cookie and Session. Cookie is used only for storing the textual information. Session can be used to store both textual information and objects.

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

   Like      Discuss      Correct / Improve     session   session management   java   cookies   authentication   web application   ebay      intermediate


 Q12. 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


 Q13. 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


 Q14. 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


 Q15. 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


 Q16. 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


 Q17. 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


 Q18. 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


 Q19. 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



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. 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


 Q21. 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


 Q22. How many SessionFactory and Session objects are created ?Java EE
Admin
info@buggybread.com
Ans. Single SessionFactory object and multiple session objects for opening different session. Hibernate creates new Session object per thread.

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

   Like      Discuss      Correct / Improve     hibernate   sessionfactory hibernate   session hibernate


  Q23. 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  Oodles Technologies      basic        frequent


 Q24. What doesn Http keep alive header does ?Java EE
Admin
info@buggybread.com
Ans. Http is connection less by default. header informs hosts to keep the connection alive so that the same connection can be reused for multiple communication.

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

   Like      Discuss      Correct / Improve     java   http   http-alive   client server communication


 Q25. 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


 Q26. What do you know about JQuery ?Java EE2016-10-18 11:34:55

Ans. jQuery is a cross platform JavaScript library designed to simplify the client-side scripting of HTML. JQuery is the most popular JavaScript library.

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

   Like      Discuss      Correct / Improve     jquery     Cognizant (CTS)


 Q27. What is an IP address ?Java EE2016-10-18 14:14:38

Ans. An Internet Protocol address is a numerical label assigned to each device participating in a computer network.

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

   Like      Discuss      Correct / Improve     ip address     MagicBricks  Facebook      basic        frequent


 Q28. What is the difference between URI, URL and URN ?Java EE2016-10-12 13:18:54

Ans. URI stands for Uniform Resource Indicator
URL stands for Uniform Resource Locator
URN stands for Uniform Resource Name

URI = URL + URN

For ex - http://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?keyword=url

This is URI. The string from start till .php is URL whereas keyword=url is URN.

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

   Like      Discuss      Correct / Improve     url  urn  uri  web address  internet address     Konnections


 Q29. In this url

http://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?searchOption=label&keyword=url

What is protocol , domain , path and query param ?
Java EE2016-10-12 13:21:28

Ans. the web URI starts with the protocol which is http in this case, javasearch.buggybread.com is the domain in this case which is a subdomain of buggybread.com, /InterviewQuestions is the path, questionSearch.php is the resource, searchOption and keyword are query params.

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

   Like      Discuss      Correct / Improve     url  internet address



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q30. What is the character limit of url and doesn it apply to GET and POST Requests ?Java EE2016-10-12 13:25:09

Ans. Its 2048 and Yes it applies to get request but not POST. As in Get Request , elements are passed as part of the url, this limit applies to Get requests.

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

   Like      Discuss      Correct / Improve     url  internet address


 Q31. What does the web status code 404,500 and 200 mean ?Java EE2016-11-14 11:22:49

Ans. 404 means the resource is not found on the server.The resource might not be deployed correctly.

500 means internal server error which means that resource was located but then it resulted in some exception or error.

200 means Ok.

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

   Like      Discuss      Correct / Improve     web status code     Wipro

Try 1 Question(s) Test


 Q32. What is a web service ?Java EE2016-12-13 14:36:35

Ans. A Web service is a service offered by one system to another, for communication over web through http. XML are JSON are usually used for sending across information from one system to another.

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

   Like      Discuss      Correct / Improve     web service     Myntra  Tata Consultancy (TCS)      basic        frequent


 Q33. What is the difference between http and https ?Java EE2016-12-13 14:41:34

Ans. https encrypts the data using SSL whereas http sends it as plain text, So https is secure protocol whereas http is not.

Moreover https connects on port 443, while HTTP is on port 80

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

   Like      Discuss      Correct / Improve     http  https  web protocols     Myntra        basic


 Q34. Explain some of the http status codes you know ?Java EE2016-12-18 18:09:07

Ans. 500 is Internal Server Error

404 is resource not found

400 is Bad Request

403 is Forbidden

401 is Unauthorized

200 is OK

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

   Like      Discuss      Correct / Improve     http  http status codes     Sophos  Reflexions        frequent


 Q35. What is the difference between ServletConfig and ServletContext ?Java EE2017-01-03 09:51:14

Ans. http://www.java4s.com/java-servlet-tutorials/difference-between-servletconfig-and-servletcontext-in-java/

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

   Like      Discuss      Correct / Improve     ServletConfig  ServletContext     Fidelity National Information Services (FIS)


 Q36. What are different ways for Servlet authentication ?Java EE2017-01-11 15:14:48

Ans. HTTP Basic Authentication
HTTP Digest Authentication
HTTPS Authentication
Form Based Login

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

   Like      Discuss      Correct / Improve     


 Q37. Can we convert a numeric IP address to a web host name ?Java EE2017-01-12 14:19:10

Ans. Yes, using InetAddress.getByName("<IP Address>").getHostName();

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

   Like      Discuss      Correct / Improve     ip address to hostname  INETAddress      intermediate


 Q38. What is a Servlet Filter ?Java EE2017-01-19 11:33:37

Ans. It's an object that can intercept http request and response and hence we can take appropriate action on those requests.

There are different types of filters based on Specifications like

Authentication
Logging
Encryption
Tokenizing

etc

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

   Like      Discuss      Correct / Improve     servlets  servlet filters     Synechron  NexThoughts  Populus Group      basic        frequent


 Q39. What is the difference between filter and filter-mappings xml tag within deployment descriptor ?Java EE2017-01-19 11:36:25

Ans. filter tag speficies the filter name and respective class for handling filter action whereas filter mapping maps the filter to the url patterns ( specifying the url that needs to be intercepted )

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

   Like      Discuss      Correct / Improve     deployment descriptor  web.xml  filters  filter mapping



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q40. Have you heard of SiteMesh ?Java EE2017-01-19 11:39:43

Ans. Sitemesh is a web page layout and decoration framework by OpenSymphony. SiteMeshFilter can intercept the requests and then build UI components (based on configuration) then renders the final page.

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

   Like      Discuss      Correct / Improve     sitemesh


next 40


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

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: