Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

get method.

 
colm o'donnell
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
 
Jilesh Lakhani
Ranch Hand
Posts: 49
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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??
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!