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|15}} | ||
</noinclude>This example | </noinclude>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 | :*update records | ||
The following files are used: | |||
:#Class [[AddUpdateController.java|AddUpdateController.java]] | |||
#Class [[ | :#Page [[AddUpdate.jsp|AddUpdate.jsp]] | ||
Β | |||
#Page [[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 add the Pages and Classes: | To add the Pages and Classes: | ||
#To create the | #To create the Java class: | ||
# | # Follow the instructions at [[Classes#Adding_a_Class|Add a Class]] | ||
# Copy and paste the contents of [[AddUpdateController.java]] into the Class | |||
# | # Save the class | ||
#: | |||
#To create the JSP Pages | |||
#: | # Follow the instructions at [[Pages#Adding_a_Page|Add a Page]] to create <tt>AddUpdate.jsp</tt> | ||
#To create the | # Copy and paste the contents of [[AddUpdate.jsp]] | ||
# Save the JSP page | |||
# | #: | ||
# | |||
#: | |||
#To invoke the Directory page from the URL, copy and paste the following into a web browser. A valid username and password is required to log in to the platform. | #To invoke the Directory page from the URL, copy and paste the following into a web browser. A valid username and password is required to log in to the platform. | ||
::<tt>{{platformURL}}/pages/Directory.jsp</tt> | ::<tt>{{platformURL}}/pages/Directory.jsp</tt> |
Revision as of 01:54, 28 July 2012
For: Developers See more: |
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
The following files are used:
- Class AddUpdateController.java
- Page AddUpdate.jsp
- Prerequisites
-
- A "Mailing List" object must be created, with two fields: contact_name and contact_email
To add the Pages and Classes:
- To create the Java class:
- Follow the instructions at Add a Class
- Copy and paste the contents of AddUpdateController.java into the Class
- Save the class
- To create the JSP Pages
- Follow the instructions at Add a Page to create AddUpdate.jsp
- Copy and paste the contents of AddUpdate.jsp
- Save the JSP page
- To invoke the Directory page from the URL, copy and paste the following into a web browser. A valid username and password is required to log in to the platform.
- https://{yourDomain}/networking/pages/Directory.jsp
After logging in, the user can perform these actions in the Directory object:
- search for records based on specified criteria
- add records
- update records