basesearchselectrecordtag.java

来自「j2ee源码」· Java 代码 · 共 71 行

JAVA
71
字号
/*
 * Created on 2005/11/11
 */
package com.leeman.common.web.ui.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.jsp.JspException;

/**
 * @author Dennis
 */
public class BaseSearchSelectRecordTag extends TagSupport{
	
	private String actionURL;
	private String indexId;
	
	public int doStartTag() throws javax.servlet.jsp.JspException{
		try{
			HttpServletRequest request =(HttpServletRequest)pageContext.getRequest();
			String shtml = "<a href=\"" + request.getContextPath() + actionURL + ".do?action=selectRecord&selectedIndex=" + pageContext.getAttribute(indexId) + "\">";
			pageContext.getOut().println(shtml);
		}catch(Exception e){
			throw new javax.servlet.jsp.JspException("Error processing BaseSearchSelectRecordTag.doStartTag()");
		}
		
		return EVAL_BODY_INCLUDE;
	}
	
	public int doEndTag() throws javax.servlet.jsp.JspException{
		HttpServletRequest request =(HttpServletRequest)pageContext.getRequest();
		try{
			pageContext.getOut().println("</a>");
		}catch(Exception e){
			throw new javax.servlet.jsp.JspException("Error processing BaseSearchSelectRecordTag.doEndTag(): " + e.toString());
		}
		
		return EVAL_PAGE;
	}
	/**
	 * @return
	 */
	public String getActionURL() {
		return actionURL;
	}

	/**
	 * @param string
	 */
	public void setActionURL(String string) {
		actionURL = string;
	}



	/**
	 * @return
	 */
	public String getIndexId() {
		return indexId;
	}

	/**
	 * @param string
	 */
	public void setIndexId(String string) {
		indexId = string;
	}

}

⌨️ 快捷键说明

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