首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

Struts从页面传值与接收有关问题

2012-04-21 
Struts从页面传值与接收问题问题描述:在页面有个form,是用来注册的,有这么几个参数 email,gender,password

Struts从页面传值与接收问题
问题描述:
在页面有个form,是用来注册的,有这么几个参数 email,gender,password,password2,realName.
提交的时候,日志的内容是这样的:

Java code
  [framework] 2011-12-17 19:34:21,983 - org.apache.struts2.interceptor.FileUploadInterceptor -20104 [http-bio-8080-exec-4] DEBUG org.apache.struts2.interceptor.FileUploadInterceptor  - Bypassing //register [framework] 2011-12-17 19:34:21,983 - com.opensymphony.xwork2.interceptor.StaticParametersInterceptor -20104 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.interceptor.StaticParametersInterceptor  - Setting static parameters {} [framework] 2011-12-17 19:34:21,984 - com.opensymphony.xwork2.interceptor.ParametersInterceptor -20105 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.interceptor.ParametersInterceptor  - Setting params NONE[color=#FF0000] [framework] 2011-12-17 19:34:21,984 - com.opensymphony.xwork2.interceptor.ParametersInterceptor -20105 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.interceptor.ParametersInterceptor  - Setting params birthday => [ 2011-12-26 ] email => [ d ] gender => [ 0 ] password => [ l ] password2 => [ l ] realName => [ d ][/color]  [framework] 2011-12-17 19:34:21,985 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20106 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Property: birthday [framework] 2011-12-17 19:34:21,985 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20106 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Class: com.zb.action.RegisterAction[color=#FF0000] [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - converter is null for property birthday. Mapping size: 0[/color] [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - field-level type converter for property [birthday] = none found [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - global-level type converter for property [birthday] = none found [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@670f8704] [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Property: email [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Class: com.zb.action.RegisterAction [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - field-level type converter for property [email] = none found [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - global-level type converter for property [email] = none found [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@670f8704] [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Property: gender [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Class: com.zb.action.RegisterAction [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - field-level type converter for property [gender] = none found [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - global-level type converter for property [gender] = none found [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@670f8704] [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Property: password [framework] 2011-12-17 19:34:21,996 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20117 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - Class: com.zb.action.RegisterAction [framework] 2011-12-17 19:34:21,997 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20118 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - field-level type converter for property [password] = none found [framework] 2011-12-17 19:34:21,997 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20118 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - global-level type converter for property [password] = none found [framework] 2011-12-17 19:34:21,997 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20118 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@670f8704] [framework] 2011-12-17 19:34:21,999 - org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor -20120 [http-bio-8080-exec-4] DEBUG org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor  - Validating //register with method register. [framework] 2011-12-17 19:34:22,020 - com.opensymphony.xwork2.validator.ValidationInterceptor -20141 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.validator.ValidationInterceptor  - Invoking validate() on action com.zb.action.RegisterAction@2ab3f1c9 [framework] 2011-12-17 19:34:22,020 - com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil -20141 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil  - cannot find method [validateRegister] in action [com.zb.action.RegisterAction@2ab3f1c9] [framework] 2011-12-17 19:34:22,020 - com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil -20141 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil  - cannot find method [validateDoRegister] in action [com.zb.action.RegisterAction@2ab3f1c9] [framework] 2011-12-17 19:34:22,021 - com.opensymphony.xwork2.DefaultActionInvocation -20142 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.DefaultActionInvocation  - Executing action method = register  



这个问题困惑了我很久,没找到办法
我的问题是这个:
明明从form里有值传过来,怎么就接收不到呢?
Java code
 [framework] 2011-12-17 19:34:21,984 - com.opensymphony.xwork2.interceptor.ParametersInterceptor -20105 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.interceptor.ParametersInterceptor  - Setting params birthday => [ 2011-12-26 ] email => [ d ] gender => [ 0 ] password => [ l ] password2 => [ l ] realName => [ d ]  [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - converter is null for property birthday. Mapping size: 0 [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - field-level type converter for property [birthday] = none found [framework] 2011-12-17 19:34:21,995 - com.opensymphony.xwork2.conversion.impl.XWorkConverter -20116 [http-bio-8080-exec-4] DEBUG com.opensymphony.xwork2.conversion.impl.XWorkConverter  - global-level type converter for property [birthday] = none found


[解决办法]
贴代码看看,只有日志咋看
[解决办法]
页面的input里面有name的attribute么?确认一下
[解决办法]
你现在的问题是什么,接收不到值是在哪里接收不到?RegisterAction里还是返回的jsp里?

热点排行