Hi guys,
Currently I am developing some jax-rs endpoints with Apache TomEE 1.7.1. I
am trying to develop some subresources, but there is something that
confuses me:
Reading some documentation in summary says that your subresource should not
be annotated with @Path annotation and they gives you next example:
// Subresource class
public class Employee {
// Subresource method: returns the employee's last name
@GET
@Path("/lastname")
public String getEmployeeLastName() {
...
return lastName
}
}
In theory it should be a subresource, but when I deploy this in TomEE I can
access to this subresource directly from path provided in each method (in
previous case localhost:8080/app/lastname), but my question is that if it
is a subresource, it should not be accessed directly from browser but from
another resource right? So for example it should be valid accessing from
localhost:8080/app/employee/lastname
You can see the example here
http://docs.oracle.com/javaee/6/tutorial/doc/gknav.html
Alex.
--
+----------------------------------------------------------+
Alex Soto Bueno
www.lordofthejars.com
+----------------------------------------------------------+