JSP Section Index | Page 49
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 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 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
How do I access a database from my servlet or JSP?
[See also How can I pool my database connections so I don't ...]
Since JDK 1.1, Java comes with a package called JDBC (Java Database
Connectivity). JDBC allows you to write SQL queries as Java St...more
How do I mix JSP and SSI #include?
If you're just including raw HTML, use the #include directive
as usual inside your .jsp file.
<!--#include file="data.inc"-->
But it's a little trickier if you want the server...more
How do I upload a file to my servlet or JSP?
On the client side, the client's browser must support form-based
upload. Most modern browsers do, but there's no guarantee. For
example,
<FORM ENCTYPE='multipart/form-data'
method='POST' ...more