File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
url with a space giving problem
Joined: Jan 13, 2008
Feb 19, 2012 21:05:46
I am constructing an url like below and trying to get the JSON objects.
String url = "http://test.ntu.edu.sh/libs/sample" + " " + "name/list/json"; SimpleClient c = new SimpleClient(); c.setWsUsername("test"); c.setWsPassword("test"); c.setElmServiceUrl(url);
I get the following error.
Error retrieving library list
: Invalid uri
: escaped absolute path not valid
If I paste the above URI on an browser, it goes through and I get the JSON object.
How to introduce a white space between
"sample" + " " + "name"
as the above construction doesn't pass.
Many Thanks in advance.
Joined: May 03, 2008
Feb 20, 2012 00:34:54
edit Which you could have discovered by reading the API for
. You would also have discovered an alternative approach.
There are no new questions, but there may be new answers.
Joined: Oct 27, 2005
Feb 20, 2012 03:59:52
+ is also an option for spaces.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
I agree. Here's the link:
subject: url with a space giving problem
Automatic Installation of 100+ Open Source Projects for Java Developers
Getting message as Invalid JSON
Struts2-json plugin not serializing action class to json
Java EE 5 Tutorial - Problem with Web Services
REST vs SOAP - stateful/stateless
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014