[jboss-user] [JBoss Portal Users] - Re: VFSZIP problem ?

blopes do-not-reply at jboss.com
Wed Aug 26 05:44:10 EDT 2009


The class I have on that jar is the same as before

...
import javax.ws.rs.Consumes;
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.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;

import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.restlet.data.Form;
import org.restlet.representation.Representation;
import org.restlet.resource.ClientResource;

@Path("/users/")
public class UsersResourceImpl {

	protected @Context
	UriInfo uriInfo;
	
	protected @Context SecurityContext securityContext;
	
	//protected @Request Request;

	protected UserManager userManager;
	protected DivisionManager divisionManager;
	protected LabManager labManager;

	public UsersResourceImpl() {
		userManager = (UserManager) BeanFactory.getInstance().getBean("userManager");
		divisionManager = (DivisionManager)BeanFactory.getInstance().getBean("divisionManager");
		labManager = (LabManager)BeanFactory.getInstance().getBean("labManager");
	}

	@GET
	@Path("{userName}/")
	@Produces("application/xml")
	public User getUser(@PathParam("userName")
	String userName) {

		User user = userManager.getUser(userName);
		if (null == user) {
		 ResponseBuilder builder = Response.status(Status.NOT_FOUND);
		 builder.type("text/html");
		 builder.entity("<h3>Order Not Found</h3>");
		 throw new WebApplicationException(builder.build());
		}
		
		return user;
	}
	
	@GET
	@Produces("application/object")
	@Path("/allusers")
	public List getUsers() {

		return userManager.getAllUsers();
	}

...
}

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251731#4251731

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251731



More information about the jboss-user mailing list