<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<script type="text/javascript">
</script>
<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>
<center>
景点添加
<form action="<%=path %>/scenery/scenicAdd.action" enctype="multipart/form-data" method="post">
<table style="text-align: center">
<tr>
<td> 景点名称</td>
<td> <input type="text" name="scenery.sname"/></td>
</tr>
<tr>
<td> 交通信息</td>
<td> <input type="text" name="scenery.strafficInfo"/></td> </tr>
<tr>
<td> 景点设施</td>
<td> <input type="text" name="scenery.sfacility"/></td>
</tr>
<tr>
<td> 景点主题</td>
<td> <input type="text" name="scenery.stheme"/></td>
</tr>
<tr>
<td> 景点星级</td>
<td> <input type="text" name="scenery.slevel"/></td></tr>
<tr>
<td> 鹏运价格</td>
<td> <input type="text" name="scenery.spyPrice"/></td>
</tr>
<tr>
<td> 市场价格</td>
<td> <input type="text" name="scenery.setPrice"/></td></tr>
<tr>
<td> 景点描述</td>
<td> <textarea name="sdescription" style="height: 100px; width: 200px;"></textarea></td>
<tr>
<td> 景点图片</td>
<td> <input type="file" name="img"/></td>
</tr>
<td colspan="2">
<input type="submit" value="提交">
<input type="reset" value="重置"/>
</td>
</table>
</form>
${message}
</center>
</body>
</html>
以上是JSP页面<action name="scenicAdd" class="SceneryListAction" method="scenicAdd">
<interceptor-ref name="fileUpload">
<param name="allowedTypes">image/bmp,image/png,image/gif,image/pjpeg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack">
<param name="savePath">fileupload/</param>
</interceptor-ref>
<result name="success">/page/background/scenic/scenicAdd.jsp</result>
<result name="input">/page/background/scenic/scenicAdd.jsp</result>
</action>
以上是Struts2配置
<bean id="sceneryDao" class="com.pengyun.dao.impl.SceneryDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="sceneryService" class="com.pengyun.service.impl.SceneryServiceImpl">
<property name="sceneryDao" ref="sceneryDao"></property>
</bean>
<bean id="SceneryListAction" class="com.pengyun.action.SceneryAction">
<property name="sceneryService" ref="sceneryService"></property>
</bean>Spring管理配置,问题是,在前台点击submit,跳转不到Action中,打了断点。而且Dbug模式。另外,浏览器和myeclipse都没有异常信息,配置文件我也看了很多遍,,但是还是没看出来问题所在,希望大家帮帮忙啊,调好了给分
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<script type="text/javascript">
</script>
<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>
<center>
景点添加
<form action="<%=path %>/scenery/scenicAdd.action" enctype="multipart/form-data" method="post">
<table style="text-align: center">
<tr>
<td> 景点名称</td>
<td> <input type="text" name="scenery.sname"/></td>
</tr>
<tr>
<td> 交通信息</td>
<td> <input type="text" name="scenery.strafficInfo"/></td> </tr>
<tr>
<td> 景点设施</td>
<td> <input type="text" name="scenery.sfacility"/></td>
</tr>
<tr>
<td> 景点主题</td>
<td> <input type="text" name="scenery.stheme"/></td>
</tr>
<tr>
<td> 景点星级</td>
<td> <input type="text" name="scenery.slevel"/></td></tr>
<tr>
<td> 鹏运价格</td>
<td> <input type="text" name="scenery.spyPrice"/></td>
</tr>
<tr>
<td> 市场价格</td>
<td> <input type="text" name="scenery.setPrice"/></td></tr>
<tr>
<td> 景点描述</td>
<td> <textarea name="sdescription" style="height: 100px; width: 200px;"></textarea></td>
<tr>
<td> 景点图片</td>
<td> <input type="file" name="img"/></td>
</tr>
<td colspan="2">
<input type="submit" value="提交">
<input type="reset" value="重置"/>
</td>
</table>
</form>
${message}
</center>
</body>
</html>
以上是JSP页面<action name="scenicAdd" class="SceneryListAction" method="scenicAdd">
<interceptor-ref name="fileUpload">
<param name="allowedTypes">image/bmp,image/png,image/gif,image/pjpeg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack">
<param name="savePath">fileupload/</param>
</interceptor-ref>
<result name="success">/page/background/scenic/scenicAdd.jsp</result>
<result name="input">/page/background/scenic/scenicAdd.jsp</result>
</action>
以上是Struts2配置
<bean id="sceneryDao" class="com.pengyun.dao.impl.SceneryDaoImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="sceneryService" class="com.pengyun.service.impl.SceneryServiceImpl">
<property name="sceneryDao" ref="sceneryDao"></property>
</bean>
<bean id="SceneryListAction" class="com.pengyun.action.SceneryAction">
<property name="sceneryService" ref="sceneryService"></property>
</bean>Spring管理配置,问题是,在前台点击submit,跳转不到Action中,打了断点。而且Dbug模式。另外,浏览器和myeclipse都没有异常信息,配置文件我也看了很多遍,,但是还是没看出来问题所在,希望大家帮帮忙啊,调好了给分
解决方案 »
- 关于struts2 <s:if的用法
- CSS高分解题:样式可以重构,只要能实现 B在左边, A在中间, C在右边。 文档流不可改变
- url 中的。do如何更改为其他例如。jsp
- struts标签
- 为什么请求向tomcat一个网页会出现The requested resource (/insertTable.html) is not available这个问题呢?
- 如何能去掉HTTP标头中的Set-Cookie字段
- 关于jsp的table问题
- 就一张JSP 一张表, 只要能遍历数据输出即可. 我都调试好几天了, 我的第一张JSP网页还没出来, 求大家帮帮我吧.
- 优化查询语句看不懂!太复杂!
- 动态生成的页面背景图案问题?
- 怎样获得当月最后一天?
- web需求文档
form 的action直接=scenicAdd.action看看吧