How can I print the stack trace of an exception from a JSP page?
To print the stack trace of an exception from a JSP page you will have to use a PrintWriter object instead of usnig JSP out implicit variable.
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
In the above code you have import="java.io.* package.
What is deployment descriptor?
Deployment descriptor is a configuration file named web.xml that specifies all the pieces of a deployment. It allows us to create and manipulate the structure of the web application. Deployment descriptor describes how a web application or enterprise application should be deployed. For web applications, the deployment descriptor must be called web.xml and must reside in a WEB-INF subdirectory at the web application root. Deployment descriptor allows us to modify the structure of the web application without touching the source code.Reply
What is the container?
The Web container provides the runtime environment through components that provide naming context and life cycle management, security and concurrency control. A web container provides the same services as a JSP container as well as a federated view of the Java EE. Apache Tomcat is a web container and an implementation of the Java Servlet and JavaServer Pages technologies.Reply
Is HTML page a web component?
No! Html pages are not web component, even the server-side utility classes are not considered web components. Static HTML pages and applets are bundled with web components during application assembly, but are not considered web components by the J2EE specification.Reply
What is the use of setSecure() and getSecure() in Cookies ?
The setSecure(boolean flag) method indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
The getSecure() method returns true if the browser is sending cookies only over a secure protocol, or false if the browser can send cookies using any protocol.Reply
Why we are used setMaxAge() and getMaxAge() in Cookies ?
The "public void setMaxAge(int expiry)" method sets the maximum age of the cookie. After the specified time the cookie will be deleted.
The "public int getMaxAge()" method will return the maximum specified age of the cookie.Reply
What is a Session Id?
A Session ID is a unique identifier given by the server to the specific client to support communicatio between for a time period. The session ID can be stored as a cookie, form field, or URL (Uniform Resource Locator). Some Web servers generate session IDs by simply incrementing static numbers. However, most servers use algorithms that involve more complex methods, such as factoring in the date and time of the visit along with other variables defined by the server administrator. Reply
What are the different types of ServletEngines?
A servlet engine handles the client requests for servlets, JSP files, and other types of server-side include coding. The servlet engine creates servlet instances, loads and unloads servlets, manage the servlet life cycle, creates and manages request and response objects, and performs other tasks for managing servlets effectively.
If the server application is written as a Java Servlet, it will need a place to execute, and this place is typically called a Servlet Engine. When you move on to Enterprise JavaBeans, you move into the application server space. An Application Server is any server that supplies additional functionality related to enterprise computing -- for instance, load balancing, database access classes, transaction processing, messaging, and so on.
EJB Application Servers provide an EJB container, which is the environment that beans will execute in, and this container will manage transactions, thread pools, and other issues as necessary. Reply
What are the different web servers available name few of them?
The different web servers are :
* Apache Tomcat
* Apple WebObjects
* ATG Dynamo
* BEA WebLogic
* Borland Enterprise Server
* Caucho Resin
* Fujitsu Siemens Computers BeanTransactions
* Gefion Software LiteWebServer
* IBM Websphere
* Macromedia JRun Server
* Persistence Power Tier for J2EE
* Sybase EAServer
* Sun Microsystems Sun Java System Application ServerReply
When a session object gets added or removed to the session, which event will get notified ?
When an object is added or removed from a session, the container checks the interfaces implemented by the object. If the object implements the HttpSessionBindingListener, the container calls the matching notification method. To receive this notification, your object must implement the javax.http.HttpSessionBindingListener interface.Reply