JCodeBox allows you to define different types of components in the web tier:
ViewSets
A ViewSet provides a set of basic views on a component (i.e. EJB). These views are implemented using JSP/servlets and the view helper
pattern. The basic views provided by a ViewSet include create, read, update and delete. In addition, depending on the component the
ViewSet is operating on, the following functionality may also be available - finders, creators, simple business methods (that use
primitives or primitive wrappers only) and relationships.
To define a ViewSet you need to complete the define View Set dialog. You can define more than one at a time (depending on available
entities/EJBs) and bypass the define View Set dialog - default values will be provided based on the underlying entity/EJB name (see
the Adding a view set section for further details). Once defined, you can preview your ViewSet to see the exact code that will be
created.
View Helper (plus JSP)
A view helper implements the view helper pattern and allows you to add the main view helper class/bean and any number of JSP linked
to that class (the JSP will contain a useBean action associating them with the view helper). You can also add methods to the
view helper and link specific JSP to specific methods. To define a view helper you need to complete the define view helper dialog.
Java Server Pages (JSP)
You can also add individual JSP to the web tier to create additional functionality. To define a JSP you need to complete the define
JSP dialog.
Servlets
You can add Java Servlets to the web tier by completing the define Servlet dialog.
Text components
Text components allow you to add text based components such as HTML pages to the web tier.
Resource components
Resource components allow you to add resources such as graphics (i.e. .gif, .jpg) to the web tier.
Right mouse click on the view set in the define application dialog
Select Edit from the popup menu
Or
Select the Action=>Component menu option from the main menu in the define application dialog
Select Web Tier and press next
Select the view set you would like to edit and press next
Select Edit and press finish
The define view set dialog is displayed.
To change the modelsource of your view set press the select button. This will display the select modelsource dialog. Select
the new modelsource. Press OK.
To modify the view set name, view helper class name or view helper class package type the new values in the corresponding text fields
Press OK to save your view set
Your view set has now been updated and is displayed in the Web Tier of the define application dialog.
Right mouse click on Web Tier in the define application dialog
Select Add View Helper (+JSP) from the popup menu
Or
Select the Action=>Tier menu option from the main menu in the define application dialog
Select Web Tier and press next
Select Add View Helper (+JSP) and press finish
The define View Helper dialog is displayed.
Enter a name and package for the View Helper in the View Helper name and View Helper Package text fields.
Use the methods buttons to add/edit/remove methods for the View Helper
Use the imports buttons to add/edit/remove imports for the View Helper The application button allows you to add imports
for other components in your application.
Use the JSP buttons to add/edit/remove individual JSP that will be attached to this View Helper. Templates are provided
for standard JSP and for JSP forms
Use the class variables buttons to add/edit/remove variables for the View Helper
Press OK to save your View Helper
Your View Helper is now displayed in the Web Tier of the define application dialog.
Right mouse click on the View Helper in the define application dialog
Select Edit from the popup menu
Or
Select the Action=>Component menu option from the main menu in the define application dialog
Select Web Tier and press next
Select the View Helper you would like to edit and press next
Select Edit and press finish
The define View Helper dialog is displayed.
To modify the name or package for the View Helper type the new value in the corresponding text field.
Use the methods buttons to add/edit/remove methods for the View Helper
Use the imports buttons to add/edit/remove imports for the View Helper The application button allows you to add imports
for other components in your application.
Use the JSP buttons to add/edit/remove individual JSP that will be attached to this View Helper. Templates are provided
for standard JSP and for JSP forms
Use the class variables buttons to add/edit/remove variables for the View Helper
Press OK to save your View Helper
Your View Helper has now been updated and is displayed in the Web Tier of the define application dialog.
Right mouse click on Web Tier in the define application dialog
Select Add JSP from the popup menu
Or
Select the Action=>Tier menu option from the main menu in the define application dialog
Select Web Tier and press next
Select Add JSP and press finish
The define JSP dialog is displayed.
Enter a name for the JSP in the JSP name text field.
Enter a path for the JSP in the path text field.
Enter the JSP scripting code and HTML in the JSP script/HTML text area.
Add any imports required by the JSP using the add or application buttons. The application button allows you to add imports
for other components in your application. Use the edit button to modify imports and the remove button to delete them.
Press OK to save your JSP
Your JSP is now displayed in the Web Tier of the define application dialog.
Right mouse click on the JSP in the define application dialog
Select Edit from the popup menu
Or
Select the Action=>Component menu option from the main menu in the define application dialog
Select Web Tier and press next
Select the JSP you would like to edit and press next
Select Edit and press finish
The define JSP dialog is displayed.
To modify the name for the JSP type the new value in the JSP name text field.
To modify the path for the JSP type the new value in the path text field.
To modify the JSP scripting code and HTML update the text in the JSP script/HTML text area.
Use the imports buttons to add/edit/remove imports for the JSP. The application button allows you to add imports
for other components in your application.
Press OK to save your JSP
Your JSP has now been updated and is displayed in the Web Tier of the define application dialog.
Right mouse click on Web Tier in the define application dialog
Select Add Servlet from the popup menu
Or
Select the Action=>Tier menu option from the main menu in the define application dialog
Select Web Tier and press next
Select Add Servlet and press finish
The define Servlet dialog is displayed.
Enter a package for the servlet in the package text field.
Select the visibility for the servlet class.
Enter the servlet name in the servlet name text field
Enter the base/parent class for the servlet in the base/parent class text field
Enter a description for the servlet in the description text field
Add any imports required by the servlet using the add or application buttons. The application button allows you to add imports
for other components in your application. Use the edit button to modify imports and the remove button to delete them.
Add any methods required by the servlet using the add button. Use the edit button to modify methods and the remove button to delete them.
Use the code tab to add/edit/remove modifiers, variables or implemented interfaces for your servlet
Press OK to save your servlet
Your servlet is now displayed in the Web Tier of the define application dialog.
Right mouse click on Web Tier in the define application dialog
Select Add Resource Component from the popup menu
Or
Select the Action=>Tier menu option from the main menu in the define application dialog
Select Web Tier and press next
Select Add Resource Component and press finish
The define Resource Component dialog is displayed.
Enter a name for the resource component in the name text field.
Enter a path for the resource component in the path text field.
Enter the location (i.e. local path) to the source file for the resource. You can press the browse button to display the open dialog which will allow you to navigate to the file.
Press OK to save your resource component
Your resource component is now displayed in the Web Tier of the define application dialog.