User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 402,917 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,241 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 608 | Replies: 5 | Solved
Reply
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

handling button events from JSP

  #1  
Jul 23rd, 2008
Pl. help in handling button events in JSP like calling a servlet on Button click or executing java code.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 108
Reputation: Thirusha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 12
Thirusha Thirusha is offline Offline
Junior Poster

Re: handling button events from JSP

  #2  
Jul 24th, 2008
well u can submit a form from the onclick event on a button element.
with the form action being the file name or serlvet, or u could have a struts action, i would go with the struts action.
Reply With Quote  
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Re: handling button events from JSP

  #3  
Jul 28th, 2008
What to do if more than 1 buttons are there??Plz help in that case..!
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,242
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 10
Solved Threads: 270
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: handling button events from JSP

  #4  
Jul 28th, 2008
Originally Posted by jeetudaljit View Post
Pl. help in handling button events in JSP like calling a servlet on Button click or executing java code.

Originally Posted by jeetudaljit View Post
What to do if more than 1 buttons are there??Plz help in that case..!

Description of the problem in both cases is inaccurate. Please provide better description and supporting examples of coding
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Jul 2008
Posts: 16
Reputation: jeetudaljit is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jeetudaljit jeetudaljit is offline Offline
Newbie Poster

Re: handling button events from JSP

  #5  
Jul 29th, 2008
I want to execute a particular block of code if button1 is clicked and another set of code if button2 is pressed. Plz help in that case. for example.. Login and Sign up are two buttons on a jsp page.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,242
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 10
Solved Threads: 270
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: handling button events from JSP

  #6  
Jul 29th, 2008
For that you choose very bad example as I can do it in least two ways and it will have nothing to do with JSP scriplets
  • Each button in its own form where button click will trigger different action
  • Two images of buttons working as links, once you click on one of them you go to different page
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JSP Forum

All times are GMT -4. The time now is 4:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC