⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moreresultsaction.java

📁 前期开发时开发的新闻发布系统
💻 JAVA
字号:
package luceneAction;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.servlet.ServletContext;
import org.apache.lucene.search.Hits;
import org.bit.demo.*;
import luceneActionForm.*;

public class moreResultsAction extends Action 
{
	
	public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) 
	{
		moreResultsActionForm mForm = (moreResultsActionForm) actionForm;
		int maxresults = mForm.getMaxresults();
		int startindex = mForm.getStartindex();
		int thispage = maxresults;
		int length = 0;
		ServletContext application = httpServletRequest.getSession().getServletContext();
		Hits hits = (Hits) application.getAttribute("hits");
		length = hits.length();
		if(startindex + maxresults >= length)
		{			
			thispage = thispage - (1 + maxresults + startindex - length);
		}
		SearchPara searchpara = (SearchPara) application.getAttribute("searchpara");
		searchpara.setMaxresults(maxresults);
		searchpara.setStartindex(startindex);
		searchpara.setThispage(thispage);
		application.setAttribute("searchpara", searchpara);
		return actionMapping.findForward("showresults");
	}
}

⌨️ 快捷键说明

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