当前位置: 代码迷 >> J2EE >> frame中获取session有关问题
  详细解决方案

frame中获取session有关问题

热度:99   发布时间:2016-04-22 01:31:14.0
frame中获取session问题
Java code
                       <action name="dologin" class="userAction" method="doLogin">               <result name="success">/index.html</result>               <result name="input">/index.jsp</result>               </action>  

UserAction
Java code
public String doLogin()    {        user =userService.checkLogin(getUser());        if(user!=null)        {            request.getSession().setAttribute("user", user);            return SUCCESS;        }else{        return INPUT;        }    }

index.html
HTML code
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>管理系统</title><style>body{  scrollbar-base-color:#C0D586;  scrollbar-arrow-color:#FFFFFF;  scrollbar-shadow-color:DEEFC6;}</style></head><frameset rows="60,*" cols="*" frameborder="no" border="0" framespacing="0">  <frame src="../top.html" name="topFrame" scrolling="no">  <frameset cols="180,*" name="btFrame" frameborder="NO" border="0" framespacing="0">    <frame src="../menu.html" noresize name="menu" scrolling="yes">    <frame src="../main.html" noresize name="main" scrolling="yes">  </frameset></frameset><noframes>    <body>您的浏览器不支持框架!</body></noframes></html>

top.html
HTML code
      <td align="right" height="26" style="padding-right:10px;line-height:26px;">            您好:<span class="username">[color=#FF0000]这里怎么获取登陆的session[/color]</span>,欢迎使用xxxx管理系统!            [<a href="http://www.865171.cn" target="_blank">网站主页</a>]            [<a href="" target="_blank">修改密码</a>]            [<a href="exit" target="_top">注销退出</a>]&nbsp;      </td>

子页获取session的问题


------解决方案--------------------
你是html当然不能活的session,换成JSP
  相关解决方案