Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating multiple buttons in a form

 
Amar Deep Singh Chaudhary
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amar Deep Singh Chaudhary
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic