提交表单后action没反应 加了断点根本没执行
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>添加折扣信息</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<s:actionmessage/>
<s:actionerror/>
<s:head theme="" />
<a href="index.jsp">首页</a>
<a href="mdiscount!loadAll.action">折扣列表</a>
<form action="mdiscount!addModel.action" method="post" name="myForm" enctype="multipart/form-data">
<table>
<tr>
<td>
<s:textfield label="商品名称" name="newmodel.name"></s:textfield>
</td>
</tr>
<tr>
<td>
<s:textfield label="原 价" name="newmodel.original"></s:textfield>
</td>
</tr>
<tr>
<td><s:textfield label="折扣价" name="newmodel.discount"></s:textfield></td>
</tr>
<tr>
<td><s:textfield label="Vip折扣价" name="newmodel.vipDiscount"></s:textfield></td>
</tr>
<tr>
<td>
<s:select label="商场" name="newmodel.EEnterprise" list="enterpriseList"
listKey="id" listValue="name"></s:select>
</td>
</tr>
<tr>
<td>
<s:doubleselect label="品牌" name="newmodel.MBrand" list="brandList" formName="myForm"
listKey="id" listValue="name" doubleListKey="id" doubleListValue="name"
doubleName="子品牌" doubleList="brandLeaf.get(top.id)"></s:doubleselect>
</td>
</tr>
<tr>
<td>
<s:doubleselect label="分类" name="newmodel.MClassification" list="classificationList" formName="myForm"
listKey="id" listValue="name" doubleListKey="id" doubleListValue="name"
doubleName="子类" doubleList="classificationLeaf.get(top.id)"></s:doubleselect>
</td>
</tr>
<tr>
<td>
<s:file label="图片" name="file" accept="image/bmp,image/png,image/gif,image/JPEG,image/jpg,image/pjpeg ">
</s:file>
</td>
</tr>
<tr>
<td>
<s:datetimepicker name="newmodel.beginDate" toggleType="explode"
value="today" formatLength="long" label="开始日期" >
</s:datetimepicker>
</td>
</tr>
<tr>
<td>
<s:datetimepicker name="newmodel.endDate" toggleType="explode"
value="today" formatLength="long" label="结束日期" >
</s:datetimepicker>
</td>
</tr>
<tr>
<td><s:textfield label="备注信息" name="newmodel.describes"></s:textfield></td>
</tr>
<tr>
<td>
<s:submit value="提交" align="left"></s:submit>
</td>
</tr>
</table>
</form>
</body>
</html>
--------------------编程问答-------------------- 用浏览器调试下,看看控制台里输出的路径是什么,是不是进了你的action,没进,说明你的配置有问题 --------------------编程问答-------------------- 那么基本上可以断定是你的getter/setter方法出了问题。你看下是哪个属性造成的。 --------------------编程问答-------------------- 确定是以debug模式启动的? --------------------编程问答-------------------- 是不是配置Action不对啊 ,还有 你可以在Action方法的开始位置在后台输出一些调试信息看看了 --------------------编程问答-------------------- 看看配置文件吧 --------------------编程问答-------------------- 问题应该出在配置文件中 --------------------编程问答-------------------- 应该是没得调用。。 --------------------编程问答-------------------- +1 --------------------编程问答-------------------- 一层一层来,没执行,说明没进入ACTION中,为什么没进?查看action中方法名以及配置文件是否配置正确.
补充:Java , Web 开发