有关session问题:
如下我想得到不同的session值,怎么弄,请大虾帮忙!
<%
if(document.getElementById( '11 ').innerHTML)
{
String s= "100fz-001 ";
session.setAttribute( "goodsname ",s);
}
else
(
String s= "100mp4001 ";
session.setAttribute( "goodsname ",s);
)
%>
<td> <a href= "xiangJie.jsp "> 查看详情 </a> | <span id= "11 "> <a href= "p4.jsp "> 购买 </a> </span> </td>
<td> <a href= " "> 查看详情 </a> | <span id= "12 "> <a href= "p4.jsp "> 购买 </a> </span> </td>
------解决方案-------------------- <script>
if(document.getElementById( '11 ').innerHTML)
{
<%
String s= "100fz-001 ";
session.setAttribute( "goodsname ",s);
%>
}
else
{
<%
String s= "100mp4001 ";
session.setAttribute( "goodsname ",s);
%>
}
</script>
------解决方案--------------------String g=(String)session.getAttribute( "goodsname ");
这句话应该能获得值 就是不知道 你 <%@page session= "true "%> 没 默认的是true
------解决方案--------------------xuexi