Author: afedosik
Date: 2007-05-11 12:37:20 -0400 (Fri, 11 May 2007)
New Revision: 2027
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml
Log:
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml
===================================================================
---
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml 2007-05-11
16:34:48 UTC (rev 2026)
+++
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml 2007-05-11
16:37:20 UTC (rev 2027)
@@ -181,7 +181,7 @@
<title></title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/"/>
+ <imagedata fileref="images/visual.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -248,7 +248,7 @@
<title></title>
<mediaobject>
<imageobject>
- <imagedata fileref="img/"/>
+ <imagedata fileref="images/visual2.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -326,13 +326,13 @@
<?dbhtml filename="RunningTheApplicationJSF.html"?>
<title>Running the Application</title>
<para>Everything is now ready for running our application without having to leave
Red Hat Developer Studio
-by using the Tomcat engine that comes with the Red Hat Developer Studio plug-in. For
controlling
-Tomcat within Red Hat Developer Studio, the toolbar contains a special
panel</para>
+by using the JBoss engine that comes with the Red Hat Developer Studio plug-in. For
controlling
+JBoss server within Red Hat Developer Studio, the toolbar contains a special
panel</para>
<figure>
<title></title>
<mediaobject>
<imageobject>
- <imagedata fileref="img/"/>
+ <imagedata fileref="images/running.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -348,7 +348,7 @@
<title></title>
<mediaobject>
<imageobject>
- <imagedata fileref="img/"/>
+ <imagedata fileref="images/run.png"/>
</imageobject>
</mediaobject>
</figure>
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml
===================================================================
---
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml 2007-05-11
16:34:48 UTC (rev 2026)
+++
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml 2007-05-11
16:37:20 UTC (rev 2027)
@@ -9,16 +9,15 @@
the way demonstrating some of the powerful features of Red Hat Developer Studio. You will
design the
application, generate stub code for the application, fill in the stub coding, compile the
application,
and run the application all from inside Red Hat Developer Studio.</para>
-<para>Well assume that you have already launched Eclipse with Exadel Studio or
Exadel Studio
-Pro installed and also that the Red Hat Developer Studio perspective is the current
perspective. (If not,
-make it active by selecting Window/Open Perspective/Red Hat Developer Studio from the
menu bar.)</para>
+<para>Well assume that you have already launched Eclipse with Red Hat Developer
Studio installed and also that the Red Hat Developer Studio perspective is the current
perspective. (If not,
+make it active by selecting Window/Open Perspective/Other/Red Hat Developer Studio from
the menu bar.)</para>
<section id="StartingUp">
<title>Starting Up</title>
<para>We are first going to create a new project for the application.</para>
<orderedlist>
<listitem><para>Go to the menu bar and select File/New/Project...
.</para></listitem>
-<listitem><para>Select Exadel Studio/Struts/Struts Project in the New Project
dialog box.</para></listitem>
+<listitem><para>Select Red Hat Developer Studio/Struts/Struts Project in the
New Project dialog box.</para></listitem>
<listitem><para>Click Next >.</para></listitem>
<listitem><para>Enter StrutsHello as the project
name.</para></listitem>
<listitem><para>Leave everything else as is, and click Next
>.</para></listitem>
@@ -55,7 +54,7 @@
<listitem><para>We will keep our presentation files in this
folder.</para></listitem>
<listitem><para>Right-click the pages folder and select New/File/JSP...
.</para></listitem>
- <listitem><para>16. For Name type in inputname (the JSP
extension will be automatically added to the file), for Template select StrutsForm, and
then click on the Finish button.</para></listitem>
+ <listitem><para>For Name type in inputname (the JSP extension
will be automatically added to the file), for Template select StrutsForm, and then click
on the Finish button.</para></listitem>
<listitem><para>Right-click the pages folder again and select New/File/JSP...
.</para></listitem>
<listitem><para>For Name type in greeting , for Template leave as Blank, and
then click on the Finish button.</para></listitem>
</orderedlist>
@@ -82,11 +81,11 @@
</orderedlist>
<table>
<tgroup cols="2">
- <row>
- <entry>path</entry>
- <entry>/greeting</entry>
- </row>
<row>
+ <entry>path</entry>
+ <entry>/greeting</entry>
+ </row>
+ <row>
<entry>name</entry>
<entry>GetNameForm</entry>
</row>
@@ -117,7 +116,7 @@
<para>Lets now create a link from the inputname.jsp page to the
action.</para>
<orderedlist continuation="continues">
<listitem><para>On the left-hand side of the diagram in the column of icons,
click on this icon:</para></listitem>
- <listitem><para>26. In the connect-the-components mode you are
in now, click on the /pages/inputname.jsp icon in the diagram and then click on the
/greeting action.</para></listitem>
+ <listitem><para>In the connect-the-components mode you are in
now, click on the /pages/inputname.jsp icon in the diagram and then click on the /greeting
action.</para></listitem>
</orderedlist>
<para>A link will be created from the page to the action.</para>
</section>
@@ -173,7 +172,7 @@
<title>Generating Stub Coding</title>
<para>We are done with designing the application through the diagram. Now we need
to write
code for the action component. We also need to write an action class for the
/greeting mapping
- along with a FormBean. To aid in the coding phase, Exadel Studio can generate Java
class
+ along with a FormBean. To aid in the coding phase, Red Hat Developer Studio can
generate Java class
stubs for all of the components shown in the diagram.</para>
<orderedlist continuation="continues">
<listitem><para>Switch back to the diagram, by selecting the Diagram tab at
the bottom of the editor window.</para></listitem>
@@ -205,7 +204,7 @@
<orderedlist continuation="continues">
<listitem><para>Double-click GetNameForm.java for
editing.</para></listitem>
-<listitem><para>You are looking at a Java stub class that was generated by
Exadel Studio. Now we are going to edit the file.</para></listitem>
+<listitem><para>You are looking at a Java stub class that was generated by
Red Hat Developer Studio. Now we are going to edit the
file.</para></listitem>
<listitem><para>Add the following attributes at the beginning of the
class:</para></listitem>
</orderedlist>
@@ -228,39 +227,44 @@
<para>The final GetNameForm.java file should 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.action.ActionForm {
-private String name = "";
-private String greetName = "";
-public String getName() {
-return name;
+
+ private String name = "";
+ private String greetName = "";
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getGreetName() {
+ return greetName;
+ }
+
+ public void setGreetName(String greetName) {
+ this.greetName = greetName;
+ }
+
+ public GetNameForm() {
+ }
+
+ public void reset(ActionMapping actionMapping, HttpServletRequest request) {
+ this.name = "";
+ this.greetName = "";
+ }
+
+ public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
+ ActionErrors errors = new ActionErrors();
+ return errors;
+ }
}
-public void setName(String name) {
-this.name = name;
-}
-public String getGreetName() {
-return greetName;
-}
-public void setGreetName(String greetName) {
-this.greetName = greetName;
-}
-public GetNameForm() {
-}
-public void reset(ActionMapping actionMapping, HttpServletRequest
-request) {
-this.name = "";
-this.greetName = "";
-}
-public ActionErrors validate(ActionMapping actionMapping,
-Exadel Studio: Getting Started Guide for Creating a Struts Application
-page 7 of 11
-HttpServletRequest request) {
-ActionErrors errors = new ActionErrors();
-return errors;
-}
-}
]]></programlisting>
<orderedlist continuation="continues">
@@ -279,29 +283,34 @@
String greeting = "Hello, "+name+"!";
((GetNameForm)form).setGreetName(greeting);
return mapping.findForward(FORWARD_sayHello);
+
The final version of GreetingAction.java should look like this:
package sample;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+
public class GreetingAction extends org.apache.struts.action.Action {
-// Global Forwards
-public static final String GLOBAL_FORWARD_getName = "getName";
-// Local Forwards
-public static final String FORWARD_sayHello = "sayHello";
-public GreetingAction() {
+
+ // Global Forwards
+ public static final String GLOBAL_FORWARD_getName = "getName";
+
+ // Local Forwards
+ public static final String FORWARD_sayHello = "sayHello";
+
+ public GreetingAction() {
+ }
+ public ActionForward execute(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) throws Exception {
+ String name = ((GetNameForm)form).getName();
+ String greeting = "Hello, "+name+"!";
+ ((GetNameForm)form).setGreetName(greeting);
+ return mapping.findForward(FORWARD_sayHello);
+ }
}
-public ActionForward execute(ActionMapping mapping, ActionForm form,
-HttpServletRequest request, HttpServletResponse response) throws
-Exception {
-String name = ((GetNameForm)form).getName();
-String greeting = "Hello, "+name+"!";
-((GetNameForm)form).setGreetName(greeting);
-return mapping.findForward(FORWARD_sayHello);
-}
-}
]]></programlisting>
<orderedlist continuation="continues">
<listitem><para>Save the file.</para></listitem>
@@ -324,9 +333,9 @@
<listitem><para>Input name:</para></listitem>
<listitem><para>Select the Visual pane of the
editor.</para></listitem>
-<listitem><para>Then, in the Exadel Palette, expand the Struts Form library,
select text, and drag it onto the box.</para></listitem>
+<listitem><para>Then, in the Red Hat Palette, expand the Struts Form library,
select text, and drag it onto the box.</para></listitem>
<listitem><para>In the Insert Tag dialog box, type in name for property and
select Finish.</para></listitem>
-<listitem><para>In the Struts Form library in the Exadel Palette, select
submit, and drag it to right after the the text box in the Visual pane of the
editor.</para></listitem>
+<listitem><para>In the Struts Form library in the Red Hat Palette, select
submit, and drag it to right after the the text box in the Visual pane of the
editor.</para></listitem>
<listitem><para>Right-click the submit button and select
<html:submit> Attributes from the context
menu.</para></listitem>
<listitem><para>In the Attributes dialog box, select the value field and type
in Say Hello! for its value.</para></listitem>
</orderedlist>
@@ -342,28 +351,28 @@
<programlisting role="XML"><![CDATA[
<html>
<head>
-<title>Greeting</title>
+ <title>Greeting</title>
</head>
-<body>
-<p>
-</p>
-</body>
+ <body>
+ <p>
+ </p>
+ </body>
</html>
]]></programlisting>
-<para>To complete editing of this file, we will use macros from the Exadel Palette.
This palette is a view that should be available to the right of the editing
area.</para>
+<para>To complete editing of this file, we will use macros from the Red Hat
Palette. This palette is a view that should be available to the right of the editing
area.</para>
<orderedlist continuation="continues">
-<listitem><para>Click on the Struts Common folder in the Exadel Palette to
open it.</para></listitem>
-<listitem><para>Position the cursor at the beginning of the greeting.jsp file
in the Source pane and then click on bean taglib in the Exadel
Palette.</para></listitem>
+<listitem><para>Click on the Struts Common folder in the Red Hat Palette to
open it.</para></listitem>
+<listitem><para>Position the cursor at the beginning of the greeting.jsp file
in the Source pane and then click on bean taglib in the Red Hat
Palette.</para></listitem>
</orderedlist>
<para>This will insert the following line at the top of the file:</para>
<programlisting role="JAVA"><![CDATA[
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
]]></programlisting>
<orderedlist continuation="continues">
-<listitem><para>Click on the Struts Bean folder in the Exadel Palette to open
it.</para></listitem>
+<listitem><para>Click on the Struts Bean folder in the Red Hat Palette to
open it.</para></listitem>
<listitem><para>Position the cursor inside the p
element.</para></listitem>
-<listitem><para>Click on write in the Exadel
Palette.</para></listitem>
+<listitem><para>Click on write in the Red Hat
Palette.</para></listitem>
<listitem><para>Type in GetNameForm for the name attribute and add a property
attribute with greetName as its value.</para></listitem>
</orderedlist>
<para>The editor should should now look like this:</para>
@@ -376,7 +385,7 @@
<para>node and select New/File/JSP... .</para>
</listitem>
<listitem><para>Type index for Name and click on the Finish
button.</para></listitem>
-<listitem><para>On the Exadel Palette, select the Struts Common folder of
macros by clicking on it in the palette.</para></listitem>
+<listitem><para>On the Red Hat Palette, select the Struts Common folder of
macros by clicking on it in the palette.</para></listitem>
<listitem><para>Click on the logic taglib
icon.</para></listitem>
<listitem><para>Press the Enter key in the editor to go to the next
line.</para></listitem>
<listitem><para>Back on the palette, select the Struts Logic folder of
macros.</para></listitem>
@@ -404,14 +413,14 @@
<?dbhtml filename="RunningtheApplication.html"?>
<title>Running the Application</title>
<para>Everything is now ready for running our applicationwithout having to leave
Red Hat Developer Studio
- by using the Tomcat engine that comes with the Red Hat Developer Studio plug-in. For
controlling
- Tomcat within Red Hat Developer Studio, the toolbar contains a panel.</para>
+ by using the JBoss Application Server engine that comes with the Red Hat Developer
Studio plug-in. For controlling
+ JBoss AS within Red Hat Developer Studio, the toolbar contains a
panel.</para>
<orderedlist continuation="continues">
-<listitem>Start up Tomcat by clicking on the first icon from left in this panel.
(If Tomcat is
+<listitem>Start up JBoss AS by clicking on the first icon from left in this panel.
(If JBoss AS is
already running, stop it by clicking on the third icon from the left and then start
it
again. Remember, the Struts run-time requires restarting the servlet engine when
any changes have been made.)</listitem>
-<listitem>After the messages in the Console tabbed view stop scrolling, Tomcat is
available.
+<listitem>After the messages in the Console tabbed view stop scrolling, JBoss AS is
available.
At this point, right-click on the getName global forward in the struts-config.xml
diagram view and select Run on Server.</listitem>
</orderedlist>