File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Make it so: Java DB Connections & Transactions
this week in the
passing a value through hyperlink in JSP page
Joined: Jul 29, 2012
Jul 29, 2012 20:50:14
I have a very simple
page first.jsp that gives reference to so many other jsp pages through hyperlink. i am trying to pass a value through the hyperlink in first.jsp and retrieve it in second.jsp using request.getparameter(). i used:
<a href="second.jsp?value=1">Second JSP</a>
and in the second.jsp page i used
alert( "value = " + <%= request.getParameter("value") %>);
but when i try to run the code and click on Second JSP i get a 404 page not found error for :second.jsp?value=1 Please help
P.S i know scriplets are not the correct way of doing but this is just a simple one and since i am new to coding i would like to try this first
Author and ninkuma
Joined: Jan 10, 2002
Jul 29, 2012 22:25:39
A 404 has nothing to do with the parameter. The base URL is somehow wrong.
Asking smart questions
Books by Bear
Joined: Jul 18, 2012
Jul 29, 2012 23:38:00
Yes. The URL is wrong. The resource which you are requesting for is not present in your project.
Joined: Jun 06, 2007
Jul 30, 2012 01:27:59
The wrong URL maybe due to reasons like spelling mistake and wrong physical location (different directory, wrong directory,etc).
Hope this helps :)
Asking Good Questions
I agree. Here's the link:
subject: passing a value through hyperlink in JSP page
reagarding jsp problem
Cannot set attribute in request in jsp
making all fields empty when i make new transaction
null is coming...when I set a HashMap in request object?
getting the URL for the calling jsp page?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015