This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes passing a value through hyperlink in JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "passing a value through hyperlink in JSP page" Watch "passing a value through hyperlink in JSP page" New topic
Author

passing a value through hyperlink in JSP page

vady williams
Greenhorn

Joined: Jul 29, 2012
Posts: 1
I have a very simple jsp 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:

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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

A 404 has nothing to do with the parameter. The base URL is somehow wrong.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Vishal Baid
Ranch Hand

Joined: Jul 18, 2012
Posts: 36
Yes. The URL is wrong. The resource which you are requesting for is not present in your project.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2561
    
    2

The wrong URL maybe due to reasons like spelling mistake and wrong physical location (different directory, wrong directory,etc).

Hope this helps :)


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: passing a value through hyperlink in JSP page
 
Similar Threads
reagarding jsp problem
null is coming...when I set a HashMap in request object?
making all fields empty when i make new transaction
Cannot set attribute in request in jsp
getting the URL for the calling jsp page?