Results 1 to 5 of 5

Thread: Actions Chaining question

  1. #1
    Join Date
    Oct 2006
    Posts
    11

    Default Actions Chaining question

    Hi all,

    I'm working on a e-commerce application using Spring 1.2.8 framework.
    I need to prevent the user from violating the normal process of application execution. For example, if someone is buying an article the following process should be respected : 1-adding articles to the cart -> 2-validating cart -> 3-payment -> 4-payment confirmation...etc

    The problem is that users may access directly one of this process steps violating the normal process order.

    Is there any solution to solve this problem ?

    thanks,

  2. #2
    Join Date
    Oct 2005
    Posts
    2

    Default

    The AbstractWizardFormController may be what you want

  3. #3
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    314

    Default

    Quote Originally Posted by javaspring View Post
    Hi all,

    I'm working on a e-commerce application using Spring 1.2.8 framework.
    I need to prevent the user from violating the normal process of application execution. For example, if someone is buying an article the following process should be respected : 1-adding articles to the cart -> 2-validating cart -> 3-payment -> 4-payment confirmation...etc

    The problem is that users may access directly one of this process steps violating the normal process order.

    Is there any solution to solve this problem ?

    thanks,
    Maybe a little more information of your implementation is needed. Are those 4 steps implemented as own controllers? I guess so? One solution indeed is the AbstractWizardFormController or maybe you should just check the values in your command object that holds the user's data (selected products etc.). If needed infomation is missing, throw an error and redirect user elsewhere.

    This is just my quick solution, since I don't know any details of your project
    if a trainstation is where the train stops, what's a workstation...

  4. #4
    Join Date
    Oct 2006
    Posts
    11

    Default

    Hi,

    Unfortunatelly, I'm using separate controllers (SimpleFormControllers and Abstractcontroller) in each step. Each controller processes an associated form and redirects to the next form.

    I tried to code an interceptor and an automata that checks wether the normal order of the steps is respected or not, but I'm wondering if there is another elegant solution.

  5. #5
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Depending on your needs there are 2 solutions

    • AbstractWizardFormController
    • Spring Web Flow



    For just a shopping card Spring Web Flow might be a bit over the top. But I would at least strongly suggest you take a look at the AbstractWizardFormController.
    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
  •