GetStoreNameTag.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:g2 作者:
@Override
public int doEndTag() throws JspTagException {
    try {
        WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());//获取SPRING的上下文
        StoreService storeService = (StoreService) ctx.getBean("storeService");
        Stores stores =  storeService.findById(Long.parseLong(id));
        if(stores!=null){
            pageContext.getOut().write(stores.getName());
        }else if(id.equals("0")){
            pageContext.getOut().write("<b>超级管理员</b>");
        }else{
            pageContext.getOut().write("<b>项目已不存在</b>");

        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return EVAL_PAGE;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号