📄 userfileinposttag.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: UserFileInPostTag.java
package com.laoer.bbscs.web.tag;
import com.laoer.bbscs.sys.*;
import com.laoer.bbscs.web.servlet.UserCheck;
import com.laoer.comm.util.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.struts.util.*;
import org.springframework.context.support.AbstractApplicationContext;
public class UserFileInPostTag extends TagSupport
{
private String name;
private String idProperty;
private String nameProperty;
private String userCheck;
public UserFileInPostTag()
{
name = null;
idProperty = null;
nameProperty = null;
userCheck = null;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getIdProperty()
{
return idProperty;
}
public void setIdProperty(String idProperty)
{
this.idProperty = idProperty;
}
public String getNameProperty()
{
return nameProperty;
}
public void setNameProperty(String nameProperty)
{
this.nameProperty = nameProperty;
}
public String getUserCheck()
{
return userCheck;
}
public void setUserCheck(String userCheck)
{
this.userCheck = userCheck;
}
public int doStartTag()
throws JspException
{
return 0;
}
public int doEndTag()
throws JspException
{
String output = "";
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();
UserFileInPostCache cache = (UserFileInPostCache)AppContext.getInstance().getAppContext().getBean("userFileInPostCache");
if(userCheck == null || userCheck.length() == 0)
{
if(name != null && idProperty != null && nameProperty != null)
{
Object idvalue = RequestUtils.lookup(pageContext, name, idProperty, null);
Object namevalue = RequestUtils.lookup(pageContext, name, nameProperty, null);
if(idvalue != null && namevalue != null)
{
output = cache.getUserFileInPostFromCache(((Long)idvalue).longValue(), String.valueOf(namevalue));
output = Util.replace(output, "#level#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.level"));
output = Util.replace(output, "#article#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.article"));
output = Util.replace(output, "#score#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.score"));
output = Util.replace(output, "#from#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.from"));
output = Util.replace(output, "#register#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.register"));
} else
{
return 0;
}
} else
{
return 0;
}
} else
{
UserCheck uc = (UserCheck)RequestUtils.lookup(pageContext, userCheck, "request");
if(uc == null)
uc = new UserCheck(request, response);
if(!uc.isGuest())
{
output = cache.getUserFileInPostFromCache(uc.getId(), uc.getUsername());
output = Util.replace(output, "#level#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.level"));
output = Util.replace(output, "#article#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.article"));
output = Util.replace(output, "#score#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.score"));
output = Util.replace(output, "#from#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.from"));
output = Util.replace(output, "#register#", Constant.MESSAGE.getMessage(request.getLocale(), "userinfo.register"));
} else
{
return 0;
}
}
ResponseUtils.write(pageContext, output);
return 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -