my dog learned polymorphism
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "using double quote in passing parameter" Watch "using double quote in passing parameter" New topic

using double quote in passing parameter

ben oliver
Ranch Hand

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


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

Joined: Jan 10, 2002
Posts: 63868

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: using double quote in passing parameter
jQuery in Action, 3rd edition