-1

I am trying to read current entity expansionDjdk.xml.entityExpansionLimit limit, but it is giving null. I tried the following code

System.getProperty("Djdk.xml.entityExpansionLimit");
System.getProperty("jdk.xml.entityExpansionLimit");
System.getProperty("jdk.xml.entityExpansionLimit");
System.getProperty("-DentityExpansionLimit");
System.getProperty("-Djdk.xml.entityExpansionLimit");
System.getProperty("ENTITY_EXPANSION_LIMIT");

All are giving result as null

Kenster
  • 23,465
  • 21
  • 80
  • 106
Arvind
  • 1,207
  • 6
  • 27
  • 55

2 Answers2

0

You run your program like

java Example -Djdk.xml.entityExpansionLimit=1234

and read this property like

System.getProperty("jdk.xml.entityExpansionLimit");

Aakash
  • 2,029
  • 14
  • 22
0

You can list out all properties and check its name:

Properties props = System.getProperties();
Enumeration keys = props.keys();
while (keys.hasMoreElements()) {
  String key = (String)keys.nextElement();
  String value = (String)props.get(key);
  System.out.println(key + ": " + value);
}

If you can't see it, I think that property is not set before. Hope this helps.

Tom
  • 16,842
  • 17
  • 45
  • 54
Duc Vo
  • 61
  • 3