leejeok

The Remarkable Everyday

Struts for navigation between JSP pages

Posted by leejeok on May 8, 2008

I will use the ActionClass to navigate the client to the proper JSP pages. The ActionClass will decide which JSP page to be display on the browser.

By having the configurations file, I will specified the pages within here.

 

<action

          path= “/somerequest”

          type=”com.somepackage.someAction”

          scope=”request”

          name=”someForm”

          validate=”true”

          input=”somePage.jsp”>

          <forward name=”Success” path=”/successPage.jsp” redirect=”true”/>

             <forward name=”Failure” path=”/errorPage.jsp” redirect=”true”/>

</action>

 If you are building a login page and would like to redirect client to the menu page after success login, perhaps your configuration file would look similar like this:

<action

input=”/login.jsp”

name=”loginForm”

path=”/myapplication”

scope=”request”

type=”com.myapplication.struts.loginAction”>

      <forward name=”success” path=”/mainmenu.jsp”/>       

</action>

Here, I included with the program which require client to enter some input before allow to proceed to the next page. Click HERE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: