The below should be a simple working example.
Please check it yourselves, but i think it should be ok. I hope the quickstart guide will be updated.


changes at Quickstart guide

add a components.xml file to the WEB-INF\Classes directory (should go under src directory in eclipse to be copied every time after build) like :

<?xml version="1.0" encoding="ISO-8859-1"?>
<components>
</components>

-------------------------------------------------------------
Copied the file webwork.tld to the WEB-INF directory
-------------------------------------------------------------
changed the web.xml file to

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
<web-app>


<display-name>test</display-name>

<filter>
<filter-name>container</filter-name>
<filter-class>com.opensymphony.webwork.lifecycle.RequestLifecycleFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>container</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<listener>
<listener-class>com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener</listener-class>
</listener>
<listener>
<listener-class>com.opensymphony.webwork.lifecycle.SessionLifecycleListener</listener-class>
</listener>


<servlet>
<servlet-name>webwork</servlet-name>
<servlet-class>com.opensymphony.webwork.dispatcher.ServletDispatcher</servlet-class>
</servlet>


<servlet>
<servlet-name>velocity</servlet-name>
<servlet-class>com.opensymphony.webwork.views.velocity.WebWorkVelocityServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet-mapping> <servlet-name>webwork</servlet-name> <url-pattern>*.action</url-pattern> </servlet-mapping>

 <servlet-mapping>
   <servlet-name>velocity</servlet-name>
   <url-pattern>*.vm</url-pattern>
 </servlet-mapping>


<welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.html</welcome-file> </welcome-file-list>


<taglib> <taglib-uri>webwork</taglib-uri> <taglib-location>/WEB-INF/webwork.tld</taglib-location> </taglib> </web-app>

--------------------------------------------------------------------
change the xwork.xml to :

<?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="default" extends="webwork-default">
   <interceptors>
     <interceptor-stack name="defaultComponentStack">
       <interceptor-ref name="component"/>
       <interceptor-ref name="defaultStack"/>
     </interceptor-stack>
   </interceptors>

<default-interceptor-ref name="defaultStack"/>

<action name="saveForm" class="com.acme.FormAction" method="processForm">
<result name="success" type="dispatcher">
<param name="location">/form.vm</param>
</result>
<result name="missing-data" type="dispatcher">
<param name="location">/form.vm</param>
</result>
<interceptor-ref name="defaultStack"/>
</action>


 </package>
</xwork>

-----------------------------------------------------------------------------------------
The code for the FormBean and FormParameters is not included in the quickstart guide therefore for simplicity reasons i
changed the FormAction.java to :


package com.acme;
import com.opensymphony.xwork.*;

public class FormAction extends ActionSupport {

private String message = null;
private String testval = null;
public String processForm() {


message = "hello from action";
System.out.println("served");
return SUCCESS;
}


   public String getMessage() {
       return message;
   }


public void setMessage(String message) { this.message = message; }

public String getTestval() {
return testval;
}



public void setTestval(String testval) { this.testval = testval; }

}

----------------------------------------------------------------------
The web.xml file includes velocity, therefore the form.vm should be :

<html>
<head><title>Webwork Form Example</title></head>
<body>

Message: $!message
<form name="myForm" action="saveForm.action" method="POST">

<table>
       <input type=text name="testval" value="$!testval"/>
   </table>
   <input type="submit" value="Save Form"/>
</form>

</body>
</html>
----------------------------------------------------------------------------------

hope i've not made a copy/paste error :)
Leon



Jason Carreira wrote:

If someone can nail down what needs to be changed in the quickstart,
please let us know...




-----Original Message-----
From: Wayland Chan [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 10:06 AM
To: [EMAIL PROTECTED]
Subject: RE: Re: [OS-webwork] Quickstart guide ? is it missisng something



Am I the only one who thinks there is something wrong here if a new user needs to go to an external application in order to "Get Started"?





Thanks a lot, i did discover Megg and tried it. It really

helped me a

lot... Everything seams to work now..




Ciao!


Wayland Chan
email: wchanATtrekspaceDOTcom

----------------------------------------------------------
Get your free email account from http://www.trekspace.com
         Your Internet Virtual Desktop!


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________
Opensymphony-webwork mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork






-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork





------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to