Hello,
I am building a Struts2 application using Hibernate and after the user navigates through the pages, they follow a link:
Basically this brings up a form where the user will modify an existing record on a database. The record's primary key, (id) is provided as a parameter in the URL the user clicked on.
My problem is retrieving and storing this request parameter in the
jsp page which contains the form. So far my form looks like this:
For a reason that I am not able to understand, the Primary Key field on the form, instead of being pre-populated, it is blank, waiting for the user to enter the value.
I know it must have something to do with how I use the
struts tags, or the ognl expression, but so far, I was not able to solve this. The consequences is that instead of doing an update, the action ends up doing a new insert. The action code checks if the id is null and if it is then a new insert occurs, if the id is not null, then an update should take place:
So, how do I use a struts2 tag in a jsp to retrieve request parameters from the url? i believe that this is the root cause of my problem.
Thanks in advance for any help.