91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 195KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-17
  • 語言: Java
  • 標(biāo)簽: Android??服務(wù)器端??

資源簡介

Android服務(wù)器端交互服務(wù)器端源碼,可以參考我的博客:http://blog.csdn.net/yayun0516

資源截圖

代碼片段和文件信息

package?com.shao.action;??
??
import?java.io.IOException;??
import?java.util.ArrayList;??
import?java.util.List;??
??
import?javax.servlet.http.HttpServletRequest;??
import?javax.servlet.http.HttpServletResponse;??
??
import?org.apache.struts2.interceptor.ServletRequestAware;??
import?org.apache.struts2.interceptor.ServletResponseAware;??
??
import?com.google.gson.Gson;??
import?com.opensymphony.xwork2.ActionSupport;??
import?com.shao.domain.Music;??
??
public?class?JSONAction?extends?ActionSupport?implements?ServletRequestAware??
????????ServletResponseAware?{??
??
????/**?
?????*??
?????*/??
????private?static?final?long?serialVersionUID?=?-3604892179657815531L;??
????private??HttpServletRequest?request;??
????private??HttpServletResponse??response;??
????private??String??format;??
????public?String?getFormat()?{??
????????return?format;??
????}??
??
????public?void?setFormat(String?format)?{??
????????this.format?=?format;??
????}??
??
????@Override??
????public?void?setServletRequest(HttpServletRequest?request)?{??
????????this.request?=?request;??
????}??
??
????@Override??
????public?void?setServletResponse(HttpServletResponse?response)?{??
????????this.response?=?response;??
????}??
??????
????public??void?json(){??
????????List?list?=?new?ArrayList();??
????????Gson?gson?=?new??Gson();??
????????Music?m1?=?new?Music();??
????????m1.setId(1);??
????????m1.setAuthor(“周杰倫“);??
????????m1.setName(“外婆“);??
????????m1.setTime(“04:04“);??
????????list.add(m1);??
????????Music?m2?=?new?Music();??
????????m2.setId(2);??
????????m2.setAuthor(“周杰倫“);??
????????m2.setName(“半獸人“);??
????????m2.setTime(“04:05“);??
????????list.add(m2);??
????????Music?m3?=?new?Music();??
????????m3.setId(3);??
????????m3.setAuthor(“周杰倫“);??
????????m3.setName(“烏克麗麗“);??
????????m3.setTime(“02:55“);??
????????list.add(m3);??
????????java.lang.reflect.Type?type?=?new?com.google.gson.reflect.TypeToken>()?{??
????????}.getType();??//指定type
????????String?beanListToJson?=?gson.toJson(listtype);??//list轉(zhuǎn)換成json字符串
????????System.out.println(“GSON-->“+beanListToJson);?????
????????try?{????
?????????????response.setCharacterEncoding(“UTF-8“);???
????????????this.response.getWriter().write(beanListToJson);????
????????}?catch?(IOException?e)?{????
????????????e.printStackTrace();????
????????}????
????}??
}??

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-03-12?10:50??Test2\
?????文件????????1382??2016-03-10?21:42??Test2\.classpath
?????文件????????1330??2016-03-10?21:44??Test2\.project
?????目錄???????????0??2016-03-12?10:50??Test2\.settings\
?????文件?????????522??2016-03-10?21:42??Test2\.settings\.jsdtscope
?????文件?????????364??2016-03-10?21:42??Test2\.settings\org.eclipse.jdt.core.prefs
?????文件?????????474??2016-03-10?21:42??Test2\.settings\org.eclipse.wst.common.component
?????文件?????????464??2016-03-10?21:42??Test2\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2016-03-10?21:42??Test2\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2016-03-10?21:42??Test2\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\meta-INF\
?????文件??????????39??2016-03-10?21:42??Test2\WebRoot\meta-INF\MANIFEST.MF
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\classes\
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\classes\com\
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\classes\com\shao\
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\classes\com\shao\action\
?????文件?????????613??2016-03-12?10:18??Test2\WebRoot\WEB-INF\classes\com\shao\action\JSONAction$1.class
?????文件????????3187??2016-03-12?10:18??Test2\WebRoot\WEB-INF\classes\com\shao\action\JSONAction.class
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\classes\com\shao\domain\
?????文件????????1139??2016-03-10?21:43??Test2\WebRoot\WEB-INF\classes\com\shao\domain\Music.class
?????文件?????????800??2016-03-10?21:21??Test2\WebRoot\WEB-INF\classes\struts.xml
?????目錄???????????0??2016-03-12?10:50??Test2\WebRoot\WEB-INF\lib\
?????文件??????210856??2016-03-10?19:51??Test2\WebRoot\WEB-INF\lib\gson-2.3.1.jar
?????文件?????????605??2016-03-10?21:42??Test2\WebRoot\WEB-INF\web.xml
?????文件?????????834??2016-03-10?21:42??Test2\WebRoot\index.jsp
?????目錄???????????0??2016-03-12?10:50??Test2\src\
?????目錄???????????0??2016-03-12?10:50??Test2\src\com\
?????目錄???????????0??2016-03-12?10:50??Test2\src\com\shao\
?????目錄???????????0??2016-03-12?10:50??Test2\src\com\shao\action\
............此處省略4個文件信息

評論

共有 條評論