spring mvc 结合ajax怎么写
1个回答
2016-02-23
展开全部
首先。类上面
@Controller
@RequestMapping("/") --这里加访问路径
public class LoginController ---
方法--
@RequestMapping(value = "/usercheck", method = {RequestMethod.POST})
@ResponseBody
public String userLoginCheck (String param(说明:接受参数), HttpServletRequest req)
{
}
ajax的url可以直接写 url:'usercheck',
追问:
我的control是这样写的:
@Controller
@RequestMapping("/userLoginController")
public class UserLoginController {
@RequestMapping(value="/userLoginCheck", method={RequestMethod.GET, RequestMethod.POST})
@Controller
@RequestMapping("/") --这里加访问路径
public class LoginController ---
方法--
@RequestMapping(value = "/usercheck", method = {RequestMethod.POST})
@ResponseBody
public String userLoginCheck (String param(说明:接受参数), HttpServletRequest req)
{
}
ajax的url可以直接写 url:'usercheck',
追问:
我的control是这样写的:
@Controller
@RequestMapping("/userLoginController")
public class UserLoginController {
@RequestMapping(value="/userLoginCheck", method={RequestMethod.GET, RequestMethod.POST})
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询