这是struts。xml文件 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"><struts> <!-- struts2的action必须放在一个指定的包空间下定义 --> <package name="default" extends="struts-default"> <!-- 定义处理请求URL为login.action的Action --> <action name="helloworld_*" method="{1}" class="an.cm.HelloWorldAction"> <!-- 定义处理结果字符串和资源之间的映射关系 --> <result name="add">/{1}.jsp</result> <result name="update">/{1}.jsp</result> </action> </package> <constant name="struts.enable.DynamicMethodInvocation" value="true" /> </struts>这是result.jsp文件<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><!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=ISO-8859-1"><title>Insert title here</title></head><body>This is result.jsp;</body></html>这是add.jsp文件<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><!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=ISO-8859-1"><title>Insert title here</title></head><body>This is add.jsp;</body></html>这是update.jsp文件<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><!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=ISO-8859-1"><title>Insert title here</title></head><body>This is update.jsp;</body></html>然后按照文本struts.xml文件中的方法运行出现下列这种情况
添加回答
举报
0/150
提交
取消