Always Utilize the URL Rewriting APIs for Content in Your Portlet
Do Not Append Paths to a Rewritten URL
Qualify Client-side Script Variables and Methods with Namespaces
Ensure Inline Client-side Scripts that Refer to Portlet Resources Follow the Spec
Always Declare a Content Type for Portlet Responses
Do Not Send Cookies from Portlets
Separate Business Logic from PresentationOn the first point Drew offers advice on a commonly used pattern.
Java developers often write the URL to an image from a JSP like this:
According to the JSR-168 portlet specification, calling addCookie() on HttpServletResponse does not actually set a cookie. Portlet containers that allow you to set a cookie are broken. Do not call this method.This example packed entry offers many tips on how you can ensure that you’re portlets meet the spec.
没有评论:
发表评论