From jbosstools-commits at lists.jboss.org Fri May 11 12:37:21 2007 Content-Type: multipart/mixed; boundary="===============0813067155312676272==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r2027 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules. Date: Fri, 11 May 2007 12:37:20 -0400 Message-ID: --===============0813067155312676272== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/Gettin= gStartedForCreatingaJSFApplication.xml trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/Gettin= gStartedGuideforCreatingaStrutsApplication.xml Log: Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules= /GettingStartedForCreatingaJSFApplication.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/Getti= ngStartedForCreatingaJSFApplication.xml 2007-05-11 16:34:48 UTC (rev 2026) +++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/Getti= ngStartedForCreatingaJSFApplication.xml 2007-05-11 16:37:20 UTC (rev 2027) @@ -181,7 +181,7 @@ = - + @@ -248,7 +248,7 @@ = - + @@ -326,13 +326,13 @@ Running the Application Everything is now ready for running our application without having t= o leave Red Hat Developer Studio = -by using the Tomcat engine that comes with the Red Hat Developer Studio pl= ug-in. For controlling -Tomcat within Red Hat Developer Studio, the toolbar contains a special pan= el +by using the JBoss engine that comes with the Red Hat Developer Studio plu= g-in. For controlling +JBoss server within Red Hat Developer Studio, the toolbar contains a speci= al panel
= - +
@@ -348,7 +348,7 @@ = - + Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules= /GettingStartedGuideforCreatingaStrutsApplication.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/Getti= ngStartedGuideforCreatingaStrutsApplication.xml 2007-05-11 16:34:48 UTC (re= v 2026) +++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/Getti= ngStartedGuideforCreatingaStrutsApplication.xml 2007-05-11 16:37:20 UTC (re= v 2027) @@ -9,16 +9,15 @@ the way demonstrating some of the powerful features of Red Hat Developer S= tudio. You will design the application, generate stub code for the application, fill in the stub codi= ng, compile the application, and run the application all from inside Red Hat Developer Studio. -Well assume that you have already launched Eclipse with Exadel Studi= o or Exadel Studio -Pro installed and also that the Red Hat Developer Studio perspective is th= e current perspective. (If not, -make it active by selecting Window/Open Perspective/Red Hat Developer Stud= io from the menu bar.) +Well assume that you have already launched Eclipse with Red Hat Deve= loper Studio installed and also that the Red Hat Developer Studio perspecti= ve is the current perspective. (If not, +make it active by selecting Window/Open Perspective/Other/Red Hat Develope= r Studio from the menu bar.) =
Starting Up = We are first going to create a new project for the application. Go to the menu bar and select File/New/Project... .= -Select Exadel Studio/Struts/Struts Project in the New Proj= ect dialog box. +Select Red Hat Developer Studio/Struts/Struts Project in t= he New Project dialog box. Click Next >. Enter StrutsHello as the project name. Leave everything else as is, and click Next >. @@ -55,7 +54,7 @@ We will keep our presentation files in this folder.= = Right-click the pages folder and select New/File/JSP... .<= /para> - 16. For Name type in inputname (the JSP ext= ension will be automatically added to the file), for Template select Struts= Form, and then click on the Finish button. + For Name type in inputname (the JSP extensi= on will be automatically added to the file), for Template select StrutsForm= , and then click on the Finish button. Right-click the pages folder again and select New/File/JSP= ... . For Name type in greeting , for Template leave as Blank, a= nd then click on the Finish button. @@ -82,11 +81,11 @@ - - path - /greeting - + path + /greeting + + name GetNameForm @@ -117,7 +116,7 @@ Lets now create a link from the inputname.jsp page to the action. On the left-hand side of the diagram in the column of icon= s, click on this icon: - 26. In the connect-the-components mode you ar= e in now, click on the /pages/inputname.jsp icon in the diagram and then cl= ick on the /greeting action. + 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. A link will be created from the page to the action. @@ -173,7 +172,7 @@ Generating Stub Coding We are done with designing the application through the diagram. No= w 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. Switch back to the diagram, by selecting the Diagram tab a= t the bottom of the editor window. @@ -205,7 +204,7 @@ Double-click GetNameForm.java for editing. = -You are looking at a Java stub class that was generated by= Exadel Studio. Now we are going to edit the file. +You are looking at a Java stub class that was generated by= Red Hat Developer Studio. Now we are going to edit the file. = Add the following attributes at the beginning of the class= : @@ -228,39 +227,44 @@ The final GetNameForm.java file should look like this: = @@ -279,29 +283,34 @@ String greeting =3D "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 =3D "getName"; -// Local Forwards -public static final String FORWARD_sayHello =3D "sayHello"; -public GreetingAction() { + = + // Global Forwards + public static final String GLOBAL_FORWARD_getName =3D "getName"; + = + // Local Forwards + public static final String FORWARD_sayHello =3D "sayHello"; + = + public GreetingAction() { + } + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws Exceptio= n { + String name =3D ((GetNameForm)form).getName(); + String greeting =3D "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 =3D ((GetNameForm)form).getName(); -String greeting =3D "Hello, "+name+"!"; -((GetNameForm)form).setGreetName(greeting); -return mapping.findForward(FORWARD_sayHello); -} -} ]]> Save the file. @@ -324,9 +333,9 @@ Input name: = Select the Visual pane of the editor. -Then, in the Exadel Palette, expand the Struts Form librar= y, select text, and drag it onto the box. +Then, in the Red Hat Palette, expand the Struts Form libra= ry, select text, and drag it onto the box. In the Insert Tag dialog box, type in name for property an= d select Finish. -In the Struts Form library in the Exadel Palette, select s= ubmit, and drag it to right after the the text box in the Visual pane of th= e editor. +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 t= he editor. Right-click the submit button and select <html:submit&g= t; Attributes from the context menu. In the Attributes dialog box, select the value field and t= ype in Say Hello! for its value. @@ -342,28 +351,28 @@ -Greeting + Greeting - -

-

- + +

+

+ ]]>
= -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 t= he editing area. +To complete editing of this file, we will use macros from the Red Ha= t Palette. This palette is a view that should be available to the right of = the editing area. -Click on the Struts Common folder in the Exadel Palette to= open it. -Position the cursor at the beginning of the greeting.jsp f= ile in the Source pane and then click on bean taglib in the Exadel Palette.= +Click on the Struts Common folder in the Red Hat Palette t= o open it. +Position the cursor at the beginning of the greeting.jsp f= ile in the Source pane and then click on bean taglib in the Red Hat Palette= . This will insert the following line at the top of the file: ]]> -Click on the Struts Bean folder in the Exadel Palette to o= pen it. +Click on the Struts Bean folder in the Red Hat Palette to = open it. Position the cursor inside the p element. -Click on write in the Exadel Palette. +Click on write in the Red Hat Palette. Type in GetNameForm for the name attribute and add a prope= rty attribute with greetName as its value. The editor should should now look like this: @@ -376,7 +385,7 @@ node and select New/File/JSP... . Type index for Name and click on the Finish button.= -On the Exadel Palette, select the Struts Common folder of = macros by clicking on it in the palette. +On the Red Hat Palette, select the Struts Common folder of= macros by clicking on it in the palette. Click on the logic taglib icon. Press the Enter key in the editor to go to the next line.<= /para> Back on the palette, select the Struts Logic folder of mac= ros. @@ -404,14 +413,14 @@ Running the Application Everything is now ready for running our applicationwithout having t= o leave Red Hat Developer Studio - by using the Tomcat engine that comes with the Red Hat Developer Stud= io plug-in. For controlling - Tomcat within Red Hat Developer Studio, the toolbar contains a panel.= + 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 pane= l.
-Start up Tomcat by clicking on the first icon from left in this = panel. (If Tomcat is +Start up JBoss AS by clicking on the first icon from left in thi= s panel. (If JBoss AS is already running, stop it by clicking on the third icon from the left a= nd then start it again. Remember, the Struts run-time requires restarting the servlet e= ngine when any changes have been made.) -After the messages in the Console tabbed view stop scrolling, To= mcat is available. +After the messages in the Console tabbed view stop scrolling, JB= oss 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. --===============0813067155312676272==--