struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marty Phee <mp...@jump-technologies.com>
Subject [shale] Backing view
Date Wed, 14 Jun 2006 17:20:02 GMT
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


Mime
View raw message