aspose file tools
The moose likes JSP and the fly likes get method. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "get method." Watch "get method." New topic
Author

get method.

colm o'donnell
Greenhorn

Joined: Apr 07, 2008
Posts: 17
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

Joined: Jul 26, 2006
Posts: 47

ahh, Simply use the Form Submit.... or URL based Parameters.... dats Simple HTML stuff..
check out with
www.w3schools.com


-Jilesh
Universe and Knowledge has no bounderies
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Apr 07, 2008
Posts: 17
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??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get method.
 
Similar Threads
Getting data in java page flow
JSP MYSQL
Connecting to MySQL
Richfaces rich:listshuffle question
SQLException: Invalid value for getInt() + scrambled columns