1 5 6 package org.exoplatform.services.portletcontainer.test.portlet; 7 8 import javax.portlet.*; 9 import java.io.IOException ; 10 11 17 18 public class Portlet2TestStateUser extends GenericPortlet{ 19 20 public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) 21 throws PortletException, IOException { 22 PortletSession session = actionRequest.getPortletSession(); 23 PortletPreferences prefs = actionRequest.getPreferences(); 24 if(session.getAttribute("counter") == null){ 25 session.setAttribute("counter", "1"); 26 } else { 27 prefs.setValue("attName2", "attValue2"); 28 } 29 prefs.store(); 30 } 31 32 protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) 33 throws PortletException, IOException { 34 } 35 36 } | Popular Tags |