View Single Post
  #2 (permalink)  
Old 05-15-2008, 09:22 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 228
Eku is on a distinguished road
Here is a Sample.

This Code is in your JSP
Code:
<form action="Yourservlet?action=ButtonClicked" method="post"> <%-- Your Code Here --@> <input type="submit" value=" Ok " /> </form>
This Code is inside Yourservlet.java

Code:
//Inside your servlet String action = request.getParameter("action"); try{ if (action.equalsIgnoreCase(null)){ //Your error Handler }else if (action.equalsIgnoreCase("ButtonClicked")) { // Here is where the code that will run if the button is clicked } else { //Your Default operation } } catch (Exception A) { //Another Error Handler ^_^ }
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
Reply With Quote