我定义了像"@RequestMapping("/loginuser.sn")"
这样的动作映射,并试图从
url = new URL("loginuser.sn");
HttpURLConnection conn = (HttpURLConnection)url .openConnection();
我收到此错误java.net.MalformedURLException:no protocol:
代码是否正确?
答案 0 :(得分:0)
您的网址应该与http://hostname:portname/extra
类似,因为您还没有为URL
URL url = new URL("http://localhost:8080/base/yourpart");
HttpURLConnection conn = (HttpURLConnection)url .openConnection();
因为没有指定协议,http
MalformedURLException
答案 1 :(得分:0)