weaver      2003/08/13 14:48:51

  Modified:    applications/demo/src/java/org/apache/jetspeed/demo/preferences
                        PreferencePortlet.java
  Log:
  More changes for test purposes
  
  
  Revision  Changes    Path
  1.4       +18 -6     
jakarta-jetspeed-2/applications/demo/src/java/org/apache/jetspeed/demo/preferences/PreferencePortlet.java
  
  Index: PreferencePortlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/applications/demo/src/java/org/apache/jetspeed/demo/preferences/PreferencePortlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PreferencePortlet.java    12 Aug 2003 05:15:24 -0000      1.3
  +++ PreferencePortlet.java    13 Aug 2003 21:48:51 -0000      1.4
  @@ -82,16 +82,17 @@
        */
       protected void doView(RenderRequest request, RenderResponse response) throws 
PortletException, IOException
       {
  -        String attribute = (String)request.getAttribute("invokeMessage");
  +        String attribute = (String) request.getAttribute("invokeMessage");
           if (attribute != null)
           {
               System.out.println("+++ Got the attribute: " + attribute);
  -            response.setContentType("text/html");            
  +            response.setContentType("text/html");
               response.getWriter().println("Got attribute set in ACTION: " + 
attribute + "<br/>");
           }
  +        request.setAttribute("viewMessage", "My Mode is view.");
           PortletContext context = getPortletContext();
           PortletRequestDispatcher rd = 
context.getRequestDispatcher("/WEB-INF/demo/preference/pref-view.jsp");
  -        rd.include(request, response);     
  +        rd.include(request, response);
       }
   
       /**
  @@ -108,8 +109,19 @@
        */
       public void processAction(ActionRequest request, ActionResponse response) 
throws PortletException, IOException
       {
  -       request.setAttribute("invokeMessage", "I was invoked!!!");
  -       System.out.println("I was invoked!!!");
  +        Integer iCount = (Integer) 
request.getAttribute("org.apache.jetspeed.invocationCount");
  +        if (iCount == null)
  +        {
  +            iCount = new Integer(0);
  +        }
  +
  +        int count = iCount.intValue();
  +        count++;
  +
  +        request.setAttribute("org.apache.jetspeed.invocationCount", new 
Integer(count));
  +
  +        request.setAttribute("invokeMessage", "I was invoked " + count + " times!");
  +        System.out.println("--------------------------- I was 
invoked!!!---------------------------------");
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to