taitoushan 2009-08-14 12:48
浏览 306
已采纳

为啥我的action怎么都不执行呢

<%@ include file="/common/taglibs.jsp"%>
<%@ page pageEncoding="GBK"%>



工作动态添加 function load(){ var url = document.URL; var i = url.indexOf("="); var type = url.substring(i+1); if(type == 1){ document.getElementById("biaotou").innerHTML = "添加 机构介绍模块 文章"; }else if(type == 2){ document.getElementById("biaotou").innerHTML = "添加 工作动态模块 文章"; }else if(type == 3){ document.getElementById("biaotou").innerHTML = "添加 全国性文件模块 文章"; }else if(type == 4){ document.getElementById("biaotou").innerHTML = "添加 省部文件模块 文章"; }else if(type == 5){ document.getElementById("biaotou").innerHTML = "添加 中心文件模块 文章"; }else if(type == 6){ document.getElementById("biaotou").innerHTML = "添加 归集模块 文章"; }else if(type == 7){ document.getElementById("biaotou").innerHTML = "添加 提取模块 文章"; }else if(type == 8){ document.getElementById("biaotou").innerHTML = "添加 贷款模块 文章"; }else if(type == 9){ document.getElementById("biaotou").innerHTML = "添加 联名卡模块 文章"; }else if(type == 10){ document.getElementById("biaotou").innerHTML = "添加 行风建设模块 文章"; }else if(type == 11){ document.getElementById("biaotou").innerHTML = "添加 对外承诺模块 文章"; }else if(type == 12){ document.getElementById("biaotou").innerHTML = "添加 意见建议模块 文章"; }else if(type == 13){ document.getElementById("biaotou").innerHTML = "添加 财务公报模块 文章"; }else if(type == 14){ document.getElementById("biaotou").innerHTML = "添加 网上课堂模块 文章"; } } function sure(){ alert("表单提交"); contentForm.submit; }
























标题:
来源:
内容:

 
保存/html:button

/html:form


配置文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">




    <action path="/edit/addnew" parameter="method" input="/edit/addNew.jsp"
        name="contentForm" type="com.jtpsoft.webapp.action.xtgl.ContentAction"
        scope="request" unknown="false" validate="false">
        <forward name="list" path="/edit/gzdt.jsp"></forward>
    </action>

[b]问题补充:[/b]
点了按钮之后,没有任何反应,后台也没有打出任何信息
[b]问题补充:[/b]

就跟没提交一样,没动静
[b]问题补充:[/b]
手动请求的话找不到网页,换成普通form也没反应
[b]问题补充:[/b]
那个form我也改了 [color=blue]


[/color]

还有按钮也改了[color=blue][/color]

[color=red]但是还是不行[/color]
[b]问题补充:[/b]
[b][/b][color=darkred]
[DEBUG] 15:15:18.328 session creating...
==>>/bdgjj/edit/edit/addnew.do
[DEBUG] 15:23:11.734 session attribute adding...
[ERROR] 15:23:11.734 用户信息失效,系统要求用户重新登录!
==>>/bdgjj/login.do
[DEBUG] 15:23:11.750 session attribute adding...
[/color]
[b]问题补充:[/b]
[color=red]而且我的ContentAction继承我自己的一个BaseAction

BaseAction继承了DispatchAction,所以那个配置文件那么写应该是对的吧[/color]

  • 写回答

12条回答 默认 最新

  • walsh_bupt 2009-08-14 15:14
    关注

    你的Web.xml也需要检查下,尤其是对于struts的配置
    部分代码如下:
    <?xml version="1.0" encoding="UTF-8"?>
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    index.jsp

    <!-- Standard Action Servlet Configuration (with debugging) -->

    action
    org.apache.struts.action.ActionServlet

    config
    /WEB-INF/struts-config.xml


    debug
    2


    detail
    2

    2

    <!-- Standard Action Servlet Mapping -->

    action
    [size=medium][b][color=red]*.do[/color][/b] [/size]

    [b][size=medium][color=darkblue]注意:红的字体显示部分。[/color][/size][/b]

    [size=medium][b]另外:你的JSP页面,action的值不要再加“/”了。具体的提交方式采用的上面给你写的,你写的JavaScript提交方式就不对。[/b][/size]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(11条)

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型