jsp代码如下:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="struts-bean" prefix="bean" %>
<%@taglib uri="struts-html" prefix="html" %>
<%@taglib uri="struts-logic" prefix="logic" %><html:html locale="true"> <head>
<title><bean:message key="hello.jsp.title"/></title>
<htmlbase/>
</head> <body bgcolor="white">
<h2>
<bean:message key="hello.jsp.page.heading"/>
</h2>
<html:errors/>
<logic:present name="personbean" scope="request">
<h2>
<bean:message key="hello.jsp.page.hello"/>
<bean:write name="personbean" property="userName"/>!
</h2>
</logic:present>
<html:form action="/HelloWorld.do" focus="userName">
<bean:message key="hello.jsp.prompt.person"/>
<html:text property="userName" size="16" maxlength="16"/><br>
<html:submit property="submit" value="submit"/>
<html:reset/>
</html:form>
</body>
</html:html>
----------------------
在tomcat下运行。
运行服务,在打开此页时报:
Unable to find setter method for attribute: locale
错误。
在线等。分少的话可以再加
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="struts-bean" prefix="bean" %>
<%@taglib uri="struts-html" prefix="html" %>
<%@taglib uri="struts-logic" prefix="logic" %><html:html locale="true"> <head>
<title><bean:message key="hello.jsp.title"/></title>
<htmlbase/>
</head> <body bgcolor="white">
<h2>
<bean:message key="hello.jsp.page.heading"/>
</h2>
<html:errors/>
<logic:present name="personbean" scope="request">
<h2>
<bean:message key="hello.jsp.page.hello"/>
<bean:write name="personbean" property="userName"/>!
</h2>
</logic:present>
<html:form action="/HelloWorld.do" focus="userName">
<bean:message key="hello.jsp.prompt.person"/>
<html:text property="userName" size="16" maxlength="16"/><br>
<html:submit property="submit" value="submit"/>
<html:reset/>
</html:form>
</body>
</html:html>
----------------------
在tomcat下运行。
运行服务,在打开此页时报:
Unable to find setter method for attribute: locale
错误。
在线等。分少的话可以再加
解决方案 »
- 我的web项目,别人访问不了。请大神速速支招!!!
- JAVA中 String数组怎么释放?
- tomcat启动异常
- 毕业论文要写远程教育的,导师让我搞后台设计,以前从没接触过这一领域,问应当从何下手?
- 今天发现,baidu也支持类似google的ajax输入提示功能拉
- 一个关于javascript取值的问题
- 问一个有关设计的问题(欢迎大家进入提供意见,入者有分)
- 好头痛的jsp中文间题!怎样确定我的编码是Iso8859-1
- 求救:连不上ORACLE8库
- 求大神帮忙,关于ajax取值。
- 如何用Java实现表单信息的提交,并获得返回页面?
- (:< jsp页面编码gb2312.mysql中文搜索不准确问题请教大家.
或者你将set,get先删掉,重新写一次
你看一下在formbean里是否有set,get方法
或者你将set,get先删掉,重新写一次
-------------------formbean 有get set方法
我的get set 方法是由Eclipse生成的.要不要把此formbean贴出来?试过了还是这样
去掉试试,那个是struts1.1的东西了
可能是config-struts.xml設置有錯誤
欢迎高手加入!!!!!!!!!!!!!QQ群:
唯爱J2EE(java开发):14402276(人员已满)
唯爱J2EE(二群):15472518(人员已满)
唯爱J2EE(WEB):33308970(招人)
********************不要重复加入,谢谢**************************
此群只加J2EE方面的人才与高手...或搞JAVA 一年以上的.....其他人不加........加群时,,注明:J2EE方面的技术体系,,,如:Struts,Spring,Hibenate,EJB,JSF,Ajax,Oracle,Weblogic等有关技术,方能通过....
应该是加载本地语言的问题
解决办法我不知道,期待高手
locale="true"
去掉试试,那个是struts1.1的东西了 提供解决办法.去掉之后已经可以正常使用了.