This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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: 375
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: 63211
    
  69

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]
 
Have you checked out Aspose?
 
subject: using double quote in passing parameter
 
It's not a secret anymore!