Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reg Struts DynaAction Form - Plz URGENT

843838Dec 20 2006 — edited Dec 20 2006
Hi , this is Praveen ..
I developed one application which ,
admin enters login username and passwords .
These credentials will be checked through database using Hibernate . After validating the credentials It enters into AddStudent page ,
I used DynaActionForm insted of ActionForms .

In my Appli .. loginForm ---> DynaActionForm
addStudentForm --->DynaActionForm
--------
If I used code Like this in LoginAction
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
 
 ActionErrors errors = new ActionErrors();
        ActionForward forward = new ActionForward();
DynaActionForm loginForm = (DynaActionForm)form;
 String un = (String)loginForm.get("username");
        String pass = (String)loginForm.get("password");
        System.out.println(" == User Name and Password ===="+un+"=="+pass);
------------
username and passwords are Properties of loginForm which is DynaActionForm .
In this Action I am getting username ,password values ,

This same concept I used in SaveStudenAction
like this
	String fn = (String)dynaActionForm.get("firstName");
							System.out.println(" ---Enter : saveUserDelegate -- fn "+fn);
 
Here firstName is userForm property which is declared in struts-config.xml , (becoz It is DynaActionForm )
Here I am not getting values


Plz Help me URGENT
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2007
Added on Dec 20 2006
6 comments
124 views