Author: afedosik
Date: 2007-05-14 09:53:21 -0400 (Mon, 14 May 2007)
New Revision: 2031
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
Log:
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
===================================================================
---
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-05-14
13:16:50 UTC (rev 2030)
+++
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-05-14
13:53:21 UTC (rev 2031)
@@ -49,6 +49,7 @@
<listitem><para>Drag up the sample.applResources icon until you can drop it
on the resources folder under struts-config.xml.</para></listitem>
<listitem><para>Select File/Save All from the menu
bar.</para></listitem>
+<listitem><para>Select validation.xml under the StrutsHello/Validation node
and double-click it to open it with the Red Hat Developer Studio Validation
Editor.</para></listitem>
<listitem><para>Select validation.xml under the StrutsHello/Validation node
and double-click it to open it with the Red Hat Studio Validation
Editor.</para></listitem>
<listitem><para>Expand the form-beans node under the
StrutsHello/Configuration/default/ struts-config.xml node. Then, drag the form bean
GetNameForm and drop it onto formset (default) in the Validation
Editor.</para></listitem>
<listitem><para>In the Validation Editor, expand the formset node,
right-click GetNameForm, and select Add Field... from the context
menu.</para></listitem>
@@ -76,10 +77,9 @@
<listitem><para>Double-click inputname.jsp under StrutsHello/WEB-ROOT
(WebContent)/ pages to open it for editing.</para></listitem>
<listitem><para>Find the tag near the top and hit Return to make a new line
under it.</para></listitem>
<listitem><para>In the Red Hat Palette view to the right, open the HTML
folder and click on the javascript tag.</para></listitem>
-
-<listitem><para>Back in the editor, just in front of the closing slash for
this inserted tag, hit Ctrlspace and select formName from the prompting
menu.</para></listitem>
+<listitem><para>Back in the editor, just in front of the closing slash for
this inserted tag, hit Ctrl+Space and select formName from the prompting
menu.</para></listitem>
<listitem><para>Over in the Web Projects view, select GetNameForm under the
StrutsHello/Configuration/ default/struts-config.xml/form-beans node, drag it, and drop it
between the quotes in the editor.</para></listitem>
-<listitem><para>Modify the >html:form< tag by inserting this
attribute:</para></listitem>
+<listitem><para>Modify the <html:form> tag by inserting this
attribute:</para></listitem>
</orderedlist>
<para>onsubmit="return validateGetNameForm(this)"</para>
<para>The file should now look like this:</para>
@@ -87,29 +87,31 @@
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
-<title>Input name</title>
-<html:javascript formName="GetNameForm"/>
+ <title>Input name</title>
+ <html:javascript formName="GetNameForm"/>
</head>
<body>
-<html:form action="/greeting.do" onsubmit="return
-<para>validateGetNameForm(this)"></para>
-<table border="0" cellspacing="0" cellpadding="0">
-<tr>
-<td><b>Input name:</b></td>
-</tr>
-<tr>
-<td>
-<html:text property="name" />
-<html:submit value=" Say Hello! " />
-</td>
-</tr>
-</table>
-</html:form>
+ <html:form action="/greeting.do" onsubmit="return
+ <para>validateGetNameForm(this)"></para>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><b>Input name:</b></td>
+ </tr>
+ <tr>
+ <td>
+ <html:text property="name" />
+ <html:submit value=" Say Hello! " />
+ </td>
+ </tr>
+ </table>
+ </html:form>
</body>
</html:html>
]]></programlisting>
<orderedlist continuation="continues">
<listitem><para>Select File/Save from the menu
bar.</para></listitem>
+<listitem><para>28. Start JBoss Application Server by clicking on its icon (a
right-pointing arrow) in the toolbar.</para></listitem>
+<listitem><para>29. Click on the Run icon in the
toolbar.</para></listitem>
<listitem><para>Start Tomcat by clicking on its icon (a right-pointing arrow)
in the toolbar.</para></listitem>
<listitem><para>Click on the Run icon in the
toolbar.</para></listitem>
</orderedlist>
@@ -139,9 +141,9 @@
<title>Editing the JSP File</title>
<orderedlist continuation="continues">
<listitem><para>Reopen inputname.jsp for
editing.</para></listitem>
-<listitem><para>Delete the onsubmit attribute in the
>html:form< element that you put in for client-side
validation.</para></listitem>
+<listitem><para>Delete the onsubmit attribute in the
<html:form> element that you put in for client-side
validation.</para></listitem>
-<listitem><para>Add an >html:errors/> tag after the
>/html:form> tag.</para></listitem>
+<listitem><para>Add an <html:errors/> tag after the
</html:form> tag.</para></listitem>
</orderedlist>
<para>The JSP file should now look like this:</para>
@@ -149,24 +151,24 @@
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
-<title>Input name</title>
-<html:javascript formName="GetNameForm"/>
+ <title>Input name</title>
+ <html:javascript formName="GetNameForm"/>
</head>
<body>
-<html:form action="/greeting.do">
-<table border="0" cellspacing="0" cellpadding="0">
-<tr>
-<td><b>Input name:</b></td>
-</tr>
-<tr>
-<td>
-<html:text property="name" />
-<html:submit value=" Say Hello! " />
-</td>
-</tr>
-</table>
-</html:form>
-<html:errors />
+ <html:form action="/greeting.do">
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><b>Input name:</b></td>
+ </tr>
+ <tr>
+ <td>
+ <html:text property="name" />
+ <html:submit value=" Say Hello! " />
+ </td>
+ </tr>
+ </table>
+ </html:form>
+ <html:errors />
</body>
</html:html>
]]></programlisting>
@@ -181,7 +183,7 @@
<listitem><para>In the Edit Properties window, insert the cursor into the
value column for the input property and click on the ...
button.</para></listitem>
-<listitem><para>In the dialog box, make sure the Pages tab is selected,
select StrutsHello/WEBROOT( WebContent)/pages/ inputname.jsp, click the Ok button, and
then click on the Close button.</para></listitem>
+<listitem><para>In the dialog box, make sure the Pages tab is selected,
select StrutsHello/WEB-ROOT(WebContent)/pages/inputname.jsp, click the Ok button, and then
click on the Close button.</para></listitem>
</orderedlist>
</section>
<section id="EditingTheFormBean">
@@ -196,42 +198,50 @@
<para>The file should now look like this:</para>
<programlisting role="JAVA"><![CDATA[
package sample;
+
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
public class GetNameForm extends
+
org.apache.struts.validator.ValidatorForm {
-private String name = "";
-/**
-* @return Returns the name.
-*/
-public String getName() {
-return name;
+
+ private String name = "";
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public GetNameForm () {
+ }
+
+ public void reset(ActionMapping actionMapping,
+ HttpServletRequest request) {
+ this.name = "";
+ }
+
+ // public ActionErrors validate(ActionMapping actionMapping,
+ HttpServletRequest request) {
+ // ActionErrors errors = new ActionErrors();
+ // return errors;
+ // }
}
-/**
-* @param name The name to set.
-*/
-public void setName(String name) {
-this.name = name;
-}
-public GetNameForm () {
-}
-public void reset(ActionMapping actionMapping, HttpServletRequest
-request) {
-this.name = "";
-}
-// public ActionErrors validate(ActionMapping actionMapping,
-HttpServletRequest request) {
-// ActionErrors errors = new ActionErrors();
-// return errors;
-// }
-}
]]></programlisting>
<para>Select File/Save All from the menu bar.</para>
<orderedlist continuation="continues">
-<listitem><para>Reload the application into Tomcat by clicking on the Change
Time Stamp icon (a finger pointing with a little star) in the
toolbar.</para></listitem>
+<listitem><para>Reload the application into JBoss AS by clicking on the
Change Time Stamp icon (a finger pointing with a little star) in the
toolbar.</para></listitem>
<listitem><para>Run the application.</para></listitem>
<listitem><para>In the browser window, click on the Say Hello! button without
having entered any name in the form.</para></listitem>
</orderedlist>
Show replies by date