Ignore:
Timestamp:
Dec 5, 2012, 2:36:43 PM (11 years ago)
Author:
casties
Branch:
default
Message:

deal with special characters in urls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java

    r61 r65  
    44package de.mpiwg.itgroup.annotations.restlet;
    55
     6import java.io.UnsupportedEncodingException;
     7import java.net.URLDecoder;
    68import java.util.List;
    79
     
    4244
    4345        String jsonId = (String) getRequest().getAttributes().get("id");
     46        if (jsonId != null) {
     47            // URL decode
     48            try {
     49                jsonId = URLDecoder.decode(jsonId, "UTF-8");
     50            } catch (UnsupportedEncodingException e) {
     51                // this shouldn't happen
     52            }
     53        }
    4454        String uri = decodeJsonId(jsonId);
    4555
Note: See TracChangeset for help on using the changeset viewer.