File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Creating multiple buttons in a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Creating multiple buttons in a form" Watch "Creating multiple buttons in a form" New topic
Author

Creating multiple buttons in a form

Amar Deep Singh Chaudhary
Ranch Hand

Joined: Dec 26, 2006
Posts: 49
hi ranchers !

i want a to creat a jsp page in which i can place different buttons which are targeted to different pages.how i can do it please give any suggestion regarding this is i need to use the swing code in that jsp to do this or there is another method please help.


AMAR DEEP CHAUDHARY
"A thinking mind never dies"


"A thinking mind never dies"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

AMAR DEEP SINGH CHAUDHARY, please do all our eyes a favor and change your display name to mixed or lowercase. The all uppercase, especially in so long a name, is quite jarring!

With regards to your question, you can never use Swing code in a JSP so that's never an option to achieve any goal.

You can place as many HTML submit buttons on your form as you'd like. Are you having a specific issue?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by zh ro:
Use javascript :
<input type="button1" value="button" onc lick="widow.location.href="one page">
<input type="button2" value="button" oncli ck="widow.location.href="another page">


"zh ro",
Welcome to JavaRanch!

We're pleased to have you here with us in the JSP forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Amar Deep Singh Chaudhary
Ranch Hand

Joined: Dec 26, 2006
Posts: 49
hi
ranchers as some one answered for my question regarding using swing functions in jsp that we can't do it.But i have one personal experience of doing this one.
the function which i used is JOptionPane.ShowMessageDialog(); in the jsp page and it works fine as expected.Then why we can't use Swing Functions in Jsp.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Originally posted by Amar Deep Singh Chaudhary:
But i have one personal experience of doing this one.
the function which i used is JOptionPane.ShowMessageDialog(); in the jsp page and it works fine


You may think that it is working fine, but it isn't. Try hitting your JSP from a different machine than the server is running upon to see how not fine this is.
[ April 06, 2007: Message edited by: Bear Bibeault ]
 
 
subject: Creating multiple buttons in a form
 
Similar Threads
Adding parameter to the url
which button is clicked
Question on dynamically generated radio buttons
greyed buttons
link another jsp page when button clicked- how- help urgent