遇到错误:
1.
fileupload取编辑框的值乱码。
String value = item.getString();
改为
String value = item.getString("UTF-8");
http://argen.bokee.com/viewdiary.14753538.html
2.
java.sql.SQLException: General error, message from server: "Incorrect string value: '\xD0\xD0\xD2\xB5\xB6\xAF...' for column 'parentclass' at row 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1588)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at org.mram.news.ClassDAO.update(ClassDAO.java:138)
原因是因为mysql在建表时是用intan1编码的(就算建表后改成utf-8)也不行~~~
要删表,再重新建表才行。
3.
[ERROR] 2009-09-10 20:27:45 org.apache.commons.beanutils.PropertyUtils - Method invocation failed.
java.lang.IllegalArgumentException: argument type mismatch
Do you have this setting in your form?
enctype="multipart/form-data"
无设form的编码
4.
[ERROR] 2009-09-11 21:13:35 org.springframework.web.struts.ContextLoaderPlugIn - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/fileinfos' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'fileinfosDaoManager' while setting bean property 'fileinfosDaoManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileinfosDaoManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'fileinfosDao' of bean class [com.ust.service.impl.FileinfosManagerImpl]: Bean property 'fileinfosDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileinfosDaoManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'fileinfosDao' of bean class [com.ust.service.impl.FileinfosManagerImpl]: Bean property 'fileinfosDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by:
org.springframework.beans.NotWritablePropertyException: Invalid property 'fileinfosDao' of bean class [com.ust.service.impl.FileinfosManagerImpl]: Bean property 'fileinfosDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
依赖注入无setter方法~~
5.
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null on action /goselect.do
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
action无配formbean
action要指定相关的form bean
6.
javax.servlet.ServletException: No getter method for property file1 of bean
<form>标签中的file1在frombean中无对应的file1属性
心得:
1
在struts中jsp的<from>要对应formbean的属性~~~~~
两者的名称很重要~~~~
如果不对应就会提示,很多这些那些的设置属性错误~~~~
file_0:false
file[0]:true
System.out.println("file[0]:"+elements.containsKey("file[0]"));
FileinfosForm f = (FileinfosForm) form;
file[0]:true
file.gif
1.
fileupload取编辑框的值乱码。
String value = item.getString();
改为
String value = item.getString("UTF-8");
http://argen.bokee.com/viewdiary.14753538.html
2.
java.sql.SQLException: General error, message from server: "Incorrect string value: '\xD0\xD0\xD2\xB5\xB6\xAF...' for column 'parentclass' at row 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1588)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at org.mram.news.ClassDAO.update(ClassDAO.java:138)
原因是因为mysql在建表时是用intan1编码的(就算建表后改成utf-8)也不行~~~
要删表,再重新建表才行。
3.
[ERROR] 2009-09-10 20:27:45 org.apache.commons.beanutils.PropertyUtils - Method invocation failed.
java.lang.IllegalArgumentException: argument type mismatch
Do you have this setting in your form?
enctype="multipart/form-data"
无设form的编码
4.
[ERROR] 2009-09-11 21:13:35 org.springframework.web.struts.ContextLoaderPlugIn - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/fileinfos' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'fileinfosDaoManager' while setting bean property 'fileinfosDaoManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileinfosDaoManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'fileinfosDao' of bean class [com.ust.service.impl.FileinfosManagerImpl]: Bean property 'fileinfosDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileinfosDaoManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'fileinfosDao' of bean class [com.ust.service.impl.FileinfosManagerImpl]: Bean property 'fileinfosDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by:
org.springframework.beans.NotWritablePropertyException: Invalid property 'fileinfosDao' of bean class [com.ust.service.impl.FileinfosManagerImpl]: Bean property 'fileinfosDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
依赖注入无setter方法~~
5.
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null on action /goselect.do
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
action无配formbean
action要指定相关的form bean
6.
javax.servlet.ServletException: No getter method for property file1 of bean
<form>标签中的file1在frombean中无对应的file1属性
心得:
1
在struts中jsp的<from>要对应formbean的属性~~~~~
两者的名称很重要~~~~
如果不对应就会提示,很多这些那些的设置属性错误~~~~
file_0:false
file[0]:true
System.out.println("file[0]:"+elements.containsKey("file[0]"));
FileinfosForm f = (FileinfosForm) form;
file[0]:true
file.gif