Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2007, 02:48 AM
Member
 
Join Date: Apr 2007
Location: Pennsylvania,USA
Posts: 46
sandor is on a distinguished road
1 form 2 servlets
I have one HTML form, can I have two submit buttons that send the values in the form to two separate servlets?
tia
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-03-2007, 03:28 AM
Member
 
Join Date: Apr 2007
Location: USA
Posts: 50
derrickD is on a distinguished road
Yes, this can be done but don't use a submit. Just use a regular button and write a JavaScript function that gets called onclick() that sends the request to the appropriate URL mapped to the appropriate servlet.
Another option would be to send the request to the same servlet, but let the servlet delegate to an appropriate action based on the value of the submit request parameter. But, I hate to use an if statement and conditional logic if not needed.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-22-2008, 11:47 AM
Member
 
Join Date: Jan 2008
Posts: 2
loveshore is on a distinguished road
Sandor,
As 'derricD' mentioned, submit is not a good option here. You can have two separate command buttons instead of submit. On button click you can call a javascript method, specify the servlet path as follows

document.all.form.attributes["action"].value = "\your servlet path here";
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Servlets kondalrao Java Servlet 0 04-14-2008 12:12 PM
Deploying Servlets gapper New To Java 2 01-17-2008 01:43 PM
servlets or jsp krishnapal Advanced Java 1 12-13-2007 03:31 PM
Servlets nagaroopanandha Advanced Java 1 08-07-2007 03:09 PM
Introduction to Servlets JavaForums Java Blogs 0 08-04-2007 03:24 AM


All times are GMT +3. The time now is 09:14 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org