I am having a problem with my web page when trying to forward to another page using mapping.findForward.
I have a form which I want to, when submited, go back to the same page.
This is fine, I define the same page in my config, and call it. It then goes to the page.
The problem I am having, is that it doesnt seem to refresh the page at all. It seems static.
Explination of the webpage:
I have a html:select which is dynamically filled with values from a database. When the user selects one and submits, the value is removed from the database.
Everytime the user visits this page, the values are read from the database, so when I use mapping.findForward to go back to the page, it should refresh? Because it doesnt.
When I chose a second one to remove, the one I removed first is THEN removed, and the one I just removed stays there. Makes me think that because its still selected within the box, it cannot remove it until refreshed. I know that it is doing its job on the database every time, but its not showing it.
I will paste code if needed, but I have a feeling its something small I am missing in how it works.
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.
There's no need to define a separate forward, just use mapping.getInputForward() (or whatever it's called; it's been a long time since I've done Struts 1 work).
David Newton wrote:There's no need to define a separate forward, just use mapping.getInputForward() (or whatever it's called; it's been a long time since I've done Struts 1 work).
Good point. It works just the same, but I agree that is easier so thank you. But it still doesnt solve my problem. It does the same thing.
Make sure caching is turned off. Make sure the value is being removed from the database when you think it is. Make sure you're doing a redirect (not sure if you need to define a forward element in order to do that or not; can't remember).
I think your problem is in request.setAttribute ( "usersCompanysList" usersCompanysList);
you do something like: request.setAttribute ( "UserEditForm" UserEditForm), where UserEditForm has a property (String []) containing the list you want to show