Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31341 > unrolled thread

[JSP] Request contains data from input button which doesn't exist any more

Started byPeter Müler <user@example.net>
First post2015-03-20 23:42 +0100
Last post2015-03-20 23:42 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer


Contents

  [JSP] Request contains data from input button which doesn't exist any more Peter Müler <user@example.net> - 2015-03-20 23:42 +0100

#31341 — [JSP] Request contains data from input button which doesn't exist any more

FromPeter Müler <user@example.net>
Date2015-03-20 23:42 +0100
Subject[JSP] Request contains data from input button which doesn't exist any more
Message-ID<mei7p4$qtk$1@news.albasani.net>
I have the following problem: sometimes the JSP page shall show a button 
(at state==0).
When the button is pressed the state changes and the button shall not 
occur anymore.
The code below works as desripted.
But when I reload the page the request still contains data of the button 
which doen't exists anymore. Also the introduction of a hidden button 
dosn't change anything.
How can I get the information that the button is truly pressed?



String myButton = request.getParameter( "MyButton" );
if (myButton != null && myButton.equals("Ok")) {
	// code below is being executed after "MyButton" is pressed and each 
time the page is reloaded
	storeState( 1 );
	out.println( "<input type=\"hidden\" name=\"MyButton\" 
value=\"hidden\"/>" );
	// Do something
} else if ( state == 0 ) {
	out.println( "<input type=\"submit\" name=\"MyButton\" value=\"Ok\"/>" );
}

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web