Debugging

2001-07-24 Thread Gerald Hanks

Is there anyway to output simple debugging info to a console or
something?  I need something that is consistant between my struts
components and the beans and stuff that contain all of my business
logic.

-gerald




Re: Preloading ActionForm data from database (newbie question)

2001-07-15 Thread Gerald Hanks

Klaus,

Thank you for the response.  Let me see if I can explain a little bit more
about what I have done and see if this changes your answer at all.

I have two jsp forms right now.  One is login.jsp and the other is
signup.jsp.  Each one has an associated Form and Action.  If the login
fails it goes back to the login.jsp page.  If the login succeeds, it loads
the mainmenu.jsp page.  If the signup fails it goes back to itself if it
succeeds it goes to the mainmenu.jsp page as well.

Both the login and signup when successful load the client_id into a
ClientBean along with a timestamp so that I can track how long the client
has been active (and wether or not to invalidate the session because of
inactivity).  Since this application could potentially have thousands of
active users logged in I do not want to have a lot of data hanging around
in session beans.

I would like to have the client_info data loaded from the database only
when the client needs to review or modify it.  I do not want to keep it
around for longer than the request.  From the mainmenu.jsp the client
can choose a link that goes to the clientinfo.jsp form where they can
review their client info and make changes.  The clientinfo.jsp has been
linked with the ClientInfoForm bean and ClientInfoAction to handle the
validation and saving of the modified data.  My problem is that the
ClientInfoBean that holds the data to be modified is not loaded at the
time that the clientinfo.jsp is loaded.  Because of this, there are no
values loaded into the form.  The form is blank (as if the client_info did
not exist).  I need the ClientInfoForm bean to talk to the ClientInfoBean
before the jsp page starts loading the form (so that the current data can
be loaded into the form).  Does this help out at all?

-gerald

Klaus Thiele wrote:

 hi gerald,

 i don't now if i really understand your problem.
 in my opinion, the ClientInfoForm has noting to do with your
 ClientInfoBean.

 i would prefere this (regards to the struts-sample-app):

 1) logon.jsp - LogonAction - LogonForm
 LogonForm validates the fields username and password are filled out by
 the user.
 LogonAction instantiates your ClientInfoBean and call some methods on
 it to verify if the user is already registrated (read the record from
 the database) - if not, error and back to the logon-page (or create a
 new account,).
 but if the user is registrated, put the ClientInfoBean-Object into the
 session-context  and go to the main-menu.
 2) clientinfo.jsp - Edit/SaveClientInfoAction - ClientInfoForm
 EditClientInfoAction retrieve the ClientInfoBean-Object from the
 session-context, calls some methods on it to fill the fields in
 ClientInfoForm.
 if submit is clicked, do some simple validations in
 ClientInfoForm (are the fields filled out, date's valid entered,...).
 in SaveClientInfoAction retrieve the ClientInfoBean-Object from the
 session-context, call the validation-methods on your ClientInfoBean and
 save the data, display an error,

 hope that helps
   klaus

 Am Sonntag, 15. Juli 2001 05:54 schrieben Sie:
  I started an app where I have a client login and jump to a main menu.
  From that menu the client can modify their account info.  I have a
  ClientInfoForm bean, a ClientInfoAction and a clientinfo.jsp input
  form. I have also created a ClientInfoBean which has all of the
  business logic to retrieve the clients info from the database and
  save it back out when finished.
 
  I have the ClientInfoForm doing all of the appropriate validation
  stuff and the ClientInfoAction communicates fine with the
  ClientInfoBean to save all of the data back to the database.  My
  problem is how and when to get the ClientInfoForm bean to communicate
  with the ClientInfoBean so that when the clientinfo.jsp form loads,
  the fields are properly filled in.  Is it appropriate to create a
  constructor for the ClientInfoForm so that when it is created the
  communication with the ClientInfoBean happens then or is there a more
  appropriate way?
 
  Thank you in advance,
 
  -gerald

 --
 Klaus Thiele - Personal  Informatik AG
 mailto:[EMAIL PROTECTED]

  Your mouse has moved.
   Windows must be restarted for the change to take effect.