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.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3926542#3926542

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3926542


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to