1. What are the implicit objects? -
Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are: request, response, pageContext, session, application, out, config, page, exception.
2. Is JSP technology extensible? -Yes. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
3. How can I implement a thread-safe JSP page?
What are the advantages and Disadvantages of using it? – You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@ page isThreadSafe=”false” %> within your JSP page. With this, instead of a single instance of the servlet generated for your JSP page loaded in memory, you will have N instances of the servlet loaded and initialized, with the service method of each instance effectively synchronized. You can typically control the number of instances (N) that are instantiated for all servlets implementing SingleThreadModel through the admin screen for your JSP engine. More importantly, avoid using the <%! DECLARE %>tag for variables. If you do use this tag, then you should set isThreadSafe to true, as mentioned above. Otherwise, all requests to that page will access those variables, causing a nasty race condition. SingleThreadModel is not recommended for normal use. There are many pitfalls, including the example above of not being able to use <%! %>. You should try really hard to make them thread-safe the old fashioned way: by making them thread-safe
4. How does JSP handle run-time exceptions?
- You can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing page. For example: <%@ page errorPage=”error.jsp” %> redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing. Within error.jsp, if you indicate that it is an error-processing page, via the directive: <%@ page isErrorPage=”true” %> Throwable object describing the exception may be accessed within the error page via the exception implicit object. Note: You must always use a relative URL as the value for the errorPage attribute.
5. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
– You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Just execute the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser. You need both the statements to take care of some of the older browser versions.
<%
response.setHeader(“Cache-Control”,”no-store”); //HTTP 1.1
response.setHeader(“Pragma”,”no-cache”); //HTTP 1.0
response.setDateHeader (“Expires”, 0); //prevents caching at the proxy server
%>
6. How do I use comments within a JSP page?
- You can use “JSP-style” comments to selectively block out code while debugging or simply to comment your scriptlets. JSP comments are not visible at the client. For example:
<%– the scriptlet is now commented out
<%
out.println(“Hello World”);
%>
–%>
You can also use HTML-style comments anywhere within your JSP page. These comments are visible at the client. For example:
Of course, you can also use comments supported by your JSP scripting language within your scriptlets. For example, assuming Java is the scripting language, you can have:
<% //some comment
/**
yet another comment
**/
%>
EJB QUESTIONS
1. What are the different kinds of enterprise beans? -
Different kind of enterrise beans are Stateless session bean, Stateful session bean, Entity bean, Message-driven bean.
2. What is Session Bean? -
A session bean is a non-persistent object that implements some business logic running on the server. One way to think of a session object.
3. What is Entity Bean? -
The entity bean is used to represent data in the database.
4. What are the methods of Entity Bean? -
An entity bean consists of 4 groups of methods, create methods.
5. What is the difference between Container-Managed Persistent (CMP) bean and Bean-Managed Persistent(BMP) ? -
Container-managed persistence (CMP) and bean-managed persistence (BMP). With CMP, the container manages the persistence of the entity bean.
6. What are the callback methods in Entity beans? -
Callback methods allows the container to notify the bean of events in its life cycle. The callback methods are defined in the javax.ejb.EntityBean interface.
7. What is software architecture of EJB? -
Session and Entity EJBs consist of 4 and 5 parts respectively, a remote interface. 8. Can Entity Beans have no create() methods? -
Yes. In some cases the data is inserted NOT using Java application,.
9. What is bean managed transaction? -
If a developer doesn’t want a Container to manage transactions, it’s possible to implement all database operations manually.
10. What are transaction attributes? -
The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method via the enterprise bean’s home or.
11. What are transaction isolation levels in EJB?
– Transaction_read_uncommitted, Transaction_read_committed, Transaction_repeatable_read.
Incoming search terms:
- jsp interview question (7)
- how to block leave page stay on page ? (3)
- how to run jsp file on xampp (3)
- using httrack with facebook (3)
- how to check password strength in jsp (2)
- onselectedindexchanged in jsp (2)
- onselectedindexchange jsp (2)
- password generation in jsp (2)
- Disable back button in browser using jsp (2)
- jsp connect xampp mysql (2)
- cache images in jsp (2)
- jsp code for password strength (2)
- combobox with jsp (2)
- search result in same jsp (1)
- ONCLICK BUTTON IN IE9 (1)
- jsp interview problems (1)
- multiple selection search from database in jsp (1)
- load graphic from url openoffice (1)
- jsp jquery ajax combobox (1)
- jsp thread safe tutorial (1)
- jsp interview questions (1)
- jsp text search in mysql (1)
- jsp simplecaptcha tutorial (1)
- jsp safe ajax proxy (1)
- jsp password strength (1)
- jsp on mamp (1)
- jsp jquery table auto refresh (1)
- jsp programs video (1)
- password strenghth in jsp (1)
- text search using jsp with mysql (1)
- turn off ie do you want to leave this page? (1)
- tutorial simplecaptcha (1)
- tutorial simplecaptcha jsp (1)
- tutorial window location in jsp (1)
- upload images and jsp and tutorial (1)
- web page expired back jsp (1)
- xampp mysql connect with jsp (1)
- text search in jsp using mysql (1)
- text search in jsp (1)
- slideshow using jquery in jsp tutorial (1)
You will also be interested in ,
- MD5 Function and Unique ID in php
- C sharp INTERVIEW QUESTIONS
- How to install XAMPP
- .htaccess some facts and rules
- Javascript setTimeout() Tricks
- Displaying or changing images each day
- J2ee Interview Questions
- Java interview questions
- Fix the problem in getting 500 Internal Server Error In Localhost Due To .htaccess

Nice one…