Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

old request when submit !??!  RSS feed

 
Eivind Rasmussen
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'll do my best to explain my problem:
I submitt this form by pressing the submit-button accept.
( The form: )
<----------------------------------THE FORM-------------------->
<%
System.out.println("<<<<<<<<<TESTING CCC>>>>>>>>>");
session.setAttribute("profileFocused",cProfileFocused);
if(cProfileFocused.getTlfnumber() != null ) { %>
<form method="post" action="profilemoderator.jsp?<%=String.valueOf( cCalendar.getTime().getTime() )%>">
<table>
<tr>
<td>
<table cellpadding="10" align="left">
<tr>
<td>
<table align="left" valign="top" border="4" width="600">
<tr>
<td colspan="2"><b><%=cProfileFocused.getNick()%> (<%=cProfileFocused.getGender()%> <%=cProfileFocused.getAge()%> </b> wants gender: <%=cProfileFocused.getWantedGender()%></td>
</tr>
<tr>
<td rowspan="2" width="30%" align="center"><%= (cProfileFocused.getHasImage() == null)?"no picture":"<img src=\"../wap/images/accepted/"+cProfileFocused.getHasImage()+"\""%></td>
<td height="70" align="center"><i><%=cProfileFocused.getProfiletext()%></i></td>
</tr>
<tr>
<td>
<textarea name="edited" cols="40" rows="5"><%=cProfileFocused.getEditedProfiletext()%></textarea>
<%
System.out.println("<<<<<<<<<TESTING EEE"+cProfileFocused.getEditedProfiletext()+">>>>>>>>>");
%>
</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<input type="submit" name="reject" value=" Reject "/>
<br>
<input type="submit" name="accept" value=" Accept"/>
</td>
</tr>
</table>
</form>
<%}
System.out.println("<<<<<<<<<TESTING DDD>>>>>>>>>");
%>
<-------------------------------------------------------------->
And this is what I do with the submit:
<----------------------THE ACTION WHEN RECIEVING THE SUBMIT----------->
if( request.getParameter("accept") != null ) {
cProfileFocused = ((sms3.game.match.feed.ProfileObject)session.getAttribute("profileFocused"));
String cEditedText = request.getParameter("edited");
if( cProfileFocused != null && cProfileFocused.getTlfnumber() != null ) {
sms3.game.match.feed.ProfileObject cTmpRunner= cProfileAccepted;
while( cTmpRunner != null && cTmpRunner.next != null ) {
if( cTmpRunner.next.getTlfnumber().equalsIgnoreCase(cProfileFocused.getTlfnumber()) ) {
cTmpRunner.next = cTmpRunner.next.next;
}
cTmpRunner = cTmpRunner.next;
}
session.setAttribute("profileFocused", null);
cProfileFocused.setEditedProfiletext(cEditedText);
cProfileFocused.next = cProfileAccepted.next;
cProfileAccepted.next = new sms3.game.match.feed.ProfileObject(cProfileFocused);
cProfileAccepted.next.next = cProfileFocused.next;
session.setAttribute("accepted",cProfileAccepted);
cProfileFocused = new sms3.game.match.feed.ProfileObject();
}
}
<----------------------------------------------------------------->
And this works just fine, UNTILL I press the submit-button "many times really fast". What happens then is that I recieve the rigth sessionAttribute(((sms3.game.match.feed.ProfileObject)session.getAttribute("profileFocused"))
, but the old
request-Parameter(String cEditedText = request.getParameter("edited") .
Hope I've managed to explain this..
Can anybody help me?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!