Difference between revisions of "HowTo:Create a JSP Page and Java Controller"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 1: Line 1:
<noinclude>
<noinclude>
{{Orientation|Developers|Intermediate|15}}
{{Orientation|Developers|Intermediate|30}}
</noinclude>This example shows how a JSP [[Page]] and a Controller [[Class]] interact to let the user:
</noinclude>This example shows how a JSP [[Page]] and a Controller [[Class]] interact to let the user:
:*add records to a Mailing List object  
:*add records to a Mailing List object  
:*do a SQL search for (one or more) records  
:*do a SQL search for (one or more) records  
:*update records
:*update records
==Overview==
A JSP [[Page]] and a controller [[Class]] are created to update a mailing list.
{{#if {{ShowIsvInfo}} |
: ''Learn more:'' See the {{EnterpriseBrand}} Development 101 slides for
}}
==Prerequisites==
:* A "Mailing List" object must created, with two fields: <tt>contact_name</tt> and <tt>contact_email</tt>


The following files are used:
==Developing the Application==
:#Class [{{DOCHOST}}/training/AddUpdateController.java AddUpdateController.java]
===Create the Java class===
:#Page [{{DOCHOST}}/training/AddUpdate.jsp AddUpdate.jsp]
 
;Prerequisites:
:* A "Mailing List" object must be created, with two fields: <tt>contact_name</tt> and <tt>contact_email</tt>
 
To create the Java class:
# Follow the instructions at [[Classes#Adding_a_Class|Add a Class]]
# Follow the instructions at [[Classes#Adding_a_Class|Add a Class]]
# Copy and paste the contents of [{{DOCHOST}}/training/AddUpdateController.java AddUpdateController.java] into the Class
# Copy and paste the contents of [{{DOCHOST}}/training/AddUpdateController.java AddUpdateController.java] into the Class
# Save the class
# Save the class


To create the JSP Page:
===Create the JSP Page===
# Follow the instructions at [[Pages#Adding_a_Page|Add a Page]] to create <tt>AddUpdate.jsp</tt>
# Follow the instructions at [[Pages#Adding_a_Page|Add a Page]] to create <tt>AddUpdate.jsp</tt>
# Copy and paste the contents of [{{DOCHOST}}/training/AddUpdate.jsp AddUpdate.jsp]
# Copy and paste the contents of [{{DOCHOST}}/training/AddUpdate.jsp AddUpdate.jsp]
# Save the JSP page
# Save the JSP page


===Try it Out===
To test the project, visit the following URL:
To test the project, visit the following URL:
:<tt>{{platformURL}}/pages/AddUpdate.jsp</tt><br>(A valid username and password is required to log in to the platform.)
:<tt>{{platformURL}}/pages/AddUpdate.jsp</tt><br>(A valid username and password is required to log in to the platform.)

Revision as of 22:33, 2 August 2012

For:   Developers
Level: Intermediate
Time: 30 minutes

See more:
    ◾ HowTo Guides

This example shows how a JSP Page and a Controller Class interact to let the user:

  • add records to a Mailing List object
  • do a SQL search for (one or more) records
  • update records

Overview

A JSP Page and a controller Class are created to update a mailing list. {{#if |

Learn more: See the AgileApps Cloud platform Development 101 slides for

}}

Prerequisites

  • A "Mailing List" object must created, with two fields: contact_name and contact_email

Developing the Application

Create the Java class

  1. Follow the instructions at Add a Class
  2. Copy and paste the contents of AddUpdateController.java into the Class
  3. Save the class

Create the JSP Page

  1. Follow the instructions at Add a Page to create AddUpdate.jsp
  2. Copy and paste the contents of AddUpdate.jsp
  3. Save the JSP page

Try it Out

To test the project, visit the following URL:

https://{yourDomain}/networking/pages/AddUpdate.jsp
(A valid username and password is required to log in to the platform.)