📄 indexaction.java
字号:
package com.ht.gis.action;import com.ht.gis.form.IndexForm;import org.apache.struts.action.*;import javax.servlet.http.*;import javax.servlet.ServletContext;import com.ht.gis.service.*;import com.ht.gis.search.*;public class IndexAction extends Action { private static Log log = LogFactory.getLog("WebGIS"); public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { try{ //=============== 取表单数据 ======================= IndexForm indexForm = (IndexForm)actionForm; String order = indexForm.getOrder(); //=============== 对数据库进行全文索引 ================ HttpSession httpSession = httpServletRequest.getSession(false); ServletContext servContext = httpSession.getServletContext(); Indexer indexer = (Indexer)servContext.getAttribute("Indexer"); String responseXML = indexer.setIndex(); //=============== 返回结果数据表单 ================== httpServletResponse.getWriter().println(responseXML); return null; }catch(Exception e){ log.error(e); ActionErrors errors = new ActionErrors(); errors.add("username", new ActionError("login.defeat")); this.saveErrors(httpServletRequest, errors); return actionMapping.findForward("fault"); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -