- Make sure views.properties and
webwork.properties are in WEB-INF/classes and restart your app server maybe,
or touch web.xml to have the webapp reload.
Some other things you
can play with.
- hack
webwork.properties to have : webwork.action.packages=
xpetstore.web.webwork.actions
That will allow you to
get rid of all package path from views.properties, you can just put the
action.
So instead of
this:
myaction.action="">
you can do
this:
myaction.action="">
- Extend
ActionSupport instead of implementing Action, override doExecute instead of
execute.
-----Original
Message-----
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Brian McSweeney
Sent: Monday, February 17, 2003 7:45
AM
To:
[EMAIL PROTECTED]
Subject: [OS-webwork] Can't see my
success view :-(
I'm having a bit of trouble
getting webwork up and running still.
I have a basic action that I've
hacked from the xdoclet webwork example,
package
xpetstore.web.webwork.actions;
/**
* Simple WebWork
action.
*
*
@webwork.action
*
name="myaction"
*
error="error.jsp"
*
input="input.jsp"
*
success="success.jsp"
*/
public class Hello implements
webwork.action.Action {
/**
* This
method is where the logic of the action is executed. Parameters are
passed
* by calling set-methods, or by
implementing the ParameterAware interface.
*/
public String execute()
{
// Simple. Very
simple.
return
SUCCESS;
}
/**
* @webwork.command
* error="error.jsp"
* name="add"
* success="success.jsp"
*/
public String doCmd()
{
return
SUCCESS;
}
}
my xdoclet code generates the
following views.properties file:
# Action
views
myaction.action="">myaction.success=success.jsp
myaction.error=error.jsp
myaction.input=input.jsp
myaction.add.action="">myaction.add.success=success.jsp
myaction.add.error=error.jsp
However, when I go to my input.jsp
file (which is essentially only a
<jsp:forward
page="xpetstore.web.webwork.actions.Hello.jsp" />
I get the following
error
No view for result [success]
exists for action [xpetstore.web.webwork.actions.Hello])
Now I know that success.jsp works
because I can go to it directly.