"littleprince" wrote : Can you give me more detail on "Portlet 2.0 resource
serving"? Some sample codes might be very helpful.
it is pretty much like a servlet.
your portlet needs to implements the ResourceServing interface with the method
| public void serverResource(ResourceRequest req, ResourceResponse resp) throws ... {
|
| resp.setContentType("application/pdf");
| OutputStream out = resp.getPortletOutputStream();
| ....
| out.close();
|
| }
|
in order to create an URL to the resource you need to use during render:
| ResourceURL url = resp.createResourceURL();
|
| |
| | The nice thing is that during resource serving you have access to the portlet
request (since ResourceRequest extends PortletRequest) so you can read preferences of user
and even the render parameters.
| |
| | We have an example of resource serving here but it is for markup, not PDF:
| |
| |
http://anonsvn.jboss.org/repos/portal/modules/portlet/trunk/samples/src/m...
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134489#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...