[ 
https://issues.apache.org/jira/browse/PB-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Woonsan Ko resolved PB-74.
--------------------------

    Resolution: Fixed

GenericVelocityPortlet#setupPreferencesEdit() method is invoked in doEdit() 
phase. I added safer
 method, getContext(RenderRequest, RenderResponse). So, if the context is null, 
then it will initialize
 the context. (The context can be null when GenericVelocityPortlet#render() is 
not called.)

> Safe creation of context in GenericVelocityPortlet for JS2's new feature, 
> auto-dispatching for edit_defaults mode.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: PB-74
>                 URL: https://issues.apache.org/jira/browse/PB-74
>             Project: Portals Bridges
>          Issue Type: Improvement
>          Components: velocity
>    Affects Versions: 1.0.3
>         Environment: Probably on Jetspeed-2.1.3 or later. (Jetspeed-2.1.3 
> will probably be released soon.)
> When the option, auto-dispatching for edit_defaults mode is turned on.
>            Reporter: Woonsan Ko
>            Assignee: Woonsan Ko
>            Priority: Minor
>             Fix For: 1.0.4
>
>
> The GenericVelocityPortlet assumes that doEdit() method would be invoked 
> after render() method.
> And, it creates a context in overriden render() method for later use.
> However, if JS2's auto-dispatching for edit_defaults mode option is turned 
> on, JS2 would try to invoke doEdit() method directly without invoking 
> render() method.
> Meanwhile, if a GenericVelocityPortlet is not invoked via render() method, it 
> will throw an NPE because the context is null.
> So, the context object should be treated safer in doEdit() phase. That is, if 
> the context is null in doEdit() phase, it should initialize there for more 
> safety.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to