package oracle.portal.sample.v2.devguide.helloservletworld;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.portal.provider.v2.http.HttpCommonConstants;
import oracle.portal.provider.v2.render.PortletRenderer;
import oracle.portal.provider.v2.render.PortletRenderRequest;
import oracle.portal.provider.v2.render.PortletRendererUtil;
import oracle.portal.provider.v2.PortletException;



public class ShowServlet extends HttpServlet
{
    public void doPost(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException
    {
        doGet(req, res);
    }

    public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException
    {
        PortletRenderRequest pr;
        pr = (PortletRenderRequest)req.getAttribute
             (HttpCommonConstants.PORTLET_RENDER_REQUEST);

        PrintWriter out = pr.getWriter();

        try {
        
            ServletPersonalization data = (ServletPersonalization) 
                                           PortletRendererUtil.getEditData(pr);

            out.println(data.getString(ServletPersonalization.GREETING));

            }

        catch (PortletException e)
            {
            
            }         
                  
    }
}

