/** * Returns the application resources base URI. * * @return The application resources base URI. */ protected Reference getResourcesBase() { return getRequest().getRootRef(); }
/** * Returns the application root reference. * * @return The application root reference. */ @Override public Reference getRootRef() { return getWrappedRequest().getRootRef(); }
/** * Generate the HTML representation of this resource. */ @Get("html") public Representation toHtml(Variant variant) throws ResourceException { final Map<String, Object> dataModel = new TreeMap<String, Object>(); dataModel.put("user", this.user); dataModel.put("contact", this.contact); dataModel.put("resourceRef", getRequest().getResourceRef()); dataModel.put("rootRef", getRequest().getRootRef()); return getTemplateRepresentation("contact.html", dataModel, MediaType.TEXT_HTML); }
/** * Returns the application root reference. * * @return The application root reference. * @see Request#getRootRef() */ public Reference getRootRef() { return getRequest() == null ? null : getRequest().getRootRef(); }
/** * Generate the HTML representation of this resource. */ @Get("html") public Representation toHtml() throws ResourceException { final Map<String, Object> dataModel = new TreeMap<String, Object>(); dataModel.put("user", this.user); dataModel.put("contacts", this.contacts); dataModel.put("resourceRef", getRequest().getResourceRef()); dataModel.put("rootRef", getRequest().getRootRef()); return getTemplateRepresentation("user.html", dataModel, MediaType.TEXT_HTML); } }
/** * Generate the HTML representation of this resource. */ @Get public Representation toHtml(Variant variant) throws ResourceException { final Map<String, Object> dataModel = new TreeMap<String, Object>(); dataModel.put("user", this.user); dataModel.put("contacts", this.contacts); dataModel.put("resourceRef", getRequest().getResourceRef()); dataModel.put("rootRef", getRequest().getRootRef()); return getTemplateRepresentation("contacts.html", dataModel, MediaType.TEXT_HTML); }
/** * Generate the HTML representation of this resource. */ @Get public Representation toHtml(Variant variant) throws ResourceException { final Map<String, Object> dataModel = new TreeMap<String, Object>(); dataModel.put("users", this.users); dataModel.put("resourceRef", getRequest().getResourceRef()); dataModel.put("rootRef", getRequest().getRootRef()); return getTemplateRepresentation("users.html", dataModel, MediaType.TEXT_HTML); } }
final Map<String, Object> dataModel = new TreeMap<String, Object>(); dataModel.put("resourceRef", nextRequest.getResourceRef()); dataModel.put("rootRef", nextRequest.getRootRef()); dataModel.put("baseUrl", nextRequest.getRootRef().toString()); dataModel.put("clientInfo", nextClientInfo); dataModel.put("isAuthenticated", nextClientInfo.isAuthenticated());
private String getDefaultRedirect() { return this.getRequest().getRootRef().toString() + this.getPropertyUtil().get(OasProps.PROP_INDEX_PATH, OasProps.DEF_INDEX_PATH); }
/** * Redirects to the given path, using an absolute URI based on this.getRequest().getRootRef(). * * @param path * The path to redirect to. */ protected void redirectToPath(final String path) { final String rootRef = this.getRequest().getRootRef().toString(false, false); final boolean rootHasSlash = rootRef.endsWith("/"); final boolean pathHasSlash = path.startsWith("/"); if(rootHasSlash && pathHasSlash && path.length() > 1) { this.getResponse().redirectSeeOther(rootRef + path.substring(1)); } else // if((rootHasSlash && !pathHasSlash) || (!rootHasSlash && pathHasSlash)) { this.getResponse().redirectSeeOther(rootRef + path); } } }
nextDataHandler); nextResponse.redirectSeeOther(nextRequest.getRootRef().toString(false, false) + propertyUtil.get(OasProps.PROP_ONTOLOGY_MANAGER_PATH, OasProps.DEF_ONTOLOGY_MANAGER_PATH));
"The request.originalRef must not be null"); final Reference appRootRef = request.getRootRef(); if (appRootRef == null) { throw new IllegalArgumentException(
/** * Returns the resource's relative path. * * @return The resource's relative path. */ protected String getResourcePath() { Reference ref = new Reference(getRequest().getRootRef(), getRequest() .getResourceRef()); return ref.getRemainingPart(); }
if(request.getRootRef() != null) final String p = request.getRootRef().getPath(); credentialsCookie.setPath(p == null ? "/" : p);
/** * Accept the representation of a new user, and create it. */ @Post public void acceptUser(Representation entity) throws ResourceException { Form form = new Form(entity); User user = new User(); user.setFirstName(form.getFirstValue("firstName")); user.setLastName(form.getFirstValue("lastName")); user.setImage(form.getFirstValue("image")); try { user = getObjectsFacade().createUser(user); getResponse().redirectSeeOther( getChildReference(getRequest().getResourceRef(), user.getId())); } catch (ObjectsException e) { final Map<String, Object> dataModel = new TreeMap<String, Object>(); dataModel.put("users", this.users); dataModel.put("resourceRef", getRequest().getResourceRef()); dataModel.put("rootRef", getRequest().getRootRef()); dataModel.put("firstName", form.getFirstValue("firstName")); dataModel.put("lastName", form.getFirstValue("lastName")); dataModel.put("image", form.getFirstValue("image")); dataModel.put("errorMessage", e.getMessage()); getResponse().setEntity( getTemplateRepresentation("users.html", dataModel, MediaType.TEXT_HTML)); } }
.getRootRef().toString(false, false));
this.rootRef = (request.getRootRef() == null) ? null : request .getRootRef();
.getRootRef().toString(false, false));
.getRootRef().toString(false, false));
.getRootRef().toString(false, false));