JSP Section Index | Page 47
How do I communicate with a JSP page from an applet?
This is basically the same as talking to any web page.
Check out:
http://www.jguru.com/jguru/faq/view.jsp?EID=157
and
http://www.jguru.com/jguru/faq/view.jsp?EID=14163more
What's the difference between the JSDK and the JSWDK? And what's the current version?
The kit for developing servlets, containing the Servlet API classes
and tools, used to be called the Java Servlet Development Kit
(JSDK). Then Sun renamed the Java Development Kit (JDK) to the Ja...more
How can I get to print the stacktrace for an exception occuring within my JSP page?
By printing out the exception's stack trace, you can usually diagonse a problem better when debugging JSP pages. By looking at a stack trace, a programmer should be able to discern which method th...more
Can I invoke a JSP error page from a servlet?
Yes, you can invoke the JSP error page and
pass the exception object to it from within
a servlet. The trick is to create a request
dispatcher for the JSP error page, and pass
the exception obje...more
How can I send email from a JSP page?
The JavaMAIL API is the standard mechanism for sending email. See the JavaMail FAQ for how to use it. You can place j2ee.jar (or mail.jar and activation.jar) under web-inf/lib folder in tomcat3.2....more
Can you make use of a ServletOutputStream object from within a JSP page?
No. You are supposed to make use of only
a JSPWriter object (given to you in
the form of the implicit object out)
for replying to clients. A JSPWriter can
be viewed as a buffered version of the st...more
How do I use a scriptlet to initialize a newly instantiated bean?
How do I use a scriptlet to initialize a
newly instantiated bean?
How can I enable session tracking for JSP pages if the browser has disabled cookies?
We know that session tracking uses cookies by default to associate a session identifier
with a unique user. If the browser does not support cookies, or if cookies are disabled,
you can still ena...more
What's a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or Synchronization?
Although the SingleThreadModel technique is easy to use,
and works well for low volume sites, it does not
scale well. If you anticipate your users to increase
in the future, you may be better...more
How can I declare methods within my JSP page?
You can declare methods for use within your JSP page as declarations. The methods can
then be invoked within any other methods you declare, or within JSP scriptlets and
expressions.
Do note tha...more
Can I stop JSP execution while in the midst of processing a request?
Yes. Preemptive termination of request processing on an error condition is a good way to
maximize the throughput of a high-volume JSP engine. The trick (asuming Java is
your scripting language) ...more
How can I delete a cookie from within a JSP page?
A cookie, mycookie, can be deleted using the following scriptlet:
<%
Cookie killMyCookie = new Cookie("mycookie", null);
killMyCookie.setMaxAge(0);
killMyCookie.setPath("/");
...more
How can I get to view any compilation/parsing errors at the client while developing JSP pages?
With JSWDK 1.0, set the following servlet initialization property within
the WEB-INFservlets.properties file for your application:
jsp.initparams=sendErrToClient=true
This will cause any comp...more
How do I set a cookie within a JSP page?
Setting cookies from within a JSP page is similar to the way they are done within servlets. For
example, the following scriptlet sets a cookie "mycookie" at the client:
<%
Cookie myco...more
Is there a way I can set the inactivity lease period on a per-session basis?
Typically, a default inactivity lease period for all sessions is set
within your JSP engine admin screen or associated properties file.
However, if your JSP engine supports the Servlet 2.1 API, yo...more