indexaction.java~6~
来自「全文搜索源码,基于开源项目Lucene编写,开发语言为JAVA,本程序做为LUC」· JAVA~6~ 代码 · 共 32 行
JAVA~6~
32 行
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"); indexer.setIndex(); 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 + =
减小字号Ctrl + -
显示快捷键?