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/" );

 

 

你可能感兴趣的:(session)