struts视图文件
login.jsp多功能页面
<%@ page contentType="text/html;charset=ISO8859_1" language="java" %>
<%@ taglib uri=
"/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri=
"/WEB-INF/struts-html.tld" prefix="html" %>
<META http-equiv=Content-Type content=
"text/html; charset=gb2312">
<body vLink=
"#006666" link="#003366" bgColor="#E0F0F8">

<html:img pageKey=
"title.imageEnter" altKey="title.imgEnterHint"/>
<form action=
"login.do?action=login" method="post">

<bean:message key=
"item.username"/>
<input size=
"15" name="name">login<p>
<html:submit>
<bean:message key=
"item.submit"/>
</html:submit>

</form>
<form action=login.do?action=addUser method=
"post">
<bean:message key=
"item.username"/>
<input size=
"15" name="name">addUser<p>
<html:submit>
<bean:message key=
"item.submit"/>
</html:submit>
</form>
<a href =
"login.do?action=getUser">getUser</a>
<a href =
"/javabean/operSql.jsp">operSql</a>
right.jsp
<%@ page contentType=
"text/html;charset=ISO8859_1" language="java" %>
<%@ taglib uri=
"/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri=
"/WEB-INF/struts-html.tld" prefix="html" %>
<META http-equiv=Content-Type content=
"text/html; charset=gb2312">
<%@ page import =
"hb.*,java.util.*" %>
<%
UserForm formBean1 = (UserForm)request.getAttribute(
"formBean1");
if(formBean1 != null && formBean1.getName()!=null){
%>
<h1><img src=
"smile.gif">
<bean:message key=
"title.welcome"/>
<%=formBean1.getName()%>
<bean:message key=
"title.classmate"/>
<%
}else{
%>
<bean:message key=
"label.deny"/>

<%}
%>
</h1><br>
<a href=
"login.jsp">
<bean:message key=
"item.loginAgain"/>
</a>||
<a href=
"regist.do">
<bean:message key=
"item.regist"/>
</a>
<%
List list=(List)session.getAttribute(
"userList");
  
//out.println("list:"+list);
if(list!=null){
  for(int i=0;i<list.size();i++){
    User g=(User)list.get(i);
    
//out.println(g.getId());
    out.println(g.getName()+
"<br>");
  }
}     
%>

error.jsp
<%@ page contentType=
"text/html;charset=ISO8859_1" language="java" %>
<%@ taglib uri=
"/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri=
"/WEB-INF/struts-html.tld" prefix="html" %>
<META http-equiv=Content-Type content=
"text/html; charset=gb2312">

<h1><p><img src=
"cry.gif">
<html:errors/>

</p></h1>
<a href=
"login.jsp">
<bean:message key=
"item.loginAgain"/>
</a>||

<a href=
"regist.do">
<bean:message key=
"item.regist"/>
</a>

lunzi   2006-05-24 00:01:18 评论:1   阅读:1056   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog