| Author |
Navigate from one JSP to another
|
Lucky Singh
Ranch Hand
Joined: Jan 19, 2004
Posts: 125
|
|
I have a JSP which has a button. <button type= >Click Me</button> This is not part of any form but rather a stand-alone button. How do I move to B.jsp when I click this button in A.jsp?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
Pure HTML. Check out the anchor tag. (It might be a good idea to have a basic knowledge of HTML before delving off into JSP).
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
<input type="button" name="blah" onclick="document.location.href='asdf.jsp'"> or <a href="asdf.jsp"><input type="button name="blah"></a>
|
 |
Lucky Singh
Ranch Hand
Joined: Jan 19, 2004
Posts: 125
|
|
|
Thanks.
|
 |
Lucky Singh
Ranch Hand
Joined: Jan 19, 2004
Posts: 125
|
|
This is what I did- <a href="/nextpage.jsp"> <button type=submit>Order Now</button></a> Button visible and on miving the mouse over it, shows that this will navigate to nextpage.jsp. But on clicking it, getting a 404 error. /nextpage.jsp is not available. Can you help me?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
Two things: 1) Combining the a and the button tag is not a good idea. Use one or the other. 2) The href must be a valid url for the page. We can't possibly help you with your 404 with the information you have provided so far.
|
 |
Mishra Anshu
Ranch Hand
Joined: Sep 16, 2003
Posts: 224
|
|
Instead of try:-- <a href="nextpage.jsp"><input type= button>Order Now</button> </a> href="nextpage.jsp" or href="../nextpage.jsp", depends on the relative locations of the two files stored. Hope I understood you right :roll:
|
"Ignorance is bliss"
|
 |
Lucky Singh
Ranch Hand
Joined: Jan 19, 2004
Posts: 125
|
|
Thanks. The ../nextpage.jsp worked just fine.
|
 |
Vinil Mehta
Greenhorn
Joined: Aug 17, 2011
Posts: 9
|
|
|
[Thread hijack removed. Please start new topics for your own questions.]
|
Techata
|
 |
 |
|
|
subject: Navigate from one JSP to another
|
|
|