Server-Side Development Section Index | Page 183
Can a JSP page process HTML FORM data?
Yes. However, unlike servlets, you are not required to implement HTTP-protocol specific
methods like doGet() or doPost() within your JSP page. You can obtain the data for the
FORM input elements...more
How can I implement a thread-safe JSP page?
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...more
How can I override the jspInit() and jspDestroy() methods within a JSP page?
The jspInit() and jspDestroy() methods are each executed just once during the lifecycle
of a JSP page and are typically declared as JSP declarations:
<%!
public void jspInit() {
. . .
}...more
How do I include static files within a JSP page?
Static resources should always be included using the JSP include directive.
This way, the inclusion is performed just once during the translation phase.
The following example shows the syntax:
...more
How do I perform browser redirection from a JSP page?
You can use the response implicit object to redirect the browser to a different resource, as:
response.sendRedirect("http://www.foo.com/path/error.html");
You can also physically alter
the Loc...more
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 beg...more
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 script...more
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.js...more
What JSP lifecycle methods can I override?
You cannot override the _jspService() method within a JSP page.
You can however, override the jspInit() and jspDestroy() methods within a JSP page.
jspInit() can be useful for allocating resourc...more
What's so special about Enterprise JavaBeans?
Enterprise JavaBeans simplifies the task of developing distributed objects systems. It's easier for developers to create transactional distributed object applications with EJB than with any other...more
Does the new specification impact forward compatibility?
The new specification requires minor changes to ejbCreate method in container-managed
entity beans as well as changes in how enterprise beans access
JDBC connections, environment properties, and o...more
How is Version 1.1 better than Version 1.0?
EJB 1.1 requires support for entity beans, which ensures a more consistent programming model across vendors. In addition, EJB 1.1 addresses many of the ambiguities and loopholes found in the prev...more
Is Enterprise JavaBeans 1.0 still viable?
Several servers will avoid supporting EJB 1.1 until the new specification is finalized. Those that do support EJB 1.1 are in beta or were just released. This make EJB 1.0 servers attractive, esp...more
When was EJB 1.0 defined?
EJB 1.0 was released as a final specification in March 1997 at JavaOne '97 in San Francisco.
When was EJB 1.1 defined?
EJB 1.1 is currently in Public Release 2, a non-final preliminary draft. Final release of the specification is expect by the end of the 4th quarter.