01: package test;
02:
03: import java.io.IOException;
04: import java.io.PrintWriter;
05:
06: import javax.servlet.ServletException;
07:
08: import javax.portlet.GenericPortlet;
09: import javax.portlet.PortletException;
10: import javax.portlet.RenderRequest;
11: import javax.portlet.ActionResponse;
12: import javax.portlet.RenderResponse;
13: import javax.portlet.PortletContext;
14: import javax.portlet.PortletRequestDispatcher;
15: import javax.portlet.PortletConfig;
16:
17: public class RequestDispatcherGetAttributePortlet extends
18: GenericPortlet {
19:
20: private PortletContext pContext;
21:
22: public void init(PortletConfig config) throws PortletException {
23:
24: super .init(config);
25: pContext = config.getPortletContext();
26: }
27:
28: public void doView(RenderRequest request, RenderResponse response)
29: throws PortletException {
30:
31: response.setContentType(request.getResponseContentType());
32: try {
33: PortletRequestDispatcher dispatcher = pContext
34: .getRequestDispatcher("/WEB-INF/getServletAttributes.jsp");
35: dispatcher.include(request, response);
36: } catch (IOException ie) {
37: throw new PortletException(
38: "RequestDispatcherGetAttributePortlet.doView exception",
39: ie);
40: }
41:
42: }
43: }
|