* <li>所有系统属性:<code>System.getProperties()</code>。</li>
* <li>常用小工具如:<code>stringUtil</code>和<code>stringEscapeUtil</code>等。</li>
* </ol>
*/
public static MessageContext newInstance(final Form form) {
MessageContext formContext = new MessageContext() {
@Override
protected Object internalGet(String key) {
return null;
}
@Override
public ExpressionContext getParentContext() {
return null;
}
@Override
protected void buildToString(ToStringBuilder sb) {
sb.append("FormMessageContext");
}
@Override
protected void buildToString(MapBuilder mb) {
mb.append("form", form);
}
};
Map<String, Object> utils = Utils.getUtils();
formContext.putAll(System.getProperties());
formContext.putAll(utils);
return formContext;
}