editerservice.java

来自「基于j2ee的物流软件」· Java 代码 · 共 38 行

JAVA
38
字号
package com.wuliu.doservlet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.fredck.FCKeditor.FCKeditor;
import com.wuliu.dao.NavigationDAO;
import com.wuliu.entity.Navigation;

public class EditerService implements Service {

	public String doService(HttpServletRequest request,
			HttpServletResponse response) {
		String type = request.getParameter("type");
		String content = null;
		String action = request.getParameter("action");
		
		NavigationDAO nd = new NavigationDAO();
		
		FCKeditor oFCKeditor;
		oFCKeditor = new FCKeditor(request, "content");
		oFCKeditor.setBasePath(request.getContextPath() + "/fckeditor/");
		
		content = nd.selectNavigationByTypee(type).getContent();
		oFCKeditor.setValue(content);
		String editor = oFCKeditor.create();
		request.setAttribute("editor", editor);
		
		if(action != null && action.equals("update")){
			content = request.getParameter("content");
			nd.updateNavigation(new Navigation(type, content));
			request.setAttribute("href", "navigation.do?type=" + type);
			return "dispose.do";
		}
		return "admin/navigation/" + type + ".jsp";
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?