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
Articles
Articles_cn
Articles_de
Articles_pt
CreateActions
CreateActions_de
CreateActions_it
CreateActions_pt
CreateActions_zh
SpringControllers_ko
...and 2 more




JSPWiki v2.2.33

[RSS]


Hide Menu

WebWorkActions


Difference between version 20 and version 8:

At line 26 changed 1 line.
* Execute __ant -Dobject.name=Person -Dappgen.type=pojo__ to generate a bunch of files in extras/appgen/build/gen. In fact, it'll generate all the files you need to complete this tutorial. However, let's just grab the ones you need.
* Execute __ant -Dobject.name=Person -Dappgen.type=pojo -Dapp.module=__ to generate a bunch of files in extras/appgen/build/gen. In fact, it'll generate all the files you need to complete this tutorial. However, let's just grab the ones you need.
At line 28 changed 3 lines.
** web/personForm.jsp (JSP file for viewing a single Person)
** web/personList.jsp (JSP file for viewing a list of People)
* Copy the contents of Person.properties into web/WEB-INF/classes/ApplicationResources_en.properties. These are all the keys you will need for titles/headings and form properties. Here is an example of what you should add to ApplicationResources_en.properties:
** web/pages/personForm.jsp (JSP file for viewing a single Person)
** web/pages/personList.jsp (JSP file for viewing a list of People)
* Copy the contents of Person.properties into web/WEB-INF/classes/ApplicationResources.properties. These are all the keys you will need for titles/headings and form properties. Here is an example of what you should add to ApplicationResources.properties:
At line 34 changed 3 lines.
personForm.id=Id
personForm.firstName=First Name
personForm.lastName=Last Name
person.id=Id
person.firstName=First Name
person.lastName=Last Name
At line 51 changed 1 line.
* Copy personForm.jsp to web/personForm.jsp. Copy personList.jsp to web/personList.jsp.
* Copy personForm.jsp to web/pages/personForm.jsp. Copy personList.jsp to web/pages/personList.jsp.
At line 60 changed 2 lines.
* Add keys in ApplicationResources_en.properties the titles and headings in the JSPs
In the generated JSPs, there are two keys for the title (top of the browser window) and the header (heading in the page). We now need to add these two keys (personDetail.title and personDetail.heading) to ApplicationResources_en.properties.
* Add keys in ApplicationResources.properties the titles and headings in the JSPs
In the generated JSPs, there are two keys for the title (top of the browser window) and the header (heading in the page). We now need to add these two keys (personDetail.title and personDetail.heading) to ApplicationResources.properties.
At line 102 changed 1 line.
assertEquals(action.edit(), "success");
assertEquals("success", action.edit());
At line 116 changed 2 lines.
assertEquals(action.save(), "input");
assertEquals(action.getPerson().getLastName(), "Updated Last Name");
assertEquals("input", action.save());
assertEquals("Updated Last Name", action.getPerson().getLastName());
At line 130 changed 1 line.
assertEquals(action.delete(), "success");
assertEquals("success", action.delete());
At line 175 added 1 line.
saveMessage(getText("person.deleted"));
At line 176 removed 4 lines.
List args = new ArrayList();
args.add(person.getFirstName() + ' ' + person.getLastName());
saveMessage(getText("person.deleted", args));
At line 204 removed 3 lines.
List args = new ArrayList();
args.add(person.getFirstName() + ' ' + person.getLastName());
At line 210 changed 1 line.
saveMessage(getText(key, args));
saveMessage(getText(key));
At line 221 changed 1 line.
There are a few keys you need to add to ApplicationResources_en.properties to display the success messages. This file is located in ''web/WEB-INF/classes'' - open it and add the following:
There are a few keys you (might) need to add to ApplicationResources.properties to display the success messages. This file is located in ''web/WEB-INF/classes'' - open it and add the following:
At line 225 changed 3 lines.
{{{person.added=Information for <strong>{0}</strong> has been added successfully.
person.deleted=Information for <strong>{0}</strong> has been deleted successfully.
person.updated=Information for <strong>{0}</strong> has been updated successfully.
{{{person.added=Person has been added successfully.
person.updated=Person has been updated successfully.
person.deleted=Person has been deleted successfully.
At line 238 changed 2 lines.
<bean id="personAction" class="org.appfuse.webapp.action.PersonAction" singleton="false">
<property name="personManager"><ref bean="personManager"/></property>
<bean id="personAction" class="org.appfuse.webapp.action.PersonAction" scope="prototype">
<property name="personManager" ref="personManager"/>
At line 252 removed 1 line.
<!--interceptor-ref name="validationStack"/-->
At line 259 removed 2 lines.
;:''The "validationStack" interceptor-ref is commented out in the above XML block because you haven't defined any validation rules for the Person object. We'll uncomment this value when we add validation in the next tutorial.''
At line 291 removed 15 lines.
Now let's clean up the generated personForm.jsp by making the "id" property a hidden field. Remove the following code block from web/pages/personForm.jsp:
[{Java2HtmlPlugin
<ww:textfield label="getText('person.id')" name="'person.id'"
value="person.id" required="true"/>
}]
And add the following before the &lt;table&gt; tag:
[{Java2HtmlPlugin
<ww:hidden name="'person.id'" value="person.id"/>
}]
At line 309 changed 1 line.
document.forms["person"].elements["firstName"].focus();
Form.focusFirstElement(document.forms["personForm"]);
At line 312 changed 1 line.
Now if you execute __ant db-load deploy__, start Tomcat and point your browser to [http://localhost:8080/appfuse/editPerson.html?id=1], you should see something like this:
Now if you execute __ant db-load deploy__, start Tomcat and point your browser to [http://localhost:8080/appfuse/editPerson.html?id=1], you should see something like this, with focus given to the first field in the form.
At line 349 added 1 line.
<verifytext description="verify success message" text="${person.updated}"/>
At line 392 changed 2 lines.
<verifytext description="verify success message"
text="Information for &lt;strong&gt;Abbie Raible&lt;/strong&gt; has been added successfully."/>
<verifytext description="verify success message" text="${person.added}"/>
At line 382 added 1 line.
<prepareDialogResponse description="Confirm delete" dialogType="confirm" response="true"/>
At line 384 added 1 line.
<verifyNoDialogResponses/>
At line 408 changed 2 lines.
<verifytext description="verify success message"
text="Information for &lt;strong&gt;Matt Canoo&lt;/strong&gt; has been deleted successfully."/>
<verifytext description="verify success message" text="${person.deleted}"/>

Back to WebWorkActions, or to the Page History.