Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
HibernateRelationshi...




JSPWiki v2.2.33

[RSS]


Hide Menu

HibernateRelationshipsUI


Difference between version 24 and version 23:

At line 112 changed 5 lines.
# Add keys to ApplicationResources.properties
# Create weblogList.jsp
# Create weblogForm.jsp
# Add WeblogMenu to menu-config.xml and menu.jsp
# Add @struts.validator type="required" to weblogForm.jsp to prevent Struts Exception
Add the following i18n keys to ''web/WEB-INF/classes/__ApplicationResources.properties__''. You'll need these for the master/detail screen when editing weblogs.
At line 114 added 50 lines.
{{{
# -- weblog form --
weblogForm.weblogId=Weblog Id
weblogForm.blogTitle=Blog Title
weblogForm.dateCreated=Date Created
weblogForm.entries=Entries
weblogForm.users=Users
weblog.added=Weblog has been added successfully.
weblog.updated=Weblog has been updated successfully.
weblog.deleted=Weblog has been deleted successfully.
# -- weblog list page --
weblogList.title=Weblog List
weblogList.heading=Weblogs
# -- weblog detail page --
weblogDetail.title=Weblog Detail
weblogDetail.heading=Weblog Information
}}}
Create [weblogList.jsp] and [weblogForm.jsp] files in ''web/pages''.
Add a "WeblogMenu" to ''web/WEB-INF/menu-config.xml'':
{{{<Menu name="WeblogMenu" title="weblogList.title" page="/weblogs.html"/>}}}
Add this menu to ''web/pages/__menu.jsp__'':
{{{
...
<menu:displayMenu name="WeblogMenu"/>
</menu:useMenuDisplayer>
}}}
There is an issue with Struts where the client-side validation blows up if you have &lt;html:javascript&gt; tags in your page and no validation rules defined. To prevent this from happening, add at least validation rule to __Weblog.java__. For example, that ''blogTitle'' is a required field.
[{Java2HtmlPlugin
/**
* @hibernate.property column="blog_title" not-null="true"
* @struts.validator type="required"
*/
public String getBlogTitle() {
return blogTitle;
}
}]
At this point, you should be able to run __ant deploy reload__ and navigate to the "Weblog List" (from the menu). You should also be able to perform CRUD on a weblog object.

Back to HibernateRelationshipsUI, or to the Page History.