<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head> <title>添加头像页面</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="StyleSheet" href="../css/table.css" type="text/css" />
<link rel="StyleSheet" href="../css/check.css" type="text/css" charset="GB2312"/>
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../js/check.js" charset="GB2312"></script>
</head> <body>
<div class="title">
<h1>
智慧城市后台管理系统——添加头像
</h1>
</div>
<form action="addFace.action" enctype="multipart/form-data"
method="post" id="mc-form">
<table width="90%" id="mytab" border="1" class="t1">
<tr class="a1">
<th colspan="2" scope="col">
添加头像信息
</th>
</tr>
<tr>
<th scope="row">
头像性别:
</th>
<td>
<input type="radio" checked="checked" name="FSex" value="男" />
男
<input type="radio" name="FSex" value="女" />
女
</td>
</tr>
<tr class="a1">
<th scope="row">
头像位置:
</th>
<td>
<input type="file" name="image" class="editbox4" id="mustWrite"/>
<font color="red">支持宽度为40px,长度40px</font>
</td>
</tr>
<tr>
<th colspan="2" scope="row">
<input type="submit" name="Submit" value="提交" id="send"/>
<input name="reset" type="reset" id="reset" value="重置" />
</th>
</tr>
</table>
<font color="red">${feedback}</font>
</form>
</body>
</html>这是jsp代码:中间也没有<!-- -->
这个是错误信息
2013-9-8 12:09:07 org.apache.jasper.compiler.TldLocationsCache tldScanJar
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
下面是struts2的配置文件的一段
<action name="addFace" class="com.action.FaceAction" method="addFace">
<interceptor-ref name="fileUpload">
<param name="maximumSize">1024*1024</param>
<param name="allowedTypes">image/bmp,image/x-png,image/png,image/gif,image/jpeg,image/jpg,image/pjpeg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="success" type="chain">lookAllFace</result>
<result name="error">addFace.jsp</result>
<result name="input">addFace.jsp</result>
</action>
这个主要是都进去不去Action,配置肯定没错,因为在原先的机子上就没事
上个编辑器是MyEclipse9这回换的是MyEclipse8.5,使得都是tomcat7
一点击提交就进入result=“input”,连Action都不进。怎么回事啊?跟上方的报错有关吗struts2jspmyeclipsetomcat
试试看
<!--添加改动↓ -->
<interceptor-ref name="fileUpload">
<param name="maximumSize">1024*1024</param>
<param name="allowedTypes">image/bmp,image/x-png,image/png,image/gif,image/jpeg,image/jpg,image/pjpeg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<!--添加改动↑ -->
<result name="success" type="chain">lookAllFace</result>
<result name="error">addFace.jsp</result>
</action>
Service与Dao就不贴上来了,主要是这个在我原来的电脑仍然可以,现在也可以,别的电脑上也可以....
我也无语,您有过这样的经历,或者什么偏方吗?
哦了,去试试
tomcat 7对EL表达式的语法要求比较严格,例如"${owner.new}"因包含关键字new就会导致解析出错。
问题是出来了,怎么解决呢?有三种,如下:
第一种:严格遵守java规范,修改对象的属性名称,要求不包含java关键字;
第二种:修改EL表达式,例如"${owner.new}"可以修改为"${owner['new']}";
第三种:修改tomcat属性,忽略对EL表达式的关键字检查。修改$CATALINA_BASE/conf/catalina.properties文件,添加org.apache.el.parser.SKIP_IDENTIFIER_CHECK=true选项。