User registration page in ATG using DSPs and Handler.

ATG comes with powerful out of the box components to build e-commerce websites with minimal effort. Today we will create a simple user registration page using DSP tags and ProfileFormHandler Component.

Steps to create a user registration page.

1. Import the DSP tab libraries.

2. Import the ProfileFormHandler Component.

This is an out of the box component of ATG and registered as request scope bean.

3. Import the ErrorMessageForEach droplet.

This droplet helps to display form validation exceptions and errors.

4. Declare a form using DSP form tag.

A form shall be declared inside a tag.

5. Declare all the required form field using DSP input tag.

You would have noticed that the firstName attribute is part of the value map, it gets mapped to the underlying ProfileAdapterRepostory value map. (you can see all the attributes in the userProfile.xml)

6. Create a submit button using the DSP input tag library.

ProfileFormHandler has got method named create. Create method gets invoked when you click the submit button.

7. Register the success URL

User will be redirected to this page upon a successful authentication. You may give a failure URL also.

ErrorMesageForEach Droplet is used to spit out all the form validation messages/exception.
Thats it. Without writing a line of java code we have implemented the user registration page in our commerce site using ATG out of the box components.

Complete Example Code

You can verify if the user is indeed registered successfully using ACC or JDBC Browser from dyn/admin page.

A screen shot of out the box server side validation capability of ATG.
ATG form validation

9 thoughts on “User registration page in ATG using DSPs and Handler.

  1. Vico said:

    Great resume and good example.

  2. Sanju Thomasourownjava said:

    Thanks Vico.

  3. janakirman said:

    very very useful for beginners..good ..please post more commerce concepts

    • Sanju Thomasourownjava said:

      Thanks Janakirman.

  4. DK said:

    Superb Explanation !!!

    Thanks :)

    • Sanju Thomasourownjava said:

      Thanks DK.

  5. Christian Roman said:

    Well explained tutorial!
    Unfortunately when I tried to run it I got some exceptions related (I guess) to a misconfiguration(s) on my web deployment descriptor.
    Could you please publish a link to download the source code of your tutorial?
    Regards!

  6. gaurav said:

    good tutorial! thanks