Re: Add an actionListener ActionEvent in jsp
- From: "Bjorn Abelli" <bjorn_abelli@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Mar 2006 18:08:34 +0200
Newbie,
I understand that you're a newbie, as you have missed an important
difference between JSP and "plain" applications.
Im trying to add an actionListener ActionEvent to a submit button in
jsp and don't know how to go about it.
JSP renders HTML-pages to be sent to the browser on the client side, and
responds to requests done to the server. This makes it impossible to add any
meaningful Java-code to be executed on the client-side.
What you usually do, is simply to respond to the submitted request. This
could e.g. be another page, or the same page:
<form method="post" action="somePage.jsp">
....and then in somePage.jsp, handle any parameters you've recieved.
String what = request.getParameter( "literal string of field name");
if ( what.equals("something") ) {
// Do whatever...
}
// Bjorn A
-------------
Get FREE newsgroup access from http://www.cheap56k.com
.
- References:
- Add an actionListener ActionEvent in jsp
- From: lynch_susan
- Add an actionListener ActionEvent in jsp
- Prev by Date: Input/Output program Compiles but doesn't run
- Next by Date: A question about a generic method
- Previous by thread: Add an actionListener ActionEvent in jsp
- Next by thread: Re: Add an actionListener ActionEvent in jsp
- Index(es):