JSP Section Index | Page 47
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
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
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
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
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
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?
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
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
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
A cookie, mycookie, can be deleted using the following scriptlet: <% Cookie killMyCookie = new Cookie("mycookie", null); killMyCookie.setMaxAge(0); killMyCookie.setPath("/"); ...more
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
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
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