<%@ page language="java" pageEncoding="ISO-8859-1"%> <%@page import="org.apache.struts.action.ActionMessages"%> <%@page import="org.apache.struts.action.ActionErrors"%> <%@page import="org.apache.struts.Globals"%> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%> <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html:html lang="true"> <head> <html:base /> <title>ok.jsp</title> </head> <body> ActionMessages.GLOBAL_MESSAGE:<%=ActionMessages.GLOBAL_MESSAGE%><br /> ActionErrors.GLOBAL_MESSAGE:<%=ActionErrors.GLOBAL_MESSAGE%><br /> Globals.MESSAGE_KEY:<%=Globals.MESSAGE_KEY%><br /> Globals.ERROR_KEY:<%=Globals.ERROR_KEY%><br /> </body> </html:html>
显示的结果:
ActionMessages.GLOBAL_MESSAGE:org.apache.struts.action.GLOBAL_MESSAGE
ActionErrors.GLOBAL_MESSAGE:org.apache.struts.action.GLOBAL_MESSAGEGlobals.MESSAGE_KEY:org.apache.struts.action.ACTION_MESSAGEGlobals.ERROR_KEY:org.apache.struts.action.ERROR