WebWork finds its Actions from its properties file. If you are working from
the WAR file the place to look for this file is under WEB-INF/classes. In
this file there is a property name "webwork.action.packages" that is set to
"webwork.examples, webwork.action.standard". This property tells WebWork
were to look for the Actions. This allows you to reference Actions with the
prefix in mind. So, if you had an action called "ProjectList" in
webwork.examples, then you could reference it by just "ProjectList" or you
can specify it with absolute the package name
"webwork.examples.ProjectList".

So, if you started your own project, you would have a properties file
similar to the one provided but with a property setting similar to the
following: "webwork.action.packages=webwork.action.standard,com.foo.action".

See inline comments as well. Refer to the documentation for more details.

-Matt

----- Original Message -----
From: "Fredrik Karlsson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 27, 2002 5:39 PM
Subject: [Webwork-user] problems w. package, WW action, structure


> I'm playing a bit with Webwork, trying to figure out how to do stuff.
> I tried to modify the iterator example provided with webwork but I seem
> to have forgotten a thing or two about packages, actions and possibly
> even more stuff...
>
> In the file d:\testapp\src\resources\web\test.jsp I have the following
> code (and more..):
>
> Array as iterator:<br>
> <webwork:action name="'action.ProjectList'" id="projekt">

just "ProjectList"

>   <iterator:subset source="projectArray" start="1">
>      <webwork:iterator>
>        <webwork:property/><br>
>      </webwork:iterator>
>   </iterator:subset>
> </webwork:action>
>
> The file d:\testapp\src\resources\web\action\ProjectList.java has this
> snippet of code (and more)
>

locate this file in src\main\webwork\examples instead of src\resources..

> package action;
>
> import webwork.action.ActionSupport;
> import java.util.ArrayList;
> import java.util.List;
> --
> public class ProjectList
>    extends ActionSupport
> {......
>    public Object[] getProjectArray()
>    {
>       return projects.toArray();
>    }
> }
>
> When I try do run test.jsp (in Jetty+JBoss by the way) I get:
> "Action 'action.ProjectList' not found" even though I have
> d:\testapp\src\resources\web in my classpath..
>
> * Have I placed the files in weird directories?
> * Have I used the package feature incorrectly?
> * Is my webwork syntax incorrect?
> * Or, is all of the above WRONG?
>
> The examples provided with Webwork are excellent but I feel that it is
> somewhat difficult to backtrace and figure out how the whole thing is
> done...
>
> Thanks /Fredrik
>
>
> _______________________________________________
> Webwork-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webwork-user
>
>



_______________________________________________
Webwork-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webwork-user

Reply via email to