ValidationMessage (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.servlet.jsp.tagext Class ValidationMessage

java.lang.Object
  extended by javax.servlet.jsp.tagext.ValidationMessage

public class ValidationMessage
extends Object

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.


构造器摘要
ValidationMessage(String id, String message)
          Create a ValidationMessage.
 
方法摘要
 String getId()
          Get the jsp:id.
 String getMessage()
          Get the localized validation message.
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造器详细信息

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.

参数:
id - Either null, or the value of a jsp:id attribute.
message - A localized validation message.

方法详细信息

getId

public String getId()
Get the jsp:id. Null means that there is no information available.

返回:
The jsp:id information.

getMessage

public String getMessage()
Get the localized validation message.

返回:
A validation message

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.