javax.portlet.PortletSession Java Examples

The following examples show how to use javax.portlet.PortletSession. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PortletRequestAttributes.java    From spring4-understanding with Apache License 2.0 7 votes vote down vote up
@Override
public void setAttribute(String name, Object value, int scope) {
	if (scope == SCOPE_REQUEST) {
		if (!isRequestActive()) {
			throw new IllegalStateException(
					"Cannot set request attribute - request is not active anymore!");
		}
		this.request.setAttribute(name, value);
	}
	else {
		PortletSession session = getSession(true);
		if (scope == SCOPE_GLOBAL_SESSION) {
			session.setAttribute(name, value, PortletSession.APPLICATION_SCOPE);
			this.globalSessionAttributesToUpdate.remove(name);
		}
		else {
			session.setAttribute(name, value);
			this.sessionAttributesToUpdate.remove(name);
		}
	}
}
 
Example #2
Source File: PortletRequestContextImpl.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the portlet session.
 * <p>
 * Note that since portlet request instance is created everytime the portlet
 * container receives an incoming request, the portlet session instance held
 * by the request instance is also re-created for each incoming request.
 * </p>
 */
@Override
public PortletSession getPortletSession(boolean create) {
   if (isDebug) {
      LOG.debug("Retrieving portlet session (create=" + create + ")");
   }

   if ((cachedPortletSession == null) || cachedPortletSession.isInvalidated()) {

      //
      // It is critical that we don't retrieve the portlet session until the
      // cross context dispatch has been completed. If we do then we risk
      // having a cached version which is invalid for the context within
      // which it exists.
      //
   
      if (portletConfig == null) {
         throw new IllegalStateException(EXCEPTIONS.getString("error.session.illegalState"));
      }
   
      //
      // We must make sure that if the session has been invalidated (perhaps
      // through setMaxIntervalTimeout()) and the underlying request
      // returns null that we no longer use the cached version.
      // We have to check (ourselves) if the session has exceeded its max
      // inactive interval. If so, we should invalidate the underlying
      // HttpSession and recreate a new one (if the create flag is set to
      // true) -- We just cannot depend on the implementation of
      // javax.servlet.http.HttpSession!
      //
   
      HttpSession httpSession = getServletRequest().getSession(create);
      if (httpSession != null) {
         // HttpSession is not null does NOT mean that it is valid.
         int maxInactiveInterval = httpSession.getMaxInactiveInterval();
         long lastAccesstime = httpSession.getLastAccessedTime();// lastAccesstime checks added for PLUTO-436
         if (maxInactiveInterval >= 0 && lastAccesstime > 0) { // < 0 => Never expires.
            long maxInactiveTime = httpSession.getMaxInactiveInterval() * 1000L;
            long currentInactiveTime = System.currentTimeMillis() - lastAccesstime;
            if (currentInactiveTime > maxInactiveTime) {
               if (isDebug) {
                  LOG.debug("The underlying HttpSession is expired and " + "should be invalidated.");
               }
               httpSession.invalidate();
               httpSession = getServletRequest().getSession(create);
               // Added for PLUTO-436
               // a cached portletSession is no longer useable.
               // a new one will be created below.
            }
         }
      }
   
      if (httpSession == null) {
         if (isDebug) {
            LOG.debug("The underlying HttpSession is not available: " + "no session will be returned.");
         }
         return null;
      }
   
      //
      // If we reach here, we are sure that the underlying HttpSession is
      // available. If we haven't created and cached a portlet session
      // instance, we will create and cache one now.
      //
   
      final ContainerServices containerServices = container.getContainerServices();
      final PortletEnvironmentService portletEnvironmentService = containerServices.getPortletEnvironmentService();

      cachedPortletSession = new CachedPortletSessionImpl(portletEnvironmentService.createPortletSession(
          portletConfig.getPortletContext(), getPortletWindow(), httpSession));

      if (CachedPortletSessionUtil.INVALIDATED_SESSIONS.containsKey(httpSession.getId())) {

         synchronized (httpSession) {
            Enumeration<String> attributeNames = httpSession.getAttributeNames();
            if (attributeNames.hasMoreElements()) {
               while (attributeNames.hasMoreElements()) {
                  String attributeName = attributeNames.nextElement();
                  httpSession.removeAttribute(attributeName);
               }
               CachedPortletSessionUtil.INVALIDATED_SESSIONS.remove(httpSession.getId());
            }
         }
      }
   }

   return cachedPortletSession;
}
 
Example #3
Source File: MockPortletSession.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
public void setAttribute(String name, Object value, int scope) {
	if (scope == PortletSession.PORTLET_SCOPE) {
		if (value != null) {
			this.portletAttributes.put(name, value);
		}
		else {
			this.portletAttributes.remove(name);
		}
	}
	else if (scope == PortletSession.APPLICATION_SCOPE) {
		if (value != null) {
			this.applicationAttributes.put(name, value);
		}
		else {
			this.applicationAttributes.remove(name);
		}
	}
}
 
Example #4
Source File: PortletRequestAttributes.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
public void removeAttribute(String name, int scope) {
	if (scope == SCOPE_REQUEST) {
		if (isRequestActive()) {
			this.request.removeAttribute(name);
			removeRequestDestructionCallback(name);
		}
	}
	else {
		PortletSession session = getSession(false);
		if (session != null) {
			if (scope == SCOPE_GLOBAL_SESSION) {
				session.removeAttribute(name, PortletSession.APPLICATION_SCOPE);
				this.globalSessionAttributesToUpdate.remove(name);
			}
			else {
				session.removeAttribute(name);
				this.sessionAttributesToUpdate.remove(name);
			}
		}
	}
}
 
Example #5
Source File: PortletApplicationContextUtils.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * Register web-specific scopes ("request", "session", "globalSession")
 * with the given BeanFactory, as used by the Portlet ApplicationContext.
 * @param bf the BeanFactory to configure
 * @param pc the PortletContext that we're running within
 */
static void registerPortletApplicationScopes(ConfigurableListableBeanFactory bf, PortletContext pc) {
	bf.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
	bf.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
	bf.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));
	if (pc != null) {
		PortletContextScope appScope = new PortletContextScope(pc);
		bf.registerScope(WebApplicationContext.SCOPE_APPLICATION, appScope);
		// Register as PortletContext attribute, for ContextCleanupListener to detect it.
		pc.setAttribute(PortletContextScope.class.getName(), appScope);
	}

	bf.registerResolvableDependency(PortletRequest.class, new RequestObjectFactory());
	bf.registerResolvableDependency(PortletResponse.class, new ResponseObjectFactory());
	bf.registerResolvableDependency(PortletSession.class, new SessionObjectFactory());
	bf.registerResolvableDependency(WebRequest.class, new WebRequestObjectFactory());
}
 
Example #6
Source File: PortletRequestAttributes.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
public String[] getAttributeNames(int scope) {
	if (scope == SCOPE_REQUEST) {
		if (!isRequestActive()) {
			throw new IllegalStateException(
					"Cannot ask for request attributes - request is not active anymore!");
		}
		return StringUtils.toStringArray(this.request.getAttributeNames());
	}
	else {
		PortletSession session = getSession(false);
		if (session != null) {
			if (scope == SCOPE_GLOBAL_SESSION) {
				return StringUtils.toStringArray(session.getAttributeNames(PortletSession.APPLICATION_SCOPE));
			}
			else {
				return StringUtils.toStringArray(session.getAttributeNames());
			}
		}
		else {
			return new String[0];
		}
	}
}
 
Example #7
Source File: AppScopedSessionAttributeTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
protected TestResult checkRemoveAppScopedAttribute(PortletSession session) {
    TestResult result = new TestResult();
    result.setDescription("Remove an application scoped session attribute "
    		+ "and ensure it's null.");
    result.setSpecPLT("15.3");

    session.setAttribute(KEY, VALUE, PortletSession.APPLICATION_SCOPE);
    session.removeAttribute(KEY, PortletSession.APPLICATION_SCOPE);
    Object value = session.getAttribute(KEY, PortletSession.APPLICATION_SCOPE);
    if (value == null) {
    	result.setReturnCode(TestResult.PASSED);
    } else {
    	TestUtils.failOnAssertion("session attribute", value, null, result);
    }
    return result;
}
 
Example #8
Source File: PortletHelper.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public static void setErrorMessage(PortletRequest request, String errorMsg, Throwable t)
{
	if ( errorMsg == null ) errorMsg = "null";
	PortletSession pSession = request.getPortletSession(true);
	pSession.setAttribute("error.message",errorMsg);

	OutputStream oStream = new ByteArrayOutputStream();
	PrintStream pStream = new PrintStream(oStream);

	log.error("{}", oStream);
	log.error("{}", pStream);

	// errorMsg = errorMsg .replaceAll("<","&lt;").replaceAll(">","&gt;");

	StringBuffer errorOut = new StringBuffer();
	errorOut.append("<p class=\"portlet-msg-error\">\n");
	errorOut.append(ComponentManager.get(FormattedText.class).escapeHtmlFormattedText(errorMsg));
	errorOut.append("\n</p>\n<!-- Traceback for this error\n");
	errorOut.append(oStream.toString());
	errorOut.append("\n-->\n");

	pSession.setAttribute("error.output",errorOut.toString());

	Map map = request.getParameterMap();
	pSession.setAttribute("error.map",map);
}
 
Example #9
Source File: ExternalAppScopedAttributeTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
protected TestResult checkSetAppScopedAttributeElsewhereSeenHere(
		PortletSession session) {
    TestResult result = new TestResult();
    result.setDescription("Ensure application scoped attributes set "
    		+ "elsewhere in portlet session can be seen here.");

    Object value = session.getAttribute(EXT_KEY,
                                        PortletSession.APPLICATION_SCOPE);
    if (VALUE.equals(value)) {
    	result.setReturnCode(TestResult.PASSED);
    } else {
    	result.setReturnCode(TestResult.WARNING);
    	result.setResultMessage("This test will not pass until you have "
    			+ "opened the external resource using the link provided below.");
    }
    return result;
}
 
Example #10
Source File: PortletSessionImpl.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
public Enumeration<String> getAttributeNames(int scope) {
	// Return all attribute names in the nested HttpSession object.
    if (scope == PortletSession.APPLICATION_SCOPE) {
        return httpSession.getAttributeNames();
    }
    // Return attribute names with the portlet-scoped prefix.
    Vector<String> portletScopedNames = new Vector<String>();
    for (Enumeration<String> en = httpSession.getAttributeNames();
    en.hasMoreElements(); ) {
    	String name = en.nextElement();
    	if (isInCurrentPortletScope(name)) {
    		portletScopedNames.add(
    				PortletSessionUtil.decodeAttributeName(name));
    	}
    }
    return portletScopedNames.elements();
    
}
 
Example #11
Source File: MockPortletSession.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
public void setAttribute(String name, Object value, int scope) {
	if (scope == PortletSession.PORTLET_SCOPE) {
		if (value != null) {
			this.portletAttributes.put(name, value);
		}
		else {
			this.portletAttributes.remove(name);
		}
	}
	else if (scope == PortletSession.APPLICATION_SCOPE) {
		if (value != null) {
			this.applicationAttributes.put(name, value);
		}
		else {
			this.applicationAttributes.remove(name);
		}
	}
}
 
Example #12
Source File: ContextInitParameterTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
/**
 * FIXME: should this test reside in this class?  -- ZHENG Zhong
 */
protected TestResult checkGetContextFromSession(PortletSession session) {
    TestResult result = new TestResult();
    result.setDescription("Ensure that the PortletContext can be retrieved "
    		+ "from the portlet session.");

    PortletContext context = session.getPortletContext();
    if (context != null) {
    	result.setReturnCode(TestResult.PASSED);
    } else {
    	result.setReturnCode(TestResult.FAILED);
    	result.setResultMessage("Fail to retrieve PortletContext from "
    			+ "PortletSession: null returned.");
    }
    return result;
}
 
Example #13
Source File: IMSBLTIPortlet.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public void processActionReset(String action,ActionRequest request, ActionResponse response)
throws PortletException, IOException {

	// TODO: Check Role
	log.debug("Removing preferences....");
	clearSession(request);
	PortletSession pSession = request.getPortletSession(true);
	PortletPreferences prefs = request.getPreferences();
	try {
		prefs.reset("sakai.descriptor");
		for (String element : fieldList) {
			prefs.reset("imsti."+element);
			prefs.reset("sakai:imsti."+element);
		}
		log.debug("Preference removed");
	} catch (ReadOnlyException e) {
		setErrorMessage(request, rb.getString("error.modify.prefs")) ;
		return;
	}
	prefs.store();

	// Go back to the main edit page
	pSession.setAttribute("sakai.view", "edit");
}
 
Example #14
Source File: PortletHelper.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public static void debugPrint(PortletRequest request, String line)
{
	if ( line == null ) return;
	line = line.replaceAll("<","&lt;").replaceAll(">","&gt;");

	PortletSession pSession = request.getPortletSession(true);
	String debugOut = null;
	try {
		debugOut = (String) pSession.getAttribute("debug.print");
	} catch (Throwable t) {
		debugOut = null;
	}
	if ( debugOut == null ) {
		debugOut = line;
	} else {
		debugOut = debugOut + "\n" + line;
	}
	pSession.setAttribute("debug.print",debugOut);
}
 
Example #15
Source File: AbstractController.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
public void handleActionRequest(ActionRequest request, ActionResponse response) throws Exception {
	// Delegate to PortletContentGenerator for checking and preparing.
	check(request, response);

	// Execute in synchronized block if required.
	if (this.synchronizeOnSession) {
		PortletSession session = request.getPortletSession(false);
		if (session != null) {
			Object mutex = PortletUtils.getSessionMutex(session);
			synchronized (mutex) {
				handleActionRequestInternal(request, response);
				return;
			}
		}
	}

	handleActionRequestInternal(request, response);
}
 
Example #16
Source File: DispatcherTests3S_SPEC2_19_ForwardJSPAction.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   PrintWriter writer = portletResp.getWriter();

   PortletSession ps = portletReq.getPortletSession();
   String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + V2DISPATCHERTESTS3S_SPEC2_19_FORWARDJSPACTION_DISPATCH4,
         APPLICATION_SCOPE);
   if (msg != null) {
      writer.write("<p>" + msg + "</p><br/>\n");
      ps.removeAttribute(RESULT_ATTR_PREFIX + V2DISPATCHERTESTS3S_SPEC2_19_FORWARDJSPACTION_DISPATCH4, APPLICATION_SCOPE);
   }

   /* TestCase: V2DispatcherTests3S_SPEC2_19_ForwardJSPAction_dispatch4 */
   /* Details: "The parameters associated with a request dispatcher are */
   /* scoped only for the duration of the include or forward call" */
   {
      PortletURL aurl = portletResp.createActionURL();
      aurl.setParameters(portletReq.getPrivateParameterMap());
      TestButton tb = new TestButton(V2DISPATCHERTESTS3S_SPEC2_19_FORWARDJSPACTION_DISPATCH4, aurl);
      tb.writeTo(writer);
   }

}
 
Example #17
Source File: PortletHelper.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static String getErrorOutput(PortletRequest request)
{   
	PortletSession pSession = request.getPortletSession(true);
	try {
		return (String) pSession.getAttribute("error.output");
	} catch (Throwable t) {
		return null;
	}
}
 
Example #18
Source File: RequestTests_ActionRequest_ApiAction.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
      throws PortletException, IOException {
   LOGGER.trace("main portlet render entry");

   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   PrintWriter writer = portletResp.getWriter();

   PortletSession ps = portletReq.getPortletSession();
   String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + "RequestTests_ActionRequest_ApiAction", APPLICATION_SCOPE);
   if (msg != null) {
      writer.write("<p>" + msg + "</p><br/>\n");
      ps.removeAttribute(RESULT_ATTR_PREFIX + "RequestTests_ActionRequest_ApiAction", APPLICATION_SCOPE);
   }

   /* TestCase: V2RequestTests_ActionRequest_ApiAction_fieldACTION_NAME    */
   /* Details: "Has String field ACTION_NAME with value of                 */
   /* \"javax.portlet.action\" "                                           */
   {
      PortletURL aurl = portletResp.createActionURL();
      aurl.setParameters(portletReq.getPrivateParameterMap());
      TestButton tb = new TestButton(V2REQUESTTESTS_ACTIONREQUEST_APIACTION_FIELDACTION_NAME, aurl);
      tb.writeTo(writer);
   }

}
 
Example #19
Source File: EventRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public PortletSession getPortletSession(boolean create) {
   String meth = "getPortletSession";
   Object[] args = { create };
   PortletSession ret = sess;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example #20
Source File: AppScopedSessionAttributeTest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
protected TestResult checkGetEmptyAppScopedAttribute(PortletSession session) {
    TestResult result = new TestResult();
    result.setDescription("Retrieve an attribute that has not been set "
    		+ "in the session's application scope "
    		+ "and ensure it's value is null.");
    result.setSpecPLT("15.3");

    Object value = session.getAttribute(BOGUS_KEY, PortletSession.APPLICATION_SCOPE);
    if (value == null) {
    	result.setReturnCode(TestResult.PASSED);
    } else {
    	TestUtils.failOnAssertion("session attribute", value, null, result);
    }
    return result;
}
 
Example #21
Source File: HelloPortlet.java    From journaldev with MIT License 5 votes vote down vote up
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException{
	// Get all attributes' names that are defined along side of Application Scope
	Enumeration<String> names = request.getPortletSession().getAttributeNames(PortletSession.APPLICATION_SCOPE);
	StringBuffer buffer = new StringBuffer();
	while(names.hasMoreElements()){
		String name = names.nextElement();
		// Get the attribute's value
		buffer.append(name+" :: "+request.getPortletSession().getAttribute(name,PortletSession.APPLICATION_SCOPE)+"\n");
	}
	response.getWriter().print("<form action="+response.createActionURL()+">"
			+ "<p>Portlet Session Attributes</p>"
			+ buffer
			+ "<input type='submit' value='Just Do Action'/>"
			+ "</form>");
}
 
Example #22
Source File: MockPortletSession.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
public void removeAttribute(String name, int scope) {
	if (scope == PortletSession.PORTLET_SCOPE) {
		this.portletAttributes.remove(name);
	}
	else if (scope == PortletSession.APPLICATION_SCOPE) {
		this.applicationAttributes.remove(name);
	}
}
 
Example #23
Source File: PortletIFrame.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {

	// log.info("==== processAction called ====");

	PortletSession pSession = request.getPortletSession(true);

	// Our first challenge is to figure out which action we want to take
	// The view selects the "next action" either as a URL parameter
	// or as a hidden field in the POST data - we check both

	String doCancel = request.getParameter("sakai.cancel");
	String doUpdate = request.getParameter("sakai.update");

	// Our next challenge is to pick which action the previous view
	// has told us to do.  Note that the view may place several actions
	// on the screen and the user may have an option to pick between
	// them.  Make sure we handle the "no action" fall-through.

	pSession.removeAttribute("error.message");

	if ( doCancel != null ) {
		response.setPortletMode(PortletMode.VIEW);
	} else if ( doUpdate != null ) {
		processActionEdit(request, response);
	} else {
		// log.info("Unknown action");
		response.setPortletMode(PortletMode.VIEW);
	}

	// log.info("==== End of ProcessAction  ====");
}
 
Example #24
Source File: FacesRequestAttributes.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
public static Object getAttribute(String name, ExternalContext externalContext) {
	Object session = externalContext.getSession(false);
	if (session instanceof PortletSession) {
		return ((PortletSession) session).getAttribute(name, PortletSession.APPLICATION_SCOPE);
	}
	else if (session != null) {
		return externalContext.getSessionMap().get(name);
	}
	else {
		return null;
	}
}
 
Example #25
Source File: PortletHelper.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static Map getErrorMap(PortletRequest request)
{   
	PortletSession pSession = request.getPortletSession(true);
	try {
		return (Map) pSession.getAttribute("error.map");
	} catch (Throwable t) {
		return null;
	}
}
 
Example #26
Source File: FacesRequestAttributes.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public static Object getAttribute(String name, ExternalContext externalContext) {
	Object session = externalContext.getSession(false);
	if (session instanceof PortletSession) {
		return ((PortletSession) session).getAttribute(name, PortletSession.APPLICATION_SCOPE);
	}
	else if (session != null) {
		return externalContext.getSessionMap().get(name);
	}
	else {
		return null;
	}
}
 
Example #27
Source File: MockPortletSession.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
public void removeAttribute(String name, int scope) {
	if (scope == PortletSession.PORTLET_SCOPE) {
		this.portletAttributes.remove(name);
	}
	else if (scope == PortletSession.APPLICATION_SCOPE) {
		this.applicationAttributes.remove(name);
	}
}
 
Example #28
Source File: PortletHelper.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void clearErrorMessage(PortletRequest request)
{   
	PortletSession pSession = request.getPortletSession(true);
	pSession.removeAttribute("error.message");
	pSession.removeAttribute("error.output");
	pSession.removeAttribute("error.map");
}
 
Example #29
Source File: PortletUtilsTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetSessionAttributeWithExistingSessionDefaultsToPortletScope() throws Exception {
	PortletSession session = mock(PortletSession.class);
	PortletRequest request = mock(PortletRequest.class);
	given(request.getPortletSession(false)).willReturn(session);
	given(session.getAttribute("foo", PortletSession.PORTLET_SCOPE)).willReturn("foo");
	Object sessionAttribute = PortletUtils.getSessionAttribute(request, "foo");
	assertNotNull("Must not return null if session attribute exists (and Session exists)", sessionAttribute);
	assertEquals("foo", sessionAttribute);
}
 
Example #30
Source File: EventRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public PortletSession getPortletSession() {
   String meth = "getPortletSession";
   Object[] args = {};
   PortletSession ret = sess;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}