我无法调用简单的休息控制器

时间:2017-06-05 11:07:54

标签: java rest spring-mvc

这是我的控制器代码,我正在尝试使用网址http://localhost:8089/webservroj/UserInfo?UserId=123来调用它,但它会给出错误404.

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.bind.annotation.RestController;

import com.cas.models.UserInformationModel;

@RestController

@RequestMapping("/")

public class  UserInformationController {

UserInformationModel jon =new UserInformationModel(19, "jon", "LA");

@RequestMapping(value="UserInfo", method=RequestMethod.GET)
public UserInformationModel getUserInformation(@RequestParam int UserId){   
return jon;
}}

0 个答案:

没有答案
相关问题