jstl删除session,choose,动态获取request当前工程路径

1.jstl标签c:remove删除session

request.getSession().setAttribute("ssmsg", "修改成功"); <c:remove var="ssmsg" scope="session" />

 

2.jstl标签choose说明

<c:choose>
                <c:when test="${c.activityType==0}">
                    <td><a href="${c.accessUrl}${c.id}" target="_blank">预览</a></td>
                </c:when>
                <c:otherwise>
                    <td>-</td>
                </c:otherwise>
            </c:choose>

 

3.动态获取request当前工程路径

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
//            activity.setAccessUrl( SysConf.APP_SERVER_ADDR + "activity/look/" );
            activity.setAccessUrl( basePath + "activity/look/" );

 

 

posted @ 2014-05-25 10:47  全新时代-小小程序员大梦想  阅读(676)  评论(4编辑  收藏  举报