Hello,
I have created more than one form-pages with struts. After validation i
can read the values in the Action with:
---------
HttpSession session = httpServletRequest.getSession(); DynaActionForm
PageA = (DynaActionForm) session_automatic.getAttribute("PageA");
//This is a DynaActionForm-Object in the Session
String field1 = (String) PageA.get("field1");
String textfield2 = (String) PageA.get("textfield2");
.....
DynaActionForm PageB = (DynaActionForm)
session_automatic.getAttribute("PageB");
String textfield1 = (String) PageB.get("textfield1");
String textfield2 = (String) PageB.get("textfield2");
.....
----------
All works!
Now i would like to edit one entry from the Database.
So i have to define the Sessions and after the definition i go to the
form-page. Than the fields must have the values from the Database.
But this doesn't work!!
My Code:
-------
HttpSession session = httpServletRequest.getSession(); DynaActionForm
PageA = new DynaActionForm();
PageA.set("textfield1","My Value....");
PageA.set("textfield2","My Value....");
....
DynaActionForm PageB = new DynaActionForm();
PageB.set("textfield1","My Value....");
PageB.set("textfield2","My Value....");
....
//Define a DynaActionForm-Object in the session
session.setAttribute("PageA", PageA);
session.setAttribute("PageB", PageB);
---------
This breaks at the line PageA.set().
The ERROR is "java.lang.NullPointerException"
Can you help me?
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]