Hello forum,
I'm new to
struts and want to develop a form, where an internetuser can leave a comment to an article. Just like most sides, an image with an text is displayed, the text has to be written into an inputfield before the comment is commited in order to be saved.
When an user puts in no text or a wrong one, a errormessage is displayed, the old image is deleted and an new one is created and shown to the user. His input still stays in the fields.
I proof the correctness of the
word in the validate-Method of the ActionForm and it works fine.
Now I've the following problem:
If the user puts in the correct text, the comment is saved and the side is displayed again including his comment.. But also all the input of the form should be erased. But for some reason, its not and the validate method is called again and since there is a new wordvarifyingimage and a new text to be inserted, it throws an error which is displayed again. Also, all the input of his last message is present!
So, I guess I miss a big point about the ActionForm handling. Why is the ActionForm called twice and why doesn't it erase the old input? I try to do this in the Action class after saving the comment, setting all the formparameters to "" or null.
Can anybody give me a hint?
Would be a big big help since I've not found anything googling about this issue.
If you need code, just tell me which part I put in here (ActionForm, Action, struts-config or jsp-file)
Thanxs in advance,
strutsnewbytopro