Struts 1.2.4 Client-Side Validation Help

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top