[
https://issues.jboss.org/browse/WFLY-2752?page=com.atlassian.jira.plugin....
]
Marek Kopecký updated WFLY-2752:
--------------------------------
Description:
The code that works perfectly in WildFly.8.0.0.Beta:
{code:java}
package jdsu.vts.tcpcontroller.webservices.rest.resources;
import java.net.URI;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.Consumes;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import jdsu.vts.tcpcontroller.webservices.rest.application.V1_TCPController;
import jdsu.vts.shared.transferobjects.V1_TCPSetups;
@Path("/v1")
public class V1_TCPControllerResource {
@Context UriInfo uriInfo;
@GET
@Produces("application/json")
public Response getControllers() {
//String json = String.valueOf(m_testsMap.size());
return Response.ok(V1_TCPController.getCollection()).build();
}
@PUT
@Path("{id}")
@Produces("application/json")
public Response addController(@PathParam("id") String id) {
V1_TCPController controller = V1_TCPController.find(id);
if(controller != null) {
return Response.status(Response.Status.CONFLICT).build();
}
controller = new V1_TCPController(id);
URI uri = uriInfo.getAbsolutePathBuilder().path(id).build();
return Response.created(uri).build();
}
}
{code:java}
does not work in WildFly.8.0.0.CR1. uriInfo is null in the call.
Please help.
Stan
was:
The code that works perfectly in WildFly.8.0.0.Beta:
package jdsu.vts.tcpcontroller.webservices.rest.resources;
import java.net.URI;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.Consumes;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import jdsu.vts.tcpcontroller.webservices.rest.application.V1_TCPController;
import jdsu.vts.shared.transferobjects.V1_TCPSetups;
@Path("/v1")
public class V1_TCPControllerResource {
@Context UriInfo uriInfo;
@GET
@Produces("application/json")
/**
*
* @return
*/
public Response getControllers() {
//String json = String.valueOf(m_testsMap.size());
return Response.ok(V1_TCPController.getCollection()).build();
}
@PUT
@Path("{id}")
@Produces("application/json")
public Response addController(@PathParam("id") String id){
V1_TCPController controller = V1_TCPController.find(id);
if(controller != null) {
return Response.status(Response.Status.CONFLICT).build();
}
controller = new V1_TCPController(id);
URI uri = uriInfo.getAbsolutePathBuilder().path(id).build();
return Response.created(uri).build();
}
}
does not work in WildFly.8.0.0.CR1. uriInfo is null in the call.
Please help.
Stan
Using an injected UriInfo object by the JAX-RS runtime environment
does not work
--------------------------------------------------------------------------------
Key: WFLY-2752
URL:
https://issues.jboss.org/browse/WFLY-2752
Project: WildFly
Issue Type: Bug
Components: REST
Affects Versions: 8.0.0.CR1
Environment: Linux Fedora
Reporter: Stan Zelivinski
Assignee: Bill Burke
Priority: Major
The code that works perfectly in WildFly.8.0.0.Beta:
{code:java}
package jdsu.vts.tcpcontroller.webservices.rest.resources;
import java.net.URI;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.Consumes;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import jdsu.vts.tcpcontroller.webservices.rest.application.V1_TCPController;
import jdsu.vts.shared.transferobjects.V1_TCPSetups;
@Path("/v1")
public class V1_TCPControllerResource {
@Context UriInfo uriInfo;
@GET
@Produces("application/json")
public Response getControllers() {
//String json = String.valueOf(m_testsMap.size());
return Response.ok(V1_TCPController.getCollection()).build();
}
@PUT
@Path("{id}")
@Produces("application/json")
public Response addController(@PathParam("id") String id) {
V1_TCPController controller = V1_TCPController.find(id);
if(controller != null) {
return Response.status(Response.Status.CONFLICT).build();
}
controller = new V1_TCPController(id);
URI uri = uriInfo.getAbsolutePathBuilder().path(id).build();
return Response.created(uri).build();
}
}
{code:java}
does not work in WildFly.8.0.0.CR1. uriInfo is null in the call.
Please help.
Stan
--
This message was sent by Atlassian Jira
(v7.12.1#712002)