Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007, 08:08 PM
Member
 
Join Date: Aug 2007
Posts: 2
jjsaw5 is on a distinguished road
alphabetizing parameters
Hello,

I am very new to Java and my knowledge of it is VERY limited. I have been asked to try and develope a Java method that will take the URL string and alphabetizes the parameters. I have no idea where to start or even where to look to try and help myself out. Any help would be greatly appreciated.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-15-2007, 01:22 AM
Member
 
Join Date: Aug 2007
Posts: 25
Josiah.Haswell is on a distinguished road
The String class has many useful methods for this sort of thing. I don't want to do your homework for you, but here are some pointers:

URL parameters are easy to find in a URL, e.g. prefix.yoururl.whatever<b>?param1=value1&param2=va lue2&param3=value3</b>


Try

1. Converting the URL to a string.
2. Clipping the string at the question-mark, to retain just the parameter list.
3. Using the indexOf method (for example, you could also use regular expressions to great effect here) to split the remainder into parameters and values.

Good Luck,

Joe
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-15-2007, 07:43 PM
Member
 
Join Date: Aug 2007
Posts: 2
jjsaw5 is on a distinguished road
what do you think about about using the String.split() method?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
NULL Value Of parameters riders JavaServer Pages (JSP) and JSTL 0 03-14-2008 04:29 PM
Applets with parameters JavaForums Java Blogs 0 02-12-2008 02:10 PM
Hiding parameters from URL Saurabh321 New To Java 0 02-05-2008 02:43 PM
Alphabetizing carderne New To Java 3 11-07-2007 09:21 AM
get parameters in jsp cecily JavaServer Pages (JSP) and JSTL 1 08-05-2007 06:29 AM


All times are GMT +3. The time now is 10:26 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org