You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by st...@apache.org on 2004/02/11 21:13:45 UTC

cvs commit: jakarta-pluto/container/src/java/org/apache/pluto/core/impl PortletPreferencesImpl.java

sthepper    2004/02/11 12:13:45

  Modified:    container/src/java/org/apache/pluto/core/impl
                        PortletPreferencesImpl.java
  Log:
  fixed exception text of store to "only allowed in processAction"
  
  Revision  Changes    Path
  1.2       +2 -2      jakarta-pluto/container/src/java/org/apache/pluto/core/impl/PortletPreferencesImpl.java
  
  Index: PortletPreferencesImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-pluto/container/src/java/org/apache/pluto/core/impl/PortletPreferencesImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletPreferencesImpl.java	7 Jan 2004 20:37:17 -0000	1.1
  +++ PortletPreferencesImpl.java	11 Feb 2004 20:13:45 -0000	1.2
  @@ -319,10 +319,10 @@
   
       public void store() throws java.io.IOException,ValidatorException
       {
  -        // not allowed when called in render
  +        // not allowed when called in action
           if (this.methodId.equals(org.apache.pluto.Constants.METHOD_RENDER))
           {
  -            throw new java.lang.IllegalStateException("store is only allowed inside a render call");
  +            throw new java.lang.IllegalStateException("store is only allowed inside a processAction call");
           }
   
           // validate preferences
  
  
  

Re: cvs commit: jakarta-pluto/container/src/java/org/apache/pluto/core/impl PortletPreferencesImpl.java

Posted by Stefan Hepper <st...@hursley.ibm.com>.

Michael Westbay wrote:

> sthepper@apache.org wrote:
> 
>>   Index: PortletPreferencesImpl.java
>>   ===================================================================
>>   RCS file: 
>> /home/cvs/jakarta-pluto/container/src/java/org/apache/pluto/core/impl/PortletPreferencesImpl.java,v 
>>
>>   retrieving revision 1.1
>>   retrieving revision 1.2
>>   diff -u -r1.1 -r1.2
>>   --- PortletPreferencesImpl.java    7 Jan 2004 20:37:17 -0000    1.1
>>   +++ PortletPreferencesImpl.java    11 Feb 2004 20:13:45 -0000    1.2
>>   @@ -319,10 +319,10 @@
>>           public void store() throws 
>> java.io.IOException,ValidatorException
>>        {
>>   -        // not allowed when called in render
>>   +        // not allowed when called in action
>>            if 
>> (this.methodId.equals(org.apache.pluto.Constants.METHOD_RENDER))
>>            {
>>   -            throw new java.lang.IllegalStateException("store is 
>> only allowed inside a render call");
>>   +            throw new java.lang.IllegalStateException("store is 
>> only allowed inside a processAction call");
>>            }
>>               // validate preferences
> 
> 
> I appears that the comment was correct - "not allowed when called from 
> render."  Just the exception message needed to be changed.
> 

Thanks, you're right, I change that.

> I'd also like to confirm that the check is the correct way; i.e. not 
> allowed for METHOD_RENDER, or should be be *only allowed* for 
> METHOD_ACTION?  What happens with METHOD_ID or METHOD_NOOP?  Or are they 
> prevented from reaching this point in some manner?
> 

right, the spec says:
"The store method can only be invoked within the scope of a 
processAction call."
so the check should be on METHOD_ACTION. However, the current 
implementation does no harm as this path is only accessed for 
processAction and render. I'll change that too.


Stefan


Re: cvs commit: jakarta-pluto/container/src/java/org/apache/pluto/core/impl PortletPreferencesImpl.java

Posted by Michael Westbay <we...@users.sourceforge.net>.
sthepper@apache.org wrote:

>   Index: PortletPreferencesImpl.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-pluto/container/src/java/org/apache/pluto/core/impl/PortletPreferencesImpl.java,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- PortletPreferencesImpl.java	7 Jan 2004 20:37:17 -0000	1.1
>   +++ PortletPreferencesImpl.java	11 Feb 2004 20:13:45 -0000	1.2
>   @@ -319,10 +319,10 @@
>    
>        public void store() throws java.io.IOException,ValidatorException
>        {
>   -        // not allowed when called in render
>   +        // not allowed when called in action
>            if (this.methodId.equals(org.apache.pluto.Constants.METHOD_RENDER))
>            {
>   -            throw new java.lang.IllegalStateException("store is only allowed inside a render call");
>   +            throw new java.lang.IllegalStateException("store is only allowed inside a processAction call");
>            }
>    
>            // validate preferences

I appears that the comment was correct - "not allowed when called from 
render."  Just the exception message needed to be changed.

I'd also like to confirm that the check is the correct way; i.e. not 
allowed for METHOD_RENDER, or should be be *only allowed* for 
METHOD_ACTION?  What happens with METHOD_ID or METHOD_NOOP?  Or are they 
prevented from reaching this point in some manner?

-- 
Michael Westbay