P
pbergan
I'm trying to get client side validation working in Struts 1.2.4 (also
using tiles) and have a question. I have an action
<action
path="/user"
type="com.cmd.starfill.access.UserAction"
name="userForm"
scope="request"
parameter="action" >
<forward name="default" contextRelative="true"
path="access.viewUser"/>
<forward name="done" contextRelative="true"
path="access.listUsers" redirect="true"/>
<forward name="viewUser" contextRelative="true"
path="access.viewUser"/>
<forward name="editUser" contextRelative="true"
path="access.editUser"/>
</action>
My form is
<form-bean
name="userForm"
type="com.cmd.starfill.access.UserForm"/>
I have a listing page that has a link to "/users.do?userName=XXX" which
takes me to the "view" a user screen. When the the "Edit" button is
clicked the "/user" action is called again to forward to the "edit" a
user screen. The edit screen is the only screen that includes the
onsubmit="validateUserForm(this);".
When I go to the "view" screen I get an error saying there is no "input
parameter in the /user action mapping". If I add the input parameter
(see below), I end up going to the "edit" screen rather than the "view"
screen.
Do I have to create separate form-beans and actions for each mode? View
and Edit?
My original approach worked in Struts 1.1. Can anyone tell me what I'm
doing wrong?
using tiles) and have a question. I have an action
<action
path="/user"
type="com.cmd.starfill.access.UserAction"
name="userForm"
scope="request"
parameter="action" >
<forward name="default" contextRelative="true"
path="access.viewUser"/>
<forward name="done" contextRelative="true"
path="access.listUsers" redirect="true"/>
<forward name="viewUser" contextRelative="true"
path="access.viewUser"/>
<forward name="editUser" contextRelative="true"
path="access.editUser"/>
</action>
My form is
<form-bean
name="userForm"
type="com.cmd.starfill.access.UserForm"/>
I have a listing page that has a link to "/users.do?userName=XXX" which
takes me to the "view" a user screen. When the the "Edit" button is
clicked the "/user" action is called again to forward to the "edit" a
user screen. The edit screen is the only screen that includes the
onsubmit="validateUserForm(this);".
When I go to the "view" screen I get an error saying there is no "input
parameter in the /user action mapping". If I add the input parameter
(see below), I end up going to the "edit" screen rather than the "view"
screen.
Do I have to create separate form-beans and actions for each mode? View
and Edit?
My original approach worked in Struts 1.1. Can anyone tell me what I'm
doing wrong?