|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.servlet.jsp.tagext Class ValidationMessage
java.lang.Object javax.servlet.jsp.tagext.ValidationMessage
public class ValidationMessage
- extends Object
来自 TagLibraryValidator 或 TagExtraInfo 的验证消息。
从 JSP 2.0 起,JSP 容器必须支持 jsp:id 属性,以提供更高质量的验证错误。容器将跟踪传递给容器的 JSP 页面,将给每个元素分配唯一的 "id",该 id 作为 jsp:id 属性的值传递。XML 视图中每个可用的 XML 元素都将使用此属性扩展。然后,TagLibraryValidator 可以在一个或多个 ValidationMessage 对象中使用该属性。然后,容器可以依次使用这些值提供有关错误位置的更准确信息。
id
属性的实际前缀不一定是 jsp
,但它总是映射到名称空间 http://java.sun.com/JSP/Page
。TagLibraryValidator 实现必须依赖 id
属性的 uri 而不是前缀。
A validation message from either TagLibraryValidator or TagExtraInfo.
As of JSP 2.0, a JSP container must support a jsp:id attribute to provide higher quality validation errors. The container will track the JSP pages as passed to the container, and will assign to each element a unique "id", which is passed as the value of the jsp:id attribute. Each XML element in the XML view available will be extended with this attribute. The TagLibraryValidator can then use the attribute in one or more ValidationMessage objects. The container then, in turn, can use these values to provide more precise information on the location of an error.
The actual prefix of the id
attribute may or may not be
jsp
but it will always map to the namespace
http://java.sun.com/JSP/Page
. A TagLibraryValidator
implementation must rely on the uri, not the prefix, of the id
attribute.
Constructor Summary | |
---|---|
ValidationMessage(String id,
String message)
Create a ValidationMessage. |
Method Summary | |
---|---|
String |
getId()
Get the jsp:id. |
String |
getMessage()
Get the localized validation message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
ValidationMessage(String id, String message)
创建 ValidationMessage。消息 String 应该是非 null 的。如果消息不是特定于任何 XML 元素的,或者没有传递 jsp:id 属性,则 id 值可以为 null。如果 id 值是非 null 的,则 id 值必须是传入 validate() 方法的 PageData 的 jsp:id 属性值。
id | 该参数为 null 或者 jsp:id 属性的值。 |
message | 本地化验证消息。 |
ValidationMessage
public ValidationMessage(String id, String message)
- Create a ValidationMessage. The message String should be
non-null. The value of id may be null, if the message
is not specific to any XML element, or if no jsp:id
attributes were passed on. If non-null, the value of
id must be the value of a jsp:id attribute for the PageData
passed into the validate() method.
- Parameters:
id
- Either null, or the value of a jsp:id attribute.message
- A localized validation message.
Method Detail |
---|
public String
getId()
获取 jsp:id。null 意味着没有可用信息。
return | jsp:id 信息。 |
getId
public String getId()
- Get the jsp:id.
Null means that there is no information available.
- Returns:
- The jsp:id information.
public String
getMessage()
获取本地化验证消息。
return | 验证消息 |
getMessage
public String getMessage()
- Get the localized validation message.
- Returns:
- A validation message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!