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

📄 httpheaderaction.java

📁 一个抓取程序
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.phpcoo.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.phpcoo.constants.Constants;
import com.phpcoo.po.HttpHeaderPo;
import com.phpcoo.service.IHttpHeaderService;
import com.phpcoo.struts.form.HttpForm;

/** 
 * MyEclipse Struts
 * Creation date: 03-30-2008
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 */
public class HttpHeaderAction extends DispatchAction {
	
	private IHttpHeaderService httpService;
	
	private HttpHeaderPo httpPo;
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward insert(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HttpForm hf = (HttpForm)form;
		httpPo.setServerPort(Integer.parseInt(hf.getServerPort()));
		httpPo.setServerIp(hf.getServerIp());
		httpPo.setHttpGET(hf.getHttpGET());
		httpPo.setHttpAccept(hf.getHttpAccept());
		httpPo.setHttpAcceptLanguage(hf.getHttpAcceptLanguage());
		httpPo.setHttpUaCpu(hf.getHttpUaCpu());
		httpPo.setHttpAcceptEncoding(hf.getHttpAcceptEncoding());
		httpPo.setHttpUserAgent(hf.getHttpUserAgent());
		httpPo.setHttpHost(hf.getHttpHost());
		httpPo.setHttpConnection(hf.getHttpConnection());
		httpPo.setSiteName(hf.getSiteName());
		httpPo.setSiteUrl(hf.getSiteUrl());
		httpPo.setStartTag(hf.getStartTag());
		httpPo.setEndTag(hf.getEndTag());
		httpService.saveHttpHeader(httpPo);
		return queryAll(mapping, form,request,response);
	}
	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward queryAll(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		request.setAttribute(Constants.CONFIG_KEY, httpService.queryHttpHeaderAll());
		
		return mapping.findForward(Constants.INSERT_OK);
	}

	/**
	 * @param httpService 要设置的 httpService
	 */
	public void setHttpService(IHttpHeaderService httpService) {
		this.httpService = httpService;
	}

	/**
	 * @param httpPo 要设置的 httpPo
	 */
	public void setHttpPo(HttpHeaderPo httpPo) {
		this.httpPo = httpPo;
	}
	/**
	 * @return httpPo
	 */
	public HttpHeaderPo getHttpPo() {
		return httpPo;
	}
	/**
	 * @return httpService
	 */
	public IHttpHeaderService getHttpService() {
		return httpService;
	}
}

⌨️ 快捷键说明

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