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/annotations_ui/PersonResource.java

    r32 r65  
    33 */
    44package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
     5
     6import java.io.UnsupportedEncodingException;
     7import java.net.URLDecoder;
    58
    69import org.apache.log4j.Logger;
     
    4245        // id from URI /annotations/persons/{id}
    4346        requestId = (String) getRequest().getAttributes().get("id");
    44         logger.debug("group-id=" + requestId);
     47        logger.debug("person-id=" + requestId);
    4548        // get store instance
    4649        if (store == null) {
    4750            store = ((BaseRestlet) getApplication()).getAnnotationStore();
    4851        }
    49         // get group from store
     52        // get person from store
    5053        if (requestId != null) {
     54            // URL decode
     55            try {
     56                requestId = URLDecoder.decode(requestId, "UTF-8");
     57            } catch (UnsupportedEncodingException e) {
     58                // this shouldn't happen
     59            }
    5160            person = (Person) store.getActor(new Person(requestId));
    5261        }
Note: See TracChangeset for help on using the changeset viewer.