4 Replies Latest reply on Apr 10, 2006 7:17 AM by nilsga

    Personalized HelloWord in WebWork Portlet Tutorial don't sho

    csarmientom

      Hello all:
      I have jboss app server with portal 2.2.1 RC2 bundled, everything is ok with the portal, i test the WebWork Portlet Tutorial, the first part work ok (show me the Hello World) but when i create a simple form in a jsp and display a result page, the result page don't show me the input text , only the word "Hello"
      Somebody know what could be wrong?
      Thanks!
      Claudia

        • 1. Re: Personalized HelloWord in WebWork Portlet Tutorial don't
          noicangi

          hola, take a look to the code,
          here the right code that makes the portlet function:

          xwork.xml

          <?xml version="1.0" encoding="ISO-8859-1"?>
          <!DOCTYPE xwork PUBLIC
           "-//OpenSymphony Group//XWork 1.0//EN"
           "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
          <xwork>
           <include file="webwork-default.xml" />
          
           <package name="view" extends="webwork-portlet-default"
           namespace="/view">
           <action name="index"
           class="com.opensymphony.xwork.ActionSupport">
           <result name="success">/WEB-INF/pages/view/helloWorld.jsp</result>
           </action>
           <action name="helloWorldInput"
           class="com.opensymphony.webwork.portlet.tutorial.HelloWorldAction">
           <result name="success">/WEB-INF/pages/view/helloForm.jsp</result>
           </action>
           <action name="helloWorld"
           class="com.opensymphony.webwork.portlet.tutorial.HelloWorldAction">
           <result name="success">/WEB-INF/pages/view/helloWorld.jsp</result>
           </action>
           </package>
          </xwork>


          helloworldaction.java
          package com.opensymphony.webwork.portlet.tutorial;
          
          import com.opensymphony.xwork.ActionSupport;
          
          public class HelloWorldAction extends ActionSupport {
           private String firstName;
           private String lastName;
          
           public String getFirstName() {
           return firstName;
           }
          
           public void setFirstName(String firstName) {
           this.firstName = firstName;
           }
          
           public String getLastName() {
           return lastName;
           }
          
           public void setLastName(String lastName) {
           this.lastName = lastName;
           }
          }


          helloform.jsp
          %@ taglib uri="/webwork" prefix="ww" %>
          <H2>Ingresa tu nombre</H2>
          <ww:form action="helloWorld" method="POST">
           <ww:textfield label="First name" name="firstName" value="%{firstName}"/>
           <ww:textfield label="Last name" name="lastName" value="%{lastName}"/>
           <ww:submit value="Say hello!"/>
          </ww:form>

          helloworld.jsp
          <%@ taglib prefix="ww" uri="/webwork" %>
          <H2>Hello
          <ww:property value="firstName"/>
          <ww:property value="lastName"/>
          </H2>
          <a href="<ww:url action="helloWorldInput"/>">Back to form</a>


          thats all, check out that the xml files have the same code that the tutorial and the helloform.jsp has the code i post ;) hope it helps you.


          • 2. Re: Personalized HelloWord in WebWork Portlet Tutorial don't
            csarmientom

            Thanks for your help!! now it works perfectly
            Could be a good idea modified the tutorial for newbies
            Claudia

            • 3. Re: Personalized HelloWord in WebWork Portlet Tutorial don't
              noicangi

              i'm a newbie :P

              • 4. Re: Personalized HelloWord in WebWork Portlet Tutorial don't
                nilsga

                 

                "csarmientom" wrote:
                Thanks for your help!! now it works perfectly
                Could be a good idea modified the tutorial for newbies
                Claudia


                Hi Claudia!

                Which part(s) of the tutorial would you like to be modified? I would really like some feedback to improve the tutorial.

                Regards,

                Nils-H