struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marty Phee <mp...@jump-technologies.com>
Subject Re: [shale] Problems with View controller
Date Tue, 20 Jun 2006 13:12:30 GMT
The class that's trying to do the cast is
org.apache.shale.component.SubView

I'll keep my beans in the Request scope.  Newbie alert...  ;-)


Craig McClanahan wrote:
> On 6/19/06, Marty Phee <mphee@jump-technologies.com> wrote:
>>
>> Ok, I've got most everything working.  Combination of things mostly me
>> not know how to configure everything.
>>
>> There is a problem though if you use tiger and subview.  Only init()
>> will be called if the bean is marked session.  If you mark it request
>> init and destroy will be called.  The problem is in
>> org.apache.shale.component.SubView.  Not really a problem per-say, but
>> tiger needs to implement something for subviews.
>
>
> Hmm ... I'll bet it's not just subviews ... I'll bet any 
> ViewController you
> put in session scope  will have the same problem.  Personally, I consider
> putting view controllers in session scope to be a pretty bad idea, and 
> would
> lean towards making this a restriction.   (Putting non-view-controller
> backing beans in session scope to save state across sessions is fine.)
>
> It ends up failling here after I set the id to a valid managed (by
>> tiger) bean that has the @View anotation.  Since it's trying to cast it
>> to a ViewController it fails.
>
>
> What bit of code is trying to cast it?  If you are talking about the
> ViewControllerCallbacks implementation, that gets specifically 
> replaced by a
> Tiger version that uses reflection to call the method marked with an
> annotation instead, when you add shale-tiger.jar to your webapp
>
>  After I added extends
>> AbstractViewController all the events were filed.  Like wise if I didn't
>> use tiger it worked fine.
>
>
> Those caess make sense, because even the Tiger version will recognize 
> beans
> that implement the ViewController interface ... essentially it just 
> pretends
> that the four callback methods were annotated.
>
>    // Construct and initialize a new ViewController, if any is associated
>>         String expr = "#{" + name + "}";
>>         try {
>>             vc = (ViewController) context.getApplication().
>>                  createValueBinding(expr).getValue(context);
>>             if (vc == null) {
>>                 log.debug(messages.getMessage("subview.noBean",
>>                                               new Object[] { getId() 
>> }));
>>                 return null;
>>             }


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message