为了账号安全,请及时绑定邮箱和手机立即绑定

后台执行方法,网页报404错误

<?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_*" method="{1}" class="com.imooc.action.HelloWorldAction">

<result>/result.jsp</result>

<result name="add">/{1}.jsp</result>

<result name="update">/{1}.jsp</result>

</action>


</package>

<constant name="struts.enable.DynamicMethodInvocation" value="false"></constant>

</struts>    

package com.imooc.action;


import com.opensymphony.xwork2.ActionSupport;


public class HelloWorldAction extends ActionSupport{

@Override

public String execute() throws Exception {

System.out.println("执行Action");

return SUCCESS;

}

public String add(){

System.out.println("执行add");

return "add";

}

public String update(){

System.out.println("执行upate");

return "update";

}

}

HTTP Status 404 - /HelloWorld/add.jsp

type Status report

message /HelloWorld/add.jsp

description The requested resource is not available.


正在回答

1 回答

浏览器地址栏应该这样输入:127.0.0.1:8080/你的工程名/helloworld_add

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

后台执行方法,网页报404错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信