On 6/14/06, Marty Phee <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to