📄 session.java
字号:
/*
* Title: 新疆克拉玛依油田井下公司ERP系统[KHCERP]
* Copyright: Copyright (c) 2004
* Company: westerasoft Co., Ltd
* All rights reserved.
*
* Created on 2004-6-17
* JDK version used : 1.4.1_05
*
*/
package com.hope.common.util;
import java.io.OutputStream;
import com.hope.common.util.ValueObjectUtil;
/**
* session对象的取值标签
*
* @author AnDong
*/
public class Session extends BaseTag {
/**
* session中保存的变量名称
*/
private String name;
private String property;
private String defaultValue;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public int doStartTag()
{
if (name != null )
{
try
{
if(getProperty() == null)
{
String value = (String)session.getAttribute(name);
if(value == null)
{
out.print(defaultValue == null?"":defaultValue);
}
else
out.print(value);
}
else
{
Object value = session.getAttribute(name);
if(value == null)
{
out.print(defaultValue == null?"":defaultValue);
}
else
{
Object propertyValue = ValueObjectUtil.getValue(value,getProperty());
if(propertyValue == null)
out.print(defaultValue == null?"":defaultValue);
else
out.print(propertyValue);
}
}
return SKIP_BODY;
} catch (Exception e)
{
e.printStackTrace();
}
}
return SKIP_BODY;
}
/**
* Description:
* @return
* @see com.westerasoft.common.tag.BaseTag#generateContent()
*/
public String generateContent() {
// TODO Auto-generated method stub
return null;
}
/**
* Description:
* @param output
* @see com.westerasoft.common.tag.BaseTag#write(java.io.OutputStream)
*/
public void write(OutputStream output) {
// TODO Auto-generated method stub
}
/**
* @return
*/
public String getProperty() {
return property;
}
/**
* @param string
*/
public void setProperty(String string) {
property = string;
}
/**
* @return
*/
public String getDefaultValue() {
return defaultValue;
}
/**
* @param string
*/
public void setDefaultValue(String string) {
defaultValue = string;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -