When the form is submitted I check to see if todo equals ADD and save the value in ssn.
Works ok but when the page is refreshed or another portlet is clicked or submitted, todo still equals ADD and ssn still has a value even tho it is blank on the screen. I think the parameters are stored in several URLs on the page so they hold their value. So I end up with the same ssn bein added many times. How can I prevent this or not have those parameters in URLs?
Gary, You have a few ways of dealing with this: 1) Use <form action="post". This won't stop the user from submitting twice, but at least they will be prompted. I suggest doing this anyway, even if you adopt another solution. 2) Store a token in the session when this page is displayed. When the user adds the SS#, delete the token. Only add if the token is there. 3) SS# is unique. You could do a query to see if the SS# is already in your database. [ November 08, 2004: Message edited by: Jeanne Boyarsky ]
Welcome to JavaRanch! I've submitted a post without being done quite a few times myself. In fact, it happened right in this thread. Note that we have an edit button (the white rectangle with a pencil) for if this happens in the future.
Since there isn't anything Oracle specific about this question, I'm moving it to our Servlets forum. (This problem occurs all the time, not just in portlets.)