<logic:equal name="account" value="<%=null%>" property="account" scope="session">
<tr><TD> <bean:write name="account" property="account"/>欢迎回来 </TD> </tr>
</logic:equal>
<logic:empty name="account" property="account" scope="session">
<tr><TD> 你尚未登录</TD> </tr>
</logic:empty>
我想通过以上代码:来实现是否登录的动态信息,可是不行,难道一定要用JSP的<%%>来写吗?
这是我的action:
MemberForm model = (MemberForm)form;
boolean result = MemberDAO.getInstance().checkLogin(model);
if(result){
HttpSession session = req.getSession();
session.setAttribute("account",model);
return mapping.findForward("succeed");
}
else
return mapping.findForward("faild");
希望各位能指点迷津。
<tr><TD> <bean:write name="account" property="account"/>欢迎回来 </TD> </tr>
</logic:equal>
<logic:empty name="account" property="account" scope="session">
<tr><TD> 你尚未登录</TD> </tr>
</logic:empty>
我想通过以上代码:来实现是否登录的动态信息,可是不行,难道一定要用JSP的<%%>来写吗?
这是我的action:
MemberForm model = (MemberForm)form;
boolean result = MemberDAO.getInstance().checkLogin(model);
if(result){
HttpSession session = req.getSession();
session.setAttribute("account",model);
return mapping.findForward("succeed");
}
else
return mapping.findForward("faild");
希望各位能指点迷津。
解决方案 »
- struts2表单提交问题
- jdbc操作中,找不到配置文件???????
- 无奈自己写了一个简单的JDBC查询缓存,分享一下
- Tomcat发布Web应用访问Weblogic发布的EJB服务
- 推荐 Eclipse好书
- <jsp:include page="<%=filename%>.txt" flush ="true" />?>
- JSP开发问题集
- 所有关于jsp和servlet类的详细用法和描述在那里可以找到呀?
- jsp中连接SQL Server
- Disconnected from the target VM, address: '127.0.0.1:54406', transport: 'socket'
- 怎么设置combobox下拉列表的宽度??
- 如何把URL编码呢?难后在CLASS里如何解码呢?
<tr><TD> <bean:write name="account" property="account"/>欢迎回来 </TD> </tr>
</logic:present>
<logic:notPresent name="account" scope="session">
<tr><TD> 你尚未登录</TD> </tr>
</logic:notPresent>