Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading Data on Page load.

 
Jobin Mathew
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic