1.Strut国际化动态文本(声明式处理异常,可以拥有多个占位符):界面

来源:互联网 发布:miao社交软件 编辑:程序博客网 时间:2024/05/18 03:35

index.jsp

<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>  </head>    <body><a href="login.jsp">登录</a> <br><p>  </body></html>

login.jsp

<%@ page language="java" contentType="text/html; charset=GB18030"    pageEncoding="GB18030"%><%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>   <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>     <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=GB18030"><title>Insert title here</title></head><body><html:errors/><form action="${ pageContext.request.contextPath}/login.do" method="post"><bean:message key="login.form.field.username"/>:<input type="text" name="username"><br><bean:message key="login.form.field.password"/>:<input type="password" name="password"><br/><input type="submit" value="<bean:message key="login.form.button.login"/>"></form></body></html>

login_success.jsp

<%@ page language="java" contentType="text/html; charset=GB18030"    pageEncoding="GB18030"%><%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>   <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=GB18030"><title>Insert title here</title></head><body><html:messages id="msg" message="true"><bean:write name="msg"/></html:messages></body></html>


原创粉丝点击