• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

get method.

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am just starting with JSP and I was wondering if someone would be kind enough to help me. I want to use the get method to send a variable to the next page. I am making a website for football clubs and i have a database witht the following fields:

ClubID
ClubName
ClubManger

On the first page there is a list of clubs names. When you click on the clubs name I want it to bring you to the profile page of that club. So what i want is for when someone clicks on Arsenal, for example, their id number is sent onto the profile.php page and I can get the ClubName and ClubManager fields out of the database using the ClubID.

Please be gentle as I am only starting thanks!!

Thanks in advance,
Colm
 
Ranch Hand
Posts: 49
Python Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ahh, Simply use the Form Submit.... or URL based Parameters.... dats Simple HTML stuff..
check out with
www.w3schools.com
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Embed the value in a querystring parameter.

The querystring is separated from the rest of the URL by the '?' character.
It is a series of name/value pairs. Name and value are separated by the '=' character and the pairs are separated by the '&' character.

Example:


Notice that non alpha numeric characters have been URL Encoded (the apostrophe in your last name).
This can be done with the java.net.URLEncoder object.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Jilesh mentioned, this can also be accomplished with a form submission.



In this case the browser will take care of the encoding for you.
[ April 11, 2008: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jilesh Lakhani:
dats Simple HTML stuff..
check out with
www.w3schools.com




Jilesh,
Please use real words when posting to JavaRanch.

Thanks.
-Ben
 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is that using jsp?? can I get some full code off you if it wasn't too much trouble as I am really struggling with this. I have it working in PHP but want to change it to JSP. Shall i show you the PHP code to show you the way it is done??
 
We can walk to school together. And we can both read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic