struts 标签
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String username="thanks";
request.setAttribute("username",username);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
</head>
<body>
This is my JSP page. <br>
<bean:define id="username1" name="username" scope="request" toScope="session">
</bean:define>
UserName: <bean:write name="username1"/> <BR>
UserName: ${sessionScope.username1}
</body>
</html>
我的页面怎么输出的没有${sessionScope.username1}的值呢,而是把这段代码输出来了。