simpleorm.simplewebapp.core |
A micro-framework for simple jsp beans using reified fields.
JSTL Gotchas Checklist
Look at the following if weird errors appear in JSTL templates/usages:-
- No >taglib> declaration. Tags such as &lgt;c:foreach...> are then silently ignored,
but their contents are still output in the gnerated HTML.
- Missing Bean property get method, eg. getColor(). If your lucky you'll get a message,
else HTML generation is just mysteriously aborted. (It needs the method, not just the field.)
|
Java Source File Name | Type | Comment |
WBeanUtils.java | Class | Very simple get/set properties etc. |
WButton.java | Class | A button that submits the form. |
WButtonBar.java | Class | Created by IntelliJ IDEA. |
WException.java | Class | Used to wrap checked exceptions. |
WField.java | Class | The data field properties.
Each instance represents one crud or list field in a form.
Subtypes implement different data types and validation, eg. |
WFieldGroup.java | Class | A set of fields on a form, eg. |
WFieldGroupList.java | Class | |
WFieldNode.java | Class | Common supertype of FieldGroup and Field. |
WForEachRowTag.java | Class | |
WGlobalState.java | Class | Place to put global state, specialized by application dependent state. |
WI18n.java | Class | Simple wrapper for resource bundles etc. |
WLog.java | Class | Very lightweight logger. |
WMenuAbstractGlobal.java | Class | Created per Servlet to represent either an item or a (sub)menu
Menus can be created independently from WPages, used for despatching.
Menus are currently three levels -- url mapped as /context/servlet/parentMenu/MenuItem.swb.
WARNING. |
WMenuItemGlobal.java | Class | An leaf items on a menu, used to both display menus and dispatch calls to jsps.
WARNING These are generally Global (ie final values), see WGlobalState.
Do not modify them on a per page basis, but do refer to them using
WPageStructure.getPageItem etc. |
WMenuParentGlobal.java | Class | Represents all the WMenuItems in a menu, see WMenuAbstractGlobal. |
WPage.java | Class | The JSP Bean that contains the state for the current page, ie. |
WPageEvents.java | Class | Parent to WPagelet, mainly containing Event stubs.
Overrides should always call super.
The events are generally grouped by pagelet, so that all of a pagelets
processing happens at once.
But each pagelet's OnInitalize method is called first.
Then each pagelets feilds are loaded but not validated.
This is done before the non-interleaved events so that pagelets could interact with each other if really needed.
Then the for each pagelets their onPreValidate/Field Valdiation, *Submitted and Error events are called.
These are not interleaved with other pagelets.
These non-interleaved methods can throw WValidationErrors will be caught and displayed to the user.
This will prevent any further proccessing non-interleaved methods of this pagelet, but the page will continue.
So a Crud error will not prevent a tree or list pagelet from working.
Then the onListRow methods are called as seen in the JSP.
Finally each pagelet's onFinalize is called, after the JSP exits.
Normally a database connection is shared between pagelets, with error events doing rollbacks.
Open the connection on the Page initializer, not the pagelet one.
This approach keeps things simple.
(Why is this more complex than Rails (say)? Mainly because we support the
implementation of independently written pagelets.)
(See WPageStructure.main() for precice details as to how these are called.)
(Having the *Submitted events is a little more compex than just having one
doBody event and testing if wasSubmitted within it. |
WPagelet.java | Class | A page is composed of multiple pagelets that represent things like a Tree or a Crud section. |
WPageletList.java | Class | Pagelet used for displaying lists with sort and search. |
WPageletTag.java | Class | |
WPageSecurity.java | Class | Peer to WPage (one to one) providing Authorizaiton and Authentication methods. |
WPageStructure.java | Class | One-to-one delegate of WPage contains all of a page's doevents, top level fields, groups, menus etc..
Fields belong to fieldGroups, which belong to a WPage/WebBean. |
WServlet.java | Class | Parent of all servelets. |
WTree.java | Class | Used with tree.tag to display trees. |
WValidationException.java | Class | An error messageCode which will be reported to the user. |