This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes using double quote in passing parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "using double quote in passing parameter" Watch "using double quote in passing parameter" New topic
Author

using double quote in passing parameter

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 374
When I invoke a servlet from URL, should or should not I use double quote to wrap the parameter ? for example,

http://myservlet/myaction?param1="abc"¶m2="2"¶m3="7"

I notice sometimes both ways work. But what's the rule for passing parameters from URL ?
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
You don't use them. Parameters are separated by either the ampersand or the end of the string. That's enough for the container to know how to split the parameters.


JDBCSupport - An easy to use, light-weight JDBC framework -
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

No quotes unless you want them to be part of the passed value (in which case they should be URL-encoded in any case).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using double quote in passing parameter
 
Similar Threads
Hyperlink
Href with onClick
useBean question
Double Dispatcher
Float.valueOf() method and NumberFormatException