转自:http://www.cnblogs.com/digdeep/p/5574366.html 1.前台页面 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
JsonResult类的定义: /*生成Json串*/ public class JsonResult { /** * 返回错误状态的json串 * * @param status 错误代码,非零数值 * @param message 错误消息 * @return CodeMessage */ public static CodeMessage getErrorMessage(final int status, final String message) { return new CodeMes
using System.IO; /// <summary> /// WebApi返回图片 /// </summary> public HttpResponseMessage GetQrCode() { var imgPath = @"D:\ITdosCom\Images\itdos.jpg"; //从图片中读取byte var imgByte = File.ReadAllBytes(imgPath); //从图片中读取流 var imgStream = new
<script type="text/javascript"> function Getweb() { var name = $("#CityName").val(); var end = $("#endName").val(); $.post("/Admins/GetWeathers", { data: name, end: end }, function (objd) { // objd 回调函数返回的js
public ResultBean getSpfl(Integer yyb) { ResultBean res = new ResultBean(); try { JSONArray data = new JSONArray(); String sql = "select * from tspfl_wx where yyb = " + yyb; sql += " and zt=" + GlobalStatusType.SPFlZT_QY; // 一级分类 List&