AFAIK you also need to create an actions.xml file that is in your classpath. Save the following file in actions.xml in WEB-INF/classes.
<actions> <action name="ProjectList" alias="ProjectList"> <!--<view name="input">/path/to/input/file.jsp</view>--> </action> </actions> Then your action should work. Cheers, Scott Fredrik Karlsson wrote: > Hi Matt (and others)! > > I think you misunderstood me, I wanted to create my own small > application by modifying some existing code, not add some of my own > stuff to the webwork examples. > > I still haven't managed to get this to work so I'll try to explain it > better this time. > > I have a simple jsp-file that contains the following code: > > <webwork:action name="'ProjectList'" id="projekt"> > <iterator:subset source="projectArray" start="1"> > <webwork:iterator> > <webwork:property/><br> > </webwork:iterator> > </iterator:subset> > </webwork:action> > > The function projectArray is in the file > e:\testapp\src\resources\web\action\ProjectList.java > > If I use webwork.action.packages=webwork.action.standard, action > and have e:\testapp\src\resources\web in my classpath, shouldn't this > work? > > I get "IllegalArgumentException: Action 'ProjectList' not found" > > Are there any examples other than the ones bundled with WW available? > If not, I would greatly appreciate if someone could mail me a small, > simple sample that doesn't use webwork.examples. > > Thanks /Fredrik ([EMAIL PROTECTED]) > > From: "Matt Baldree" <[EMAIL PROTECTED]> > To: "Fredrik Karlsson" <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> > Subject: Re: [Webwork-user] problems w. package, WW action, structure > Date: Sat, 27 Apr 2002 18:42:10 -0500 > > 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.acti > on". > > 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 > > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] > _______________________________________________ > Webwork-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/webwork-user > -- Scott Farquhar :: [EMAIL PROTECTED] Atlassian :: http://www.atlassian.com Supporting YOUR J2EE World _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ Webwork-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webwork-user