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.
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.
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.
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.