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

📄 textareatag.java

📁 一个实用工具类
💻 JAVA
字号:
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file.  */package org.butor.web.taglib.html;import javax.servlet.jsp.JspException;import org.apache.struts.util.RequestUtils;import org.apache.struts.util.ResponseUtils;import org.butor.web.action.IButorActionForm;/** * @author nacroaz * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. */public class TextareaTag extends org.apache.struts.taglib.html.TextareaTag {	protected String keep_format = null;	public String getKeep_format() {		return keep_format;	}		public void setKeep_format(String c) {		keep_format = c;		}    public int doStartTag() throws JspException {	   	// Find and check the form bean	    		   	    	Object o = RequestUtils.lookup(pageContext, name, null);        if (! (o instanceof IButorActionForm)) {			ResponseUtils.write(pageContext, "The form bean must be an instance of ButorActionForm !!!");  			return SKIP_BODY;        }                IButorActionForm form = (IButorActionForm) o;                // If property is enable, use super class definition                if (form.getEnabled(property)) {        	return super.doStartTag();        } else {        	        	boolean mustFormat = (keep_format == null) ? true :  keep_format.equals("1");        	        	// the property is disable, we must render it properly        		        if (value != null) {	        	TagLibHelper.renderStaticField(pageContext, property, value, mustFormat);				    	        	        } else {	        	// Lookup the property value	        	    	        Object value = RequestUtils.lookup(pageContext, name, property, null);        	            	    if (value == null) {            	    value = "";        	    }        	    	        	TagLibHelper.renderStaticField(pageContext, property, value.toString(), mustFormat);	        	        	    	        }	                }    	    	    			return (EVAL_BODY_BUFFERED);    }}

⌨️ 快捷键说明

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