简体   繁体   中英

Can we default value in bean so even after WSDL generation the value will be retained?

I have a property

private boolean submitRequests = true;

but when WSDL is generated the resulting bean does not retain the default "true" value. Is there a way or any annotation which can make it retain the default value?

Got the answer...

@XmlElement(defaultValue = "true")
public void setSubmitRequests(boolean submitRequests) {
    this.submitRequests = submitRequests;
}

this will do it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM