常用编码资料

		List<UserInfo> list=GetUserS.GetUserList(11);
		String json=JSON.toJSONString(list);
		HashMap<Object,Object> hs=new HashMap<Object, Object>();
		for(int i=0;i<10;i++)
		{
			hs.put("UserID", i);
			hs.put("UserName", "gengzg");
			hs.put("UserEmail", "[email protected]");
		}
		
		response.setContentType("text/html;charset=UTF-8");
		//response.getWriter().println(json);
		//response.getWriter().println(JSON.toJSON(hs));
		response.getWriter().println(hs.size());	

		System.out.println("DDDDDDDDDDDDDDDD");

 

全部代码
------------------------------------------------------------------------------------------------------------------------------
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;


public class RunShell {
    
    public static void main(String[] args) {
        try {
            Process process = Runtime.getRuntime().exec("/home/tina/Desktop/cal_time.sh");
            InputStreamReader ir = new InputStreamReader(process.getInputStream());
            LineNumberReader input = new LineNumberReader(ir);
            String line;
            while((line = input.readLine()) != null)
                System.out.println(line);
            input.close();
            ir.close();
        } catch (IOException e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }
}

 

你可能感兴趣的:(编码)