急!普通JSP表单无法提交(点提交没反应),在线等呀

chaoyueqsq 2012-04-09 09:47:29
贴上代码:
<%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加资讯</title>
</head>
<body>
<table width="780" align="center" cellspacing="0"
background="images/bodybg.jpg">
<tr>
<td >
<h3 align="center">请输入资讯详情</h3>
<div align="center">
<s:actionerror cssClass="error"/>
<s:form action="AddInfo" >
<s:textfield name="infoTitle" label="标题" />
<s:textfield name="infoOrder" label="优先级"/>
<s:textfield name="infoAuthor" label="作者"/>
<s:textarea name="content" cols="50" row="8" label="内容"/>
<s:textfield name="infoUrl" label="URL"/><br>
<s:submit value="提交" />
</s:form>
</div>
</td>
</tr>
</table>
</body>
</html>
...全文
987 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
chaoyueqsq 2012-04-11
  • 打赏
  • 举报
回复
一个字母害死人呀!那个excute 应该是execute
huxinxinxin 2012-04-10
  • 打赏
  • 举报
回复
应该是你导入的包有问题,过程没有错误。
javamyself 2012-04-10
  • 打赏
  • 举报
回复
你form中的action 是不是少个.do?
happyinge 2012-04-10
  • 打赏
  • 举报
回复
如果debug时,无法进入ACTION,可以肯定不是ACTION类的问题,而是struts.xml配置文件或页面表单提交的问题,在你的项目中你设置的访问action的方式是什么?
24K純帥 2012-04-09
  • 打赏
  • 举报
回复
是配置写的有问题,还是LZ的BASEAction有问题啊
zhuwensheng2011 2012-04-09
  • 打赏
  • 举报
回复
你的包名有问题,你这样写系统会认为是约定,因为约定优于配置,所以建议包名中不要有Action
chaoyueqsq 2012-04-09
  • 打赏
  • 举报
回复
<action name="AddInfo" class="com.ns.Action.AddInfoAction">
<result name="success">/AddInfo.jsp</result>
<result name="input">/error.jsp</result>
<result name="failure">/error.jsp</result>
<!-- 显式引用系统默认拦截器栈 -->
<interceptor-ref name="defaultStack"/>
</action>
chaoyueqsq 2012-04-09
  • 打赏
  • 举报
回复
我发现我把action换成其他的Action就可以提交。应该是Action有问题。大家帮我看看Action哪里出了问题。用的是SSH框架。麻烦各位大牛了。

package com.ns.Action;

import com.opensymphony.xwork2.ActionContext;

import java.util.*;
import com.ns.Action.base.BaseAction;
import com.ns.Service.AppManager;
import com.ns.exception.AppStoreException;

public class AddInfoAction extends BaseAction {
String infoTitle;
int infoOrder;
String infoAuthor;
String content;
String infoUrl;
Date infoTime;
public String excute() throws Exception {
Integer infoId=mgr.addInfo(infoTitle, infoOrder, infoAuthor, content, infoUrl, infoTime);
if(infoId!=null&&infoId>0) {
return SUCCESS;
}
else {
addActionError("添加资讯失败,请重新填写。");
return "failure";
}
}
public String getInfoTitle() {
return infoTitle;
}
public void setInfoTitle(String infoTitle) {
this.infoTitle = infoTitle;
}
public int getInfoOrder() {
return infoOrder;
}
public void setInfoOrder(int infoOrder) {
this.infoOrder = infoOrder;
}
public String getInfoAuthor() {
return infoAuthor;
}
public void setInfoAuthor(String infoAuthor) {
this.infoAuthor = infoAuthor;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getInfoUrl() {
return infoUrl;
}
public void setInfoUrl(String infoUrl) {
this.infoUrl = infoUrl;
}
public Date getInfoTime() {
return infoTime;
}
public void setInfoTime(Date infoTime) {
this.infoTime = infoTime;
}

}
qqliang1314 2012-04-09
  • 打赏
  • 举报
回复
把表单标签换成普通表单属性试试
昨日凡阳 2012-04-09
  • 打赏
  • 举报
回复
[Quote=引用楼主 的回复:]
贴上代码:
<%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:/……
[/Quote]

给个method。
<s:form action="AddInfo" method="post">
ypchen_chjs 2012-04-09
  • 打赏
  • 举报
回复
有没有报什么错误?贴出来

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧