fixing UriResolverDocs
This commit is contained in:
parent
645709a701
commit
50c822904e
|
@ -21,24 +21,22 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Oct 22, 2018
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Oct 22, 2018
|
||||
*/
|
||||
@Path("docs/*")
|
||||
@Path("docs")
|
||||
public class UriResolverDocs {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UriResolverDocs.class);
|
||||
|
||||
@GET
|
||||
@Produces({ MediaType.TEXT_HTML })
|
||||
@Path("")
|
||||
@Path("/")
|
||||
public InputStream index(@Context HttpServletRequest req) throws WebApplicationException {
|
||||
logger.info(UriResolverDocs.class.getSimpleName() + " called");
|
||||
|
||||
String requestURI = req.getRequestURI();
|
||||
try {
|
||||
|
||||
|
||||
if (requestURI == null)
|
||||
requestURI = "/index.html";
|
||||
|
||||
|
@ -60,5 +58,20 @@ public class UriResolverDocs {
|
|||
throw (WebApplicationException) e;
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Produces({ MediaType.TEXT_HTML })
|
||||
@Path("*")
|
||||
public InputStream toDoc1(@Context HttpServletRequest req) throws WebApplicationException {
|
||||
logger.info(UriResolverDocs.class.getSimpleName() + " toDoc1 called");
|
||||
return index(req);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Produces({ MediaType.TEXT_HTML })
|
||||
@Path("/*")
|
||||
public InputStream toDoc2(@Context HttpServletRequest req) throws WebApplicationException {
|
||||
logger.info(UriResolverDocs.class.getSimpleName() + " toDoc2 called");
|
||||
return index(req);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue