You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anant Sagar <an...@rapideffect.com> on 2002/03/02 04:48:22 UTC

Re:How to distinguish calls to Action

Dear All ,
I m new to struts .I m facing one more problem.

I have one form which is doing two function
1. ) to register new client
2.)  to edit the existing clients data.
There are 5 fields in all first one being client id . When initially page is
requested ,the page should show list of ids ( from DB )as drop down menu
with New Client as its first element.All other fields should be kept blank
so that the necessary information can be filled in for that new client. All
other fields are mandatory. If user clicks save it saves the new clients
details and shows thankyou page .If user select one of the existing client
ids from drop down menu
it should call some action to populate the other 4 fields from database.User
can edit the data of existing client and again save .

My problem is :
I have made one Action class which has two mappings as below.(Action class
internally has 3 different task -NewClient,ExistingClient,Save )
 <action    path="/clientregnew"
     type="com.rapideffect.pms.server.ClientRegistrationAction" >
 </action>
 <action    path="/clientreg"
     type="com.rapideffect.pms.server.ClientRegistrationAction"
     name="clientReg"
     scope="request"
     input="/client.jsp" >
 </action>

First mapping i m using for initially opening client.jsp page It calls
Action class explicitly instantiate ClientForm bean ,get clients ids from DB
and forward request to client.jsp . When user selects client ids from
dropdown list( onchange event ) i m using second mapping to call Action
class, But it does'nt call Action class as it calls ClientForm bean's
validate method, finds mandatory fields( 4 other fields ) are empty and
returns the page with error.

If you have any suggetion pls let me know.

THANKS in advance

Anant Sagar







--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>