@@ -1,14 +1,22 @@
|
||||
package com.nis.web.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.util.StringUtil;
|
||||
@@ -100,6 +108,30 @@ public class SystemController extends BaseController{
|
||||
model.addAttribute("menuList",newList);
|
||||
return "/help";
|
||||
}
|
||||
|
||||
@RequestMapping("saveHelp")
|
||||
@ResponseBody
|
||||
public boolean saveHelp(HttpServletRequest request, HttpServletResponse response,ModelMap model,@RequestParam(required=true,value="editedHelpInfo")String editedHelpInfo,@RequestParam(required=true,value="helpHrefVal")String helpHrefVal){
|
||||
|
||||
try {
|
||||
StringBuffer helpInfo=new StringBuffer("<!DOCTYPE html>");
|
||||
helpInfo.append(URLDecoder.decode(editedHelpInfo,"utf-8"));
|
||||
helpInfo.append("</html>");
|
||||
String htmlName=URLDecoder.decode(helpHrefVal,"utf-8");
|
||||
String htmlPath=request.getServletContext().getRealPath("/")+htmlName;
|
||||
|
||||
File file=new File(htmlPath);
|
||||
OutputStream out=new FileOutputStream(file);
|
||||
out.write(helpInfo.toString().getBytes());
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user