• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

passing a value through hyperlink in JSP page

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A 404 has nothing to do with the parameter. The base URL is somehow wrong.
 
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. The URL is wrong. The resource which you are requesting for is not present in your project.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The wrong URL maybe due to reasons like spelling mistake and wrong physical location (different directory, wrong directory,etc).

Hope this helps :)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic