Jesper W 15 Years Ago I don't understand. It looks like something is missing in the code above.How does the <portlet:resourceURL/> tag know what resource response class to link to? Please sign in to reply. Reply as... Cancel Steven Cao Jesper W 15 Years Ago - Edited A good question! Ok, JSR-268 utilizes annotation(feature in JDK 1.5). In this sample, it uses the default serveResource() method. If for the common way, it should be like this:view.jsp<a href="<portlet:resourceURL><portlet:param name="javax.portlet.action" value="testresource" /></portlet:resourceURL>">Click me to request Resource URL</a>TestResourcePortle.java...................................... @Resource(name="testresource") public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortletException, IOException { PortletRequestDispatcher portletRequestDispatcher = portletConfig .getPortletContext().getRequestDispatcher( "/WEB-INF/jsp/Resource.jsp"); portletRequestDispatcher.include(resourceRequest, resourceResponse); }..........................Does this make sense? Thanks! Please sign in to reply. Reply as... Cancel
Steven Cao Jesper W 15 Years Ago - Edited A good question! Ok, JSR-268 utilizes annotation(feature in JDK 1.5). In this sample, it uses the default serveResource() method. If for the common way, it should be like this:view.jsp<a href="<portlet:resourceURL><portlet:param name="javax.portlet.action" value="testresource" /></portlet:resourceURL>">Click me to request Resource URL</a>TestResourcePortle.java...................................... @Resource(name="testresource") public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortletException, IOException { PortletRequestDispatcher portletRequestDispatcher = portletConfig .getPortletContext().getRequestDispatcher( "/WEB-INF/jsp/Resource.jsp"); portletRequestDispatcher.include(resourceRequest, resourceResponse); }..........................Does this make sense? Thanks! Please sign in to reply. Reply as... Cancel