<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="helloworld" class="com.imooc.action.HelloWorld" >
<result>/result.jsp</result>
</action>
<action name="addAction" method="add" class="com.imooc.action.HelloWord">
<result name="add">/add.jsp</result>
</action>
<action name="updateAction" class="com.imooc.action.HelloWord" method="update">
<result name="update">/update.jsp</result>
</action>
</package>
<constant name="struts.enable.DynamicMethodInvocation" value="false"></constant>
</struts>
package com.imooc.action;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport{
public String add(){
return "add";
}
public String update(){
return "update";
}
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
System.out.println("Action执行");
return SUCCESS;
}
}
输入 :http://localhost:8080/S11/addAction.action
出现错误如下:
type Status report
message /S11/addAction.action
description The requested resource is not available.
qq_愿有智慧_03738976
相关分类