Thursday, 20 February 2014

Redirection for jsp -ATG

Redirection

      The Redirect servlet bean takes a full or relative URL and redirects the user to the specified page. When the Redirect servlet bean is invoked, the second page displays in response (and an IOException is thrown, thereby discarding the request).

Input parameter:

url
       The full or relative URL of the page to redirect the user to.

Example:

        <dsp:droplet name="/atg/dynamo/droplet/Redirect">

                     <dsp:param name="url" value="youpage.jsp"/>

        </dsp:droplet>

Redirection droplet is mainly used in profile transient property. For an example for a loggedin user registeration page is not needed so registration.jsp page will not be seen by the registered users.

registration.jsp

<switch droplet>
-input profile.transient
<oparam-true>
       not registered user so login.jsp or register.jsp
</oparam>

<oparam-false>
      already logged in user so redirect to index.jsp
<redirection droplet> for redirection to index.jsp page
</oparam>


No comments:

Post a Comment