struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig McClanahan" <craig...@apache.org>
Subject Re: [shale] Backing view
Date Wed, 14 Jun 2006 17:57:59 GMT
On 6/14/06, Marty Phee <mphee@jump-technologies.com> wrote:
>
> Newbie,
>
> I'm using Shale with tiger.
>
> JSP, subscribe (example from somewhere) that does a save.  All this
> works fine, but I made a change so that the return should send it to a
> "Success" page.
> <navigation-rule>
>     <from-view-id>/subscribe.jsp</from-view-id>
>     <navigation-case>
>         <from-outcome>success</from-outcome>
>         <to-view-id>/success.jsp</to-view-id>
>     </navigation-case>
>   </navigation-rule>
>
> I kept getting a 500 error:
> 12:11:39,292 ERROR [faces]:253 - Servlet.service() for servlet faces
> threw exception
> java.lang.IllegalStateException: No WebApplicationContext found: no
> ContextLoaderListener registered?
>
> I then created a Success bean
> @Bean(name="success", scope= Scope.SESSION)
> @View
> public class Success
> {
> }
>
> And then everything worked.  Do I always need a View behind my jsp's or
> am I doing something wrong?
>
> @Bean(name="subscrHandler", scope = Scope.REQUEST)
> public class SubscriberHandler {
>     @Value("#{subscribe}")
>     private Subscriber subscriber;
>
>     public void setSubscriber(Subscriber subscriber) {
>         this.subscriber = subscriber;
>     }
>
>     public String saveSubscriber( ) {
>         subscriber.save( );
>         return "success";
>     }
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
It is supposed to always be optional to have a backing bean behind a JSP
view.  Could you please post the entire stack trace for the
IllegalStateException you encountered?

Craig

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message