Java Compiler Compiler tm (JavaCC tm) is the most popular parser generator for use with Java tm applications. A parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar. In addition to the parser generator itself, JavaCC provides other standard capabilities related to parser generation such as tree building (via a tool called JJTree included with JavaCC), actions, debugging, etc.
涓嬭澆鍚庣殑浣跨敤鏂瑰紡錛圡ac&Linux錛夛細echo 'java -cp /path/to/javacc.jar $(basename $0) "$@"' > javacc
chmod 755 javacc
ln -s javacc jjtree
ln -s javacc jjdoc
Administrator NLR8ZC-855550-68587856625436280
yddcode Serial: lLR8ZC-855550-6858795439845000
鏈榪戝Schema 楠岃瘉鐮旂┒浜嗕竴涓嬶紝 浠g爜濡備笅錛?br /> 鎵闇JAR鍖呴渶瑕佽嚜宸變笅杞斤紙鐗堟湰涓瀹氳姝g‘錛?/p>
public class SchemaValidation {
public static void main(String[] args) {
validate();
}
public static void validate() {
try {
SchemaValidation demo = new SchemaValidation();
// Give the xml(鏍囧噯鍖栬秺鏉ヨ秺榪戜簡) and schema name
InputStream xml(鏍囧噯鍖栬秺鏉ヨ秺榪戜簡)String = demo.getClass().getResourceAsStream("GBAInit.xml(鏍囧噯鍖栬秺鏉ヨ秺榪戜簡)");
InputStream schemaStr = demo.getClass().getResourceAsStream("GBAInitSchema.xsd");
SAXReader reader = createSAXReader(schemaStr);
System.out.println("XSD parse successfully !");
Document document = reader.read(xml(鏍囧噯鍖栬秺鏉ヨ秺榪戜簡)String);
System.out.println("Successfully validation .. . ");
} catch (DocumentException e) {
System.out.println("Exception occurred: " + e);
Throwable nestedException = e.getNestedException();
if (nestedException != null) {
System.out.println("NestedException: " + nestedException);
nestedException.printStackTrace();
} else {
e.printStackTrace();
}
} catch (Throwable t) {
System.out.println("Exception occurred: " + t);
t.printStackTrace();
}
}
/** Registers the Verifier with the SAXReader */
protected SAXReader createSAXReader(InputStream schemaURI) throws Exception {
System.out.println("Loaded schema document: " + schemaURI);
// use autodetection of schemas
VerifierFactory factory = new com.sun.msv.verifier.jarv.TheFactoryImpl();
Schema schema = factory.compileSchema(schemaURI);
Verifier verifier = schema.newVerifier();
verifier.setErrorHandler(new ErrorHandler() {
public void error(SAXParseException e) {
System.out.println("ERROR: " + e);
}
public void fatalError(SAXParseException e) {
System.out.println("FATAL: " + e);
}
public void warning(SAXParseException e) {
System.out.println("WARNING: " + e);
}
});
// now install the verifying filter
VerifierFilter filter = verifier.getVerifierFilter();
SAXReader reader = new SAXReader();
reader.setxml(鏍囧噯鍖栬秺鏉ヨ秺榪戜簡)Filter(filter);
return reader;
}
鏈枃鏉ユ簮浜?WEB寮鍙戠綉 鍘熸枃閾炬帴錛歨ttp://www.cncms.com.cn/ajax/9977.htm
Intent搴旇綆楁槸Android涓壒鏈夌殑涓滆タ銆備綘鍙互鍦↖ntent涓寚瀹?span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E7%A8%8B%E5%BA%8F">紼嬪簭瑕佹墽琛岀殑鍔ㄤ綔錛堟瘮濡傦細view,edit,dial錛夛紝浠ュ強紼嬪簭鎵ц鍒拌鍔ㄤ綔鏃舵墍闇瑕佺殑璧勬枡銆傞兘鎸囧畾濂藉悗錛屽彧瑕佽皟鐢╯tartActivity()錛孉ndroid緋葷粺浼氳嚜鍔ㄥ鎵炬渶絎﹀悎浣犳寚瀹氳姹傜殑搴旂敤紼嬪簭錛屽茍鎵ц璇ョ▼搴忋?br />
涓嬮潰鍒楀嚭鍑犵Intent鐨勭敤娉?br /> 鏄劇ず緗戦〉:
璋冪敤鎷ㄥ彿紼嬪簭
璋冪敤鍙戦?span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E7%9F%AD%E4%BF%A1">鐭俊鐨勭▼搴?
|
title(blank:false)錛岃〃紺鴻瀛楁涓嶅彲涓虹┖
2銆佸湪message灞炴т腑錛屽畾涔夎瀛楁涓虹┖鏃跺欑殑鎻愮ず錛屾牸寮忔槸棰嗗煙鍖呭悕.棰嗗煙妯″瀷綾誨悕縐?灞炴у悕縐?闄愬埗灞炴у悕縐?鎻愮ず淇℃伅
渚嬶細cn.tigertian.grails.domain.News.title.blank=璇峰~鍐欐爣棰?br />
3銆佸湪欏甸潰涓婂姞鍏ュ涓嬩唬鐮侊細
Caused by: javax.faces.convert.ConverterException: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:91)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:630)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:91)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
... 110 more
Caused by: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:87)
... 113 more
鍚庢潵鍦ㄥ浗澶栫綉绔欎笂闈㈡壘鍒頒簡闂鎵鍦細
Hello,
the problem still exists in MyFaces Core 1.2.6.
I have a selectOneMenu with a value binding to a boolean property.
In the boolean converter the ClassCastException still occurs.
...
Caused by: javax.faces.convert.ConverterException: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:91)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:630)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:91)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
... 110 more
Caused by: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:87)
... 113 more
In RendererUtils there are some tests that value equals NOTHING. However the equals method
of the NOTHING-Serializable isn't overriden. Therefore it has no effect.
Overriding the equals method as in the patch of paul works.
鏈変簺涓滆タ娌℃湁瀹炵幇錛屽鑷翠簡榪欎釜闂銆傝繖涓彲鑳介渶瑕佷綘鑷繁綆鍗曞疄鐜頒竴涓嬫簮鏂囦歡鐒跺悗緙栬瘧鎴愬簱鏂囦歡浜嗭紝鎰熻楹葷儲灝辨崲鎴愪簡SelectOneMenu浜嗐?br /> 鍚庨潰鏈夋椂闂村啀鐪嬩簡