blob: 0292a1f8c98509f321c298ee9b427734f75c925c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2013 VMware Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* VMware Inc. - initial contribution
*******************************************************************************/
package org.eclipse.virgo.samples.rest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* {@link RestController} is a Spring MVC controller class which handles REST requests.
* </p>
*
* <strong>Concurrent Semantics</strong><br />
*
* Thread safe.
*
*/
@Controller
public final class RestController {
@RequestMapping(value = "/users/{userId}", method = RequestMethod.GET)
@ResponseBody
public String getUser(@PathVariable("userId") String userId) {
return userId;
}
}