li921228527 2017-07-28 06:38 采纳率: 0%
浏览 844

SSH框架的提交按钮无法执行提问

HTTP Status 404 - There is no Action mapped for namespace / and action name save.

type Status report

message There is no Action mapped for namespace / and action name save.

description The requested resource is not available.

struts文件
<?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">


<!-- 将struts2的ui模式设置为simple -->


<!-- =================基础设置========================================== -->
<package name="login" extends="struts-default" namespace="/">
    <global-results>
        <result name="error">/errors/errorinfo.jsp</result>
        <result name="auth">/errors/auth.jsp</result>
        <result name="uploaderror">/errors/uploaderror.jsp</result>
    </global-results>
    <!-- 登录列表 -->
    <action name="login" class="com.heb.login.action.LoginAction"   method="login">
        <result name="success"  type="redirect">welcome.html</result>   
    </action>       
    <!-- 新闻动态 -->
    <action name="save" class="com.heb.companyNews.action.companyNewsAction"    method="save">
        <result name="success" >/companyNews/news-list.html</result>    
    </action>

</package>

save方法
public String save() {
try {
if (null==news.getId()) {

newsDAO.save(news);
}

return SUCCESS;
} catch (Exception e) {
// TODO: handle exception
return ERROR;
}
}

  • 写回答

2条回答 默认 最新

  • 夕阳雨晴 2017-07-28 06:45
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?