indexaction.java~5~

来自「全文搜索源码,基于开源项目Lucene编写,开发语言为JAVA,本程序做为LUC」· JAVA~5~ 代码 · 共 33 行

JAVA~5~
33
字号
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 + -
显示快捷键?