Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wicket 找不到StringValidator的资源密钥。maximumLength(int-length)_Wicket - Fatal编程技术网

Wicket 找不到StringValidator的资源密钥。maximumLength(int-length)

Wicket 找不到StringValidator的资源密钥。maximumLength(int-length),wicket,Wicket,我正在将Wicket web应用程序从1.5.8迁移到6.1.1。作为这个过程的一部分,我正在更新文本字段的验证器。我的TextArea验证器的资源密钥不再被识别,我得到了一个标准密钥 'sComments' is longer than the maximum of 250 characters. flash消息,而不是我所期望的使用我认为是它的资源键: Your comments have a length of 255, which is longer than the maximum

我正在将Wicket web应用程序从1.5.8迁移到6.1.1。作为这个过程的一部分,我正在更新文本字段的验证器。我的
TextArea
验证器的资源密钥不再被识别,我得到了一个标准密钥

'sComments' is longer than the maximum of 250 characters.
flash消息,而不是我所期望的使用我认为是它的资源键:

Your comments have a length of 255, which is longer than the maximum of
250 characters that we allow. Please would you amend your comments and try again.
是否有其他人遇到此问题,或者可以帮助我命名我的资源密钥,以使其在Wicket 6.1.1中工作

我的旧1.5.8资源密钥

sComments.StringValidator.maximum
适用于Wicket 6.1.1(文档中说明,出于向后兼容性的原因,form StringValidator.*的资源键仍处于检查状态),但我想在Wicket的未来版本出现故障之前,转向“现代”方式

HTML代码

<textarea wicket:id="sComments" cols="50" rows="5"
 tabindex="5"
></textarea>
(我也尝试过:

sComments.RangeValidator.Maximum
sComments.RangeValidator.MaximumValidator
sComments.MaximumValidator
sComments.RangeValidator.minimum
sComments.RangeValidator.range
sComments.RangeValidator.exact

在我看来,此验证器的Wicket 6.1.1的正确资源密钥的格式是
sComments.StringValidator.maximum
,尽管javadoc for StringValidator建议使用
sComments.RangeValidator.maximum
格式的资源密钥在这里可以正常工作,您在哪个属性文件中声明了密钥?@svenmeier HTML、Java和属性文件都位于同一文件夹中,分别名为“PageFeedback.HTML”、“PageFeedback.Java”和“PageFeedback.properties”。现在Wicket 6的命名方案不正确吗?看起来不错,通过启用资源密钥日志来检查资源密钥。对于log4j:log4j.logger.org.apache.wicket.util.resource=DEBUG@svenmeier谢谢我使“org.apache.wicket.core.util.resource”的日志记录更加敏感。在我看来,正确的资源密钥的形式是“sComments.StringValidator.maximum”,尽管javadoc for StringValidator建议使用(“sComments.RangeValidator.maximum”)。谢谢。我不喜欢自己改变javadoc的想法。我不是Wicket开发人员(我只是使用Wicket),所以我可能错过了一些东西。
# The resource key that worked in Wicket 1.5.8
# sComments.StringValidator.maximum = Your comments have a length of \
# ${length}, which is longer than the maximum of ${maximum} characters \
# that we allow. Please would you amend your comments and try again.

# Wicket 6.1.1 resource key that does not work
sComments.RangeValidator.maximum = Your comments have a length of \
${length}, which is longer than the maximum of ${maximum} characters \
that we allow. Please would you amend your comments and try again.
sComments.RangeValidator.Maximum
sComments.RangeValidator.MaximumValidator
sComments.MaximumValidator
sComments.RangeValidator.minimum
sComments.RangeValidator.range
sComments.RangeValidator.exact