| Author |
Which is the best approach for URL creation
|
zahid zubair
Ranch Hand
Joined: Aug 29, 2009
Posts: 32
|
|
Hi,
I need to understand the best approach to form a URL. Right now I have two approaches,
or
I can use a pattern to achieve the same.
Can you tell me which is the best approach to follow? And it would be really helpful to know more approaches to this URL generation.
Thanks in Advance...
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16482
|
|
I don't know what you mean by a "pattern", but in any case neither of them is the best approach (note that your first approach puts too many slashes between the host and path parts, for example). Here's the best approach:
|
 |
zahid zubair
Ranch Hand
Joined: Aug 29, 2009
Posts: 32
|
|
Hi Paul, Thanks for your suggestion.
I don't know what you mean by a "pattern"
I was actually referring to using Message Formatter (java.text) for this.
I have one problem with your suggestion. The code you mentioned above will be effective if it runs only a few times. But in my case, it runs more than 100 times per minute; and when each time the code runs, it generates different jsp names (This is more of a business logic - so do not worry about why different names for a jsp ).
So, creating URL object for each jsp name does not seems to be a better approach. Please let me know if you have any other thought?
Regards,
Zahid
|
 |
 |
|
|
subject: Which is the best approach for URL creation
|
|
|