Results 1 to 2 of 2

Thread: Multiaction with result

  1. #1
    Join Date
    Mar 2010
    Location
    Germany
    Posts
    5

    Default Multiaction with result

    Hello everyone!

    I am using Spring 3.0.1 & Spring webflow 2.0.8. I have the following workflow:

    ###################################
    ...
    <view-state id="catalogue" view="catalogue/catalogue" model="flowScope.searchtable">
    ...
    <transition on="searchTable" to="search" />
    ...
    </view-state>

    <action-state id="search">
    <evaluate expression="catalogueserviceaction.search" result="flowScope.maintable" />
    <transition on="success" to="catalogue" />
    <transition on="error" to="catalogue" />
    </action-state>
    ...
    ###################################

    This is my Multiaction:

    ###################################
    ...
    @Resource
    private CatalogueService catalogueService;

    public Event search(RequestContext context) {
    try {
    String tabelle = (String) context.getCurrentEvent().getAttributes()
    .get("tabelle");
    Table table = catalogueService.getMainTable(tabelle);

    return success(table);
    } catch (EmptyResultDataAccessException e) {
    String errormessage = "Diese Tabellendefinition exisitert nicht";
    context.getMessageContext().addMessage(
    new MessageBuilder().error().defaultText(errormessage)
    .build());

    return error(e);
    } catch (DataAccessException e) {
    return error(e);
    }

    }
    ...
    ###################################

    I get my Object with Data (i still debugged it) and put it into the success method. My problem is that don't see the result flowScope.maintable.

    Any idea?

    Many thanks....


    ~Chris

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    Use [ code][/code ] tags when posting.

    The result is your event, what would you expect. The result, the value returned from the method is stored. Where do you don't see it, in your pages there is no scope simply use maintable not flowScope.maintable (unless you use JSF).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •