%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="com.Admin.vo.Attr"%> <%@ page import="com.Admin.vo.User"%> <%@ page import="com.Admin.vo.AppUser"%> <%@ page import="com.Admin.daoimpl.AdminProdDaoImpl"%> <%@ page import="net.sf.json.JSONArray"%> <%@ page import="net.sf.json.JSONObject"%> <%@ page import="java.util.ArrayList"%> <%@ page import="java.util.List"%> <%@ page import="com.common.IConstant"%> <%@ page import="com.common.WebUtils"%> <%@ page import="com.wx.SignUtil"%> <%@ page session="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="cf" uri="/WEB-INF/els.tld" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String realPath = "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+request.getServletPath().substring(0,request.getServletPath().lastIndexOf("/")+1); String context = request.getServletPath().substring(1,request.getServletPath().lastIndexOf("/")); String apppath = getServletContext().getRealPath("/"+context); String userid = request.getParameter("userid"); String appid = request.getParameter("appid"); String currentUrl = null; if(request.getServerPort() == 80){ currentUrl = request.getScheme()+"://"+ request.getServerName() + request.getRequestURI()+"?"+request.getQueryString(); } else{ currentUrl = request.getScheme()+"://"+ request.getServerName()+ ":" + request.getServerPort() +request.getRequestURI()+"?"+request.getQueryString(); } if(appid==null) appid="1"; System.out.println("appid from mn.jsp is "+appid); JSONObject wx = null; int row=0; String id = request.getParameter("id"); String mini = request.getParameter("mini"); String picture = "http://www.andisk.com/andisk/images/default/lesson.jpg"; String key = request.getParameter("ar"); JSONObject n = null; String content = null; String title = null; mini="1"; if(id!=null){ //获得本篇相应的上下篇 JSONObject rtn = null; try{ rtn = new AdminProdDaoImpl().getAppNewsNear(appid,Integer.valueOf(id)); }catch(Exception ex){ } if(rtn==null){ //response.sendRedirect(basePath+"m/page_blank.html?c=-2"); if(userid!=null){ JSONObject c = new JSONObject(); c.put("id",id); c.put("userid",userid); c.put("appid",appid); new AdminProdDaoImpl().setNewsReceiptRead(c); } response.sendRedirect(basePath + "news/m"+id+".html"); return; } n = rtn.getJSONObject("current"); key = n.getString("key"); String filename = key+".html"; content = IConstant.readNoticeFile(filename); if(content == null || content.isEmpty()){ content = n.getString("introduce"); } System.out.println("id is "+id+" rtn is "+n.toString()+" content is "+content); try{ picture = n.getString("picture"); }catch(Exception ex){ } } else{ if(key!=null){ String filename = key+".html"; content = IConstant.readNoticeFile(filename); } else{ response.sendRedirect(basePath+"m/page_blank.html?c=-2"); return; } } //get weixin wx = null; %>