问题描述
- 求助:SSH框架,页面上的数据无法提交到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">所有列表
编号 表名 创建日期
">[modify]
">[delete]/s:label/s:iterator
增加列表
查找列表
解决方案
主要是你的配置文件的问题,要仔细检查
你可以下载一个别人的程序看下
解决方案二:
控制台的信息和错误
[10:23:05] DEBUG interceptor.I18nInterceptor "intercept } "
[10:23:07] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=struts]"
[10:23:07] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=struts]"
[10:23:07] DEBUG xwork2.DefaultActionProxy "Creating an DefaultActionProxy for namespace / and action name ListsAllFind"
[10:23:07] DEBUG support.DefaultListableBeanFactory "Returning cached instance of singleton bean 'ListsAllAction'"
[10:23:07] DEBUG interceptor.I18nInterceptor "intercept '//ListsAllFind' { "
[10:23:07] DEBUG interceptor.I18nInterceptor "applied invocation context locale=zh_CN"
[10:23:07] DEBUG interceptor.I18nInterceptor "before Locale=zh_CN"
[10:23:07] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[cn.daisy.waction.ListsAllAction@14c6abc, com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=struts]"
[10:23:07] DEBUG interceptor.FileUploadInterceptor "Bypassing //ListsAllFind"
[10:23:07] DEBUG interceptor.StaticParametersInterceptor "Setting static parameters {}"
[10:23:07] DEBUG interceptor.ParametersInterceptor "Setting params NONE"
[10:23:07] DEBUG interceptor.ParametersInterceptor "Setting params l.markName => [ map ] "
[10:23:07] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[cn.daisy.waction.ListsAllAction@14c6abc, com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=l]"
[10:23:07] WARN ognl.OgnlValueStack "Error setting expression 'l.markName' with value '[Ljava.lang.String;@b3e75d'"
ognl.OgnlException: target is null for setProperty(null, "markName", [Ljava.lang.String;@b3e75d)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2239)
at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.ASTChain.setValueBody(ASTChain.java:227)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.Ognl.setValue(Ognl.java:737)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)
at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:288)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:199)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
[10:23:07] DEBUG validation.AnnotationValidationInterceptor "Validating //ListsAllFind with method doFindById."
[10:23:07] DEBUG validator.ValidationInterceptor "Invoking validate() on action cn.daisy.waction.ListsAllAction@14c6abc"
[10:23:07] DEBUG interceptor.PrefixMethodInvocationUtil "cannot find method [validateDoFindById] in action [cn.daisy.waction.ListsAllAction@14c6abc]"
[10:23:07] DEBUG interceptor.PrefixMethodInvocationUtil "cannot find method [validateDoDoFindById] in action [cn.daisy.waction.ListsAllAction@14c6abc]"
[10:23:07] DEBUG xwork2.DefaultActionInvocation "Executing action method = doFindById"
[10:23:37] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=struts]"
[10:23:37] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=struts]"
[10:23:37] DEBUG xwork2.DefaultActionProxy "Creating an DefaultActionProxy for namespace / and action name ListsAllFind"
[10:23:37] DEBUG support.DefaultListableBeanFactory "Returning cached instance of singleton bean 'ListsAllAction'"
[10:23:37] DEBUG interceptor.I18nInterceptor "intercept '//ListsAllFind' { "
[10:23:37] DEBUG interceptor.I18nInterceptor "applied invocation context locale=zh_CN"
[10:23:37] DEBUG interceptor.I18nInterceptor "before Locale=zh_CN"
[10:23:37] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[cn.daisy.waction.ListsAllAction@14c6abc, com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=struts]"
[10:23:37] DEBUG interceptor.FileUploadInterceptor "Bypassing //ListsAllFind"
[10:23:37] DEBUG interceptor.StaticParametersInterceptor "Setting static parameters {}"
[10:23:37] DEBUG interceptor.ParametersInterceptor "Setting params NONE"
[10:23:37] DEBUG interceptor.ParametersInterceptor "Setting params l.markName => [ map ] "
[10:23:37] DEBUG impl.InstantiatingNullHandler "Entering nullPropertyValue [target=[cn.daisy.waction.ListsAllAction@14c6abc, com.opensymphony.xwork2.DefaultTextProvider@9b8579], property=l]"
[10:23:37] WARN ognl.OgnlValueStack "Error setting expression 'l.markName' with value '[Ljava.lang.String;@4338fa'"
ognl.OgnlException: target is null for setProperty(null, "markName", [Ljava.lang.String;@4338fa)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2239)
at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.ASTChain.setValueBody(ASTChain.java:227)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.Ognl.setValue(Ognl.java:737)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)
at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:288)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:199)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
[10:23:37] DEBUG validation.AnnotationValidationInterceptor "Validating //ListsAllFind with method doFindById."
[10:23:37] DEBUG validator.ValidationInterceptor "Invoking validate() on action cn.daisy.waction.ListsAllAction@14c6abc"
[10:23:37] DEBUG interceptor.PrefixMethodInvocationUtil "cannot find method [validateDoFindById] in action [cn.daisy.waction.ListsAllAction@14c6abc]"
[10:23:37] DEBUG interceptor.PrefixMethodInvocationUtil "cannot find method [validateDoDoFindById] in action [cn.daisy.waction.ListsAllAction@14c6abc]"
[10:23:37] DEBUG xwork2.DefaultActionInvocation "Executing action method = doFindById"
解决方案三:
实在是不知道问题出在哪里了,已经做好了两个表的增删改查了,但是这个表的不行
解决方案四:
到后台复制为null时,你要检查2个地方。看前台传值的name和后台取得name是否一样,第二点是是用表单单独传值,还是前台转换为json往后台传值。
解决方案五:
[10:23:07] WARN ognl.OgnlValueStack "Error setting expression 'l.markName' with value '[Ljava.lang.String;@b3e75d'"
ognl.OgnlException: target is null for setProperty(null, "markName", [Ljava.lang.String;@b3e75d)