Fix Annoying Validation Errors When Using RenderRequest in a JSP

When you use renderRequest, renderResponse, and portletConfig objects in a JSP, your Rational or Eclipse-based IDE will usually give a validation error – "renderRequest cannot be resolved," for example. Having red-x validation errors in your IDE is annoying as all-hell, so here’s a nice work-around for that…

<%@ page import="javax.portlet.RenderRequest" %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%> <%! RenderRequest renderRequest; %> <portlet:defineObjects /> <%-- String portletSiteArea = renderRequest.getPreferences().getValue("sitearea", ""); // code... --%>

Happy coding! (Unless you’re on a death-march – to which I can only say: hang in there, buddy.)