This content has been marked as final.
Show 4 replies
-
1. Re: Personalized HelloWord in WebWork Portlet Tutorial don't
noicangi Feb 27, 2006 9:31 AM (in response to csarmientom)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.javapackage 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 Feb 27, 2006 10:04 AM (in response to 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 Feb 27, 2006 10:20 AM (in response to csarmientom)i'm a newbie :P
-
4. Re: Personalized HelloWord in WebWork Portlet Tutorial don't
nilsga Apr 10, 2006 7:17 AM (in response to csarmientom)"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