Error: [$injector:unpr] Unknown provider: userProvider <- user <- MainCtrl
<p th:text="${e}">1</p>
答案 0 :(得分:0)
1)在更新按钮上单击启动httppost请求,该请求负责向服务器发送数据..
你可以解析jsonobject中的所有值
String url= "YOUR URL";
JSONObject data=new JSONObject();
try {
data.put("firstname", "abc");
data.put("lastname", "xyz");
data.put("dob", "11-03-2016");
data.put("status", "ac");
data.put("homeaddress", "cac");
} catch (JSONException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
HttpResponse response = null;
HttpPost httppostreq = new HttpPost(url);
try {
StringEntity se = new StringEntity(data.toString());
se.setContentType("application/json;charset=UTF-8");
httppostreq.setEntity(se);
response = client.execute(httppostreq);
HttpEntity entity = response.getEntity(); /*.. read entity here..*/
}
catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}catch(Exception e){
e.printStackTrace();
System.out.println(e.getMessage());
return false;
}
2) 对于Scrollview
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- your layout element -->
.....
.....
.....
</LinearLayout>
</ScrollView>