@Get public void data() throws ResourceException { MdTable t = tmd.getTable(); String sql = String.format(SQL, t.getNamespace(), t.getName()); String id = qf.createQuery(sql); String path = getReference() .getPath() .replaceFirst( "/table/" + t.getNamespace() + "/" + t.getName() + "/", "/query/" + id + "/"); URL ref = cfg.getReference(getHostRef(), getReference().getQuery(), path); getResponse().redirectTemporary(ref.toString()); }