Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007, 06:08 PM
Member
 
Join Date: Aug 2007
Posts: 2
Rep Power: 0
jjsaw5 is on a distinguished road
Default 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
  #2 (permalink)  
Old 08-14-2007, 11:22 PM
Member
 
Join Date: Aug 2007
Posts: 25
Rep Power: 0
Josiah.Haswell is on a distinguished road
Default
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, 05:43 PM
Member
 
Join Date: Aug 2007
Posts: 2
Rep Power: 0
jjsaw5 is on a distinguished road
Default
what do you think about about using the String.split() method?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

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

BB 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 02:29 PM
Applets with parameters JavaForums Java Blogs 0 02-12-2008 12:10 PM
Hiding parameters from URL Saurabh321 New To Java 0 02-05-2008 12:43 PM
Alphabetizing carderne New To Java 3 11-07-2007 07:21 AM
get parameters in jsp cecily JavaServer Pages (JSP) and JSTL 1 08-05-2007 04:29 AM


All times are GMT +2. The time now is 03:55 AM.



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