2013年9月20日星期五

java how to write server-side

java how to write a client server to receive incoming json is not scoket online Baidu via http for a long time did not find the tutorial
------ Solution ---- ----------------------------------------

If it is through http do the service side, it is common in the tomcat servlet hanging under it . Only this servlet receives json and returns the result .        listen to what you mean it is not php can be friends ?  
Yes , php can be, so you want the server is actually tomcat, jboss such
------ For reference only ---------- -----------------------------
JavaEE what , never heard of ?
------ For reference only -------------------------------------- -
http://blog.csdn.net/sunxing007/article/details/4305956
------ For reference only ----------------- ----------------------


is through the browser via http chant , the server receives is actually receiving a json string , the string needs to turn json json-lib.jar
String json = request.getParameter("参数名称");
JSONObject jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray = JSONArray.fromObject(json);

do not know if the landlord wanted
------ For reference only -------------------------- -------------

  
is through the browser via http chant , the server receives is actually receiving a json string , the string needs to turn json json-lib.jar   
  
String json = request.getParameter("参数名称");
JSONObject jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray = JSONArray.fromObject(json);
  
do not know if the landlord wanted  

with JSONArray parsing can also write their own code to parse the string can also see their own needs it.
------ For reference only -------------------------------------- -

If it is done via http server , it is common in the tomcat servlet hanging under it . Only this servlet receives json and returns the result .
------ For reference only -------------------------------------- -

If it is done via http server , it is common in the tomcat servlet hanging under it . Only this servlet receives json and returns the result .   listen to what you mean it is not php can also be friends ?
------ For reference only -------------------- -------------------
I want to receive json ... now the problem is not resolved to close have not received it .. there are tutorials
------ For reference only ---------------------------------------
Direct use tomcat application server like this

没有评论:

发表评论