0
votes

I want to create a JSR 286 Portlet named VisitCounter to install on websphere Portal 8.0. VisitCounter counts the number of user online.

public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
        // Set the MIME type for the render response
        response.setContentType(request.getResponseContentType());

        // Check if portlet session exists
        VisitCounterPortletSessionBean sessionBean = getSessionBean(request);
        if( sessionBean==null ) {
            //response.getWriter().println("<b>NO PORTLET SESSION YET</b>");
            return;
        }
        ........
}

How to make this? Thanks!

1

1 Answers

0
votes

public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { // Set the MIME type for the render response response.setContentType(request.getResponseContentType());

    // Check if portlet session exists
    VisitCounterPortletSessionBean sessionBean = getSessionBean(request);
    if( sessionBean==null ) {
        //response.getWriter().println("<b>NO PORTLET SESSION YET</b>");
        return;
    }
    ........

}

Using application scope...