GeeCON Prague 2014*
The moose likes Struts and the fly likes Loading Data on Page load. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Loading Data on Page load." Watch "Loading Data on Page load." New topic
Author

Loading Data on Page load.

Jobin Mathew
Ranch Hand

Joined: Oct 17, 2006
Posts: 83
Hi,
I want to show some data in a jsp page using structs.
Let, It is a page to view user profile. No editing, just showing the details. SO no need of writing its form bean. Also I am navigating to this page by a hyperlink. So how can I load the data. Where do I write the code to initialize the DTO. Or please give me the correct steps for that.

Thanks in advance.
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
would be nice if you choose a correct name as we all do here...
[ October 24, 2006: Message edited by: Jan Groth ]
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
you do not accept private messages, so i cannot answer you privately.

the answer to this question of yours should explain our point...

cheers,
jan
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Jo,

I know it seems like everyone is badgering you about this, but it really is an important part of the JavaRanch culture to give your real name, or at least give us a name that we can believe is your real name.

I'm afraid this policy is not optional. Failure to comply could cause your profile to be deleted without warning.


Merrill
Consultant, Sima Solutions
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Jobin,

Thanks for taking the time to change your profile name. However, you're not quite there yet. The JavaRanch naming policy states that your profile must have a first and last name. If you for some reason just don't want us to know your last name, then make one up. All the policy says is that it has to be a believable last name.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I would still use a form bean (probably, it depends somewhat on what your DTO looks like and how much formatting you would need to do on the data). Say I had the form bean UserForm that had properties id, name, and age. I would create an action named DisplayProfile that would be configured to use UserForm. The URL would pass in the needed id (DisplayProfile.do?id=562). In the execute method I would 1) cast form into UserForm, 2) get the id value from the UserForm, 3) pass the id into my business layer to retrieve the data, 4) populate the name and age fields on the UserForm, and 5) return the "success" forward.

- Brent
 
GeeCON Prague 2014
 
subject: Loading Data on Page load.