Datasheet

populated. Likewise, HttpServletResponse has restrictions on what is accessible. The unavailable
methods of
HttpServletResponse are:
encodeRedirectURL
encodeRedirectUrl
setContentType
setContentLength
setLocale
sendRedirect
sendError
addCookie
setDateHeader
addDateHeader
setHeader
addHeader
setIntHeader
addIntHeader
setStatus
containsHeader
The encode methods always return null, and containsHeader always returns false, but the remainder
will simply do nothing. This could be a source of great frustration if you are not careful as a developer,
because it simply will not work and will provide no notice.
The Java Portlet Specification recommends against using the forward method of the
RequestDispatcher
of an included servlet or JSP. While this doesn’t seem like a big deal, note that Apache’s Struts Framework
uses the
RequestDispatcher forward method in its ActionServlet. Given the popularity of Struts
as a Web application framework, this could make a significant impact on portal integration in many enter-
prises. This is not to say that it may not work anyway, but it is non-deterministic and should be carefully
examined in your circumstance and tested with your portal implementation.
Portlet Application Structure
Portlet applications are structured just like Web applications in that they have the following features:
Can contain servlets, JSPs, Java classes, Java archives (JAR files) and other static files
Are self-contained; all things in the Web application are packaged together in a common root
Have a WEB-INF/classes directory to store standalone classes to be loaded by the application
classloader
Have a WEB-INF/lib directory to store Java Archives (JAR files) to be loaded by the application
classloader
21
The Java Portlet API (JSR 168)
04 469513 Ch01.qxd 1/16/04 11:04 AM Page 21