ssh报错 Error setting expression 'teacher.password' with value '[Ljava.lang.String

问题描述

Errorsettingexpression'teacher.password'withvalue'[Ljava.lang.String;@1b6c184'ognl.OgnlException:targetisnullforsetProperty(null,"password",[Ljava.lang.String;@1b6c184)jsp:<%@pagecontentType="text/html;charset=utf-8"%><%@taglibprefix="s"uri="/struts-tags"%><%Stringpath=request.getContextPath();StringbasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><html><basehref="<%=basePath%>"><metahttp-equiv="pragma"content="no-cache"><metahttp-equiv="cache-control"content="no-cache"><metahttp-equiv="expires"content="0"><metahttp-equiv="keywords"content="keyword1,keyword2,keyword3"><metahttp-equiv="description"content="Thisismypage"><linkrel="stylesheet"href="style.css"type="text/css"/><body><ulid="saturday"><li><ahref="index.jsp">主页</a></li><li><ahref="http://sc.xueit.com">关于我们</a></li></ul><divalign="center"></div><div><center><formaction="teacherlogin"method="post"><table><tr><tdcolspan="2"><br></td></tr><tr><td>用户名:</td><td><inputtype="text"name="teacher.number"></td></tr><tr><td>密&nbsp;&nbsp;&nbsp;&nbsp;码:</td><td><inputtype="password"name="teacher.password"></td></tr><tr><tdcolspan="3"><inputtype="submit"value="登陆"name="id">&nbsp;&nbsp;<inputtype="reset"value="重置"name="password">&nbsp;&nbsp;</td></tr></table></form></center></div></body></html>struts.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.1//EN""http://struts.apache.org/dtds/struts-2.1.dtd"><struts><!--<constantname="struts.enable.DynamicMethodInvocation"value="false"/><constantname="struts.devMode"value="false"/><includefile="example.xml"/><packagename="default"namespace="/"extends="struts-default"><default-action-refname="index"/><actionname="index"><resulttype="redirectAction"><paramname="actionName">HelloWorld</param><paramname="namespace">/example</param></result></action></package>--><constantname="struts.devMode"value="false"/><packagename="default"namespace="/"extends="struts-default"><!--<actionname="Student_regist"class="com.neu.dwl.action.student.StudentAction"method="regist"><result>/index.jsp</result></action>--><actionname="*_*"class="com.neu.dwl.action.{1}Action"method="{2}"><resultname="success">/{1}_{2}_success.jsp</result><resultname="error">/{1}_{2}_failure.jsp</result><resultname="select">/Course_select.jsp</result><resultname="list">/StudentCourse_select_success.jsp</result><resultname="show">/StudentCourse_delete.jsp</result></action><actionname="teacherlogin"class="com.neu.dwl.action.teacherAction"method="login"><resultname="success">/teacher_login_success.jsp</result><resultname="error">/teacher_login_failure.jsp</result></action><!--<actionname="Course_list"class="com.neu.dwl.action.course.CourseAction"method="list"><result>/Course_select.jsp</result></action>--></package><!--Addpackageshere--></struts>bean:packagecom.neu.dwl.bean;publicclassteacher{privateIntegernumber;privateStringname;privateStringpassword;publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicStringgetPassword(){returnpassword;}publicvoidsetPassword(Stringpassword){this.password=password;}publicvoidsetNumber(Integernumber){this.number=number;}publicIntegergetNumber(){returnnumber;}}

解决方案

解决方案二:
看看是否是构造方法的问题,添加一个空的构造方法和所有属性的构造方法,另外看看action中传过来的参数有没有set,get
解决方案三:
在对应action中是否有teacher对象,并且要有get、set方法
解决方案四:
你Action中的Teacher对象有没有初始化~如果没有的话,一定要初始化,除非你把这件事交给spring~
解决方案五:
你的Action中应该维护一个Teacher对象Action中:privateTeacherteacher;

然后你的前台才能写teacher.name

时间: 2024-11-02 23:39:45

ssh报错 Error setting expression &amp;#x27;teacher.password&amp;#x27; with value &amp;#x27;[Ljava.lang.String的相关文章

spring-急!ssh项目出错Error setting value [[Ljava.lang.String;@1597a48]

问题描述 急!ssh项目出错Error setting value [[Ljava.lang.String;@1597a48] spring:4.1.5 struts2:2.3.20 hibernate:4.3.8 spring和struts已配置验证码的actionTomcat启动后没错误,进入到注册页面也没错误,点四位验证码更换时(如图)myeclipse的Console报如下错误: WARN OgnlValueStack:68 - Error setting value [[Ljava.l

weblogic spring 冲突-Weblogic发布SSH报错. Tomcat正常

问题描述 Weblogic发布SSH报错. Tomcat正常 Weblogic发布SSH报错. Tomcat正常 2015-01-22 15:43:24 ERROR[org.springframework.web.context.ContextLoader.initWebApplicationContext():319] - Context initialization failedorg.springframework.beans.factory.xml.XmlBeanDefinitionSt

mybatis报错while setting parameters

问题描述 mybatis报错while setting parameters set @ID=0;SELECT num from (SELECT *@ID:= @ID+1 as num from user ORDER BY userid ) a where userid = #{userid} 在查询某一个结果所在的行数时,报错The error occurred while setting parameters 参数就只有一个userid 解决方案 MyBatis批量操作报错:Paramete

linux使用wkhtmltopdf报错error while loading shared libraries:

官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在linux上执行 ./wkhtmltopdf –page-size A4 www.baidu.com pdf.pdf 报错   error while loading shared libraries: libXrender.so.1 root@mag-sit:/home/mag-sit/wkhtmlt

mvel no context-MVEL 使用模板,当并发量大的时候, 报错 [Error: no context]

问题描述 MVEL 使用模板,当并发量大的时候, 报错 [Error: no context] Caused by: java.lang.RuntimeException: no context at org.mvel2.ParserContext.makeVisible(ParserContext.java:684) at org.mvel2.ParserContext.addVariable(ParserContext.java:477) at org.mvel2.ast.TypedVarN

lnk1120-vs2010运行程序报错:error LNK2019: 无法解析的外部符号

问题描述 vs2010运行程序报错:error LNK2019: 无法解析的外部符号 如题,我在vs2010环境下做C++练习题时出现该错误.程序代码如下: //array.h#ifndef ARRAY_H#define ARRAY_Htemplate<typename T>class Array{public: Array(int n);//数组首地址不用指定,待会分配 Array(Array &a); ~Array(); T getAt(int i);//返回第i个数组元素 voi

php图片上传报错error=3

问题描述 php图片上传报错error=3 upload: <?php/** Created by PhpStorm. User: rosen Date: 15-11-5 Time: 下午8:43*/print_r($_FILES['file']); ?> 为什么程序运行结果报错Array ( [name] => 2015-10-19 18:47:42屏幕截图.png [type] => [tmp_name] => [error] => 3 [size] => 0

arcgis-ArcSDE 做POST报错Error: Operation Failed (-1).

问题描述 ArcSDE 做POST报错Error: Operation Failed (-1). 同一主机:Windows2008 R2 64位,ArcSDE for 11g 64bit 本机Oracle11g64位服务端,Oracle11g 32位客户端,Oracle10g 32为服务端 环境变量 path C:appAdministratorproduct11.2.0client_1bin;E:appAdministratorproduct11.2.0dbhome_1bin;C:Progra

docker rmi报错Error response from daemon

docker commit了一个镜像之后想删除旧的镜像,出现以下报错 Error response from daemon: conflict: unable to delete 6f8214d56bfc (cannot be forced) - image has dependent child images 解决思路: docker save保存容器 docker images docker save REPOSITORY > XX.tar 删除镜像容器 docker ps -a docke