I have a requirement where I need to insert the value to custom data tag using thymeleaf. The code for doing it using
data-th-attr="${data-custom=#messages.msg('test')}"
as well as
th:attr="data-custom=${#messages.msg('test')}"
I am unable to get the value in both the cases.
ultimately the parsing should be like data-custom="test"
here test is key for the value test in a properties file
By using the
data-th-attr="data-custom=#{test}"
or By using
th:attr="data-custom=#{test}"
helped me out, here test is the key for the value in message resource the issue was with the intellij IDEA IDE, it was having a bug that was showing me an unnecessary error.
Use th:attr="data-custom=#{key.for.message}" , this should work.
then after parsing the Expression,
data-custom="value.for.message"
Related
I have an SOAP 1.1 Service developed with Spring Boot in Java which responses without any problems to any of my requests and deliver a valid SOAP-response.
Now the problem is as soon as I add this service as Service Reference to any .NET/C# project the reference gets created and I can send requests but the response (Which get definitely sent from my SOAP-Service) cant be mapped back and the object in my .NET application is always null.
I already found out what the problem might be but I don't know exactly how (of if it is even possible like this) to change my xsd/wsdl to generate all the sources correctly.
First of all here is my .xsd from my Java Spring Boot project for the generation of the WSDL & Service Reference:
Here is the code from the generated Service Reference from Visual Studio in a C# project:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute([NAMESPACE]/processing", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("processingResponse", Namespace="http://[NAMESPACE]/base", IsNullable=true)]
public processingResponse processing([System.Xml.Serialization.XmlElementAttribute(Namespace="http://[NAMESPACE]/base", IsNullable=true)] processingRequest processingRequest) {
object[] results = this.Invoke("processing", new object[] {
processingRequest});
return ((processingResponse)(results[0]));
}
I found out if I change the following line
[return: System.Xml.Serialization.XmlElementAttribute("processingResponse", Namespace="http://[NAMESPACE]", IsNullable=true)]
and add "Form=System.Xml.Schema.XmlSchemaForm.Unqualified":
[return: System.Xml.Serialization.XmlElementAttribute("processingResponse", Namespace="http://[NAMESPACE]", IsNullable=true, Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
The response gets mapped correctly to my Object and it seem to work like this without any problems at the moment.
The problem is that I want to change my .xsd to generate these sources correctly from the start - I already tried to add Form=Unqualified to the "AppDataDataResult" element inside the "processingResponse" complexType but it doesnt work.
Adding this property directly to the processingResponse Element isn't working either cause it's not possible cause the <xs:element/> is one level beneath the schema definition/tag.
I havent found any concrete solution to this problem cause it seems to be very specific with the Spring Boot Framework Java, and the generation of the wsdl.
I hope someone can help me with this problem cause it doesnt seem to be a big one (Its "only" a attribute which needs to get added during the generation of the sources) but I cant seem to find a solution to this. Thanks in advance for the help!
I found the Problem and it was a really simple fix for this Issue - In my Spring Boot Project I was returning JAXBElements and a Parameter for the response is the "QName" which indicates the Object of the Response. The Problem here was that the SOAP-Response did not have the relevant Namespace to identify the Object during the generation of Sources in .NET. So I added the correct Namespace-URI to the QName-Object and now the objects gets resolved and returns the correct responses:
final QName qname = new QName(NAMESPACE_URI, "processingResponse");
return new JAXBElement<>(qname, ProcessingResponse.class, processingResponse);
In the end it was a pretty stupid/simple problem but I tried everything else but havent tried to most obvious/easiest.
I am trying to generate QRDA1 using MDHT model and have stuck up with the setting of the sdtc:valueset attribute to a code or value tag. The QRDA spec example below shows sdtc:valueset:
CE code = DatatypesFactory.eINSTANCE.createCE();
code.setCode("247472004");
code.setDisplayName("Hives");
code.setCodeSystem("2.16.840.1.113883.6.96");
code.setCodeSystemName("SNOMED CT");
these tags are present in MDHT library but
code.setValueSet("{$QDMElementValueSetOID}");
is not present in mdht model.
How can I solve this problem?
the updated Runtime jars which contains the sdtc:value attribute for code and values set are located at the below link
http://sourceforge.net/projects/oht-modeling/files/Releases/
open the link and click on the Runtime which contains the updated jars files.
I am getting the following exception when I try to create a Custom Object in Salesforce, using CRUD Matadata API.
com.sforce.ws.SoapFaultException: Must specify a {http://www.w3.org/2001/XMLSchema-instance}
type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:205)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98)
at com.sforce.soap.metadata.MetadataConnection.create(MetadataConnection.java:273)
at com.sfo.service.SalesforceObjectBootstrap.createCustomObject(SalesforceObjectBootstrap.java:226)
I am using the code from this link, The only thing that I changed were the name of the Custom Object
http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_calls_intro.htm
The exception occurs at this step
AsyncResult[] asyncResults = metadataConnection.create(new CustomObject[]{customObject});
The Custom object just before invoking the create method above has the following parameter values.
[CustomObject [Metadata fullName='lead_5273_custom_reg__c'
]
actionOverrides='{[0]}'
articleTypeChannelDisplay='null'
businessProcesses='{[0]}'
customHelp='hey there help me'
customHelpPage='null'
customSettingsType='null'
customSettingsVisibility='null'
deploymentStatus='Deployed'
deprecated='false'
description='Created from backend Webcast API : Lead 5273 Custom Reg'
enableActivities='false'
enableDivisions='false'
enableEnhancedLookup='false'
enableFeeds='false'
enableHistory='false'
enableReports='false'
fieldSets='{[0]}'
fields='{[0]}'
gender='null'
household='false'
label='Lead 5273 Custom Reg'
listViews='{[0]}'
nameField='[CustomField [Metadata fullName='lead_5273_custom_reg__c'
]
caseSensitive='false'
customDataType='null'
defaultValue='null'
deleteConstraint='null'
deprecated='false'
description='field name for a metadata custom object'
displayFormat='null'
escapeMarkup='false'
externalDeveloperName='null'
externalId='false'
formula='null'
formulaTreatBlanksAs='null'
inlineHelpText='null'
label='Lead 5273 Custom Reg'
length='0'
maskChar='null'
maskType='null'
picklist='null'
populateExistingRows='false'
precision='0'
referenceTo='null'
relationshipLabel='null'
relationshipName='null'
relationshipOrder='0'
reparentableMasterDetail='false'
required='false'
restrictedAdminField='false'
scale='0'
startingNumber='0'
stripMarkup='false'
summarizedField='null'
summaryFilterItems='{[0]}'
summaryForeignKey='null'
summaryOperation='null'
trackFeedHistory='false'
trackHistory='false'
type='Text'
unique='false'
visibleLines='0'
writeRequiresMasterRead='false'
]
'
namedFilters='{[0]}'
pluralLabel='Lead 5273 Custom Regs'
recordTypeTrackFeedHistory='false'
recordTypeTrackHistory='false'
recordTypes='{[0]}'
searchLayouts='null'
sharingModel='ReadWrite'
sharingReasons='{[0]}'
sharingRecalculations='{[0]}'
startsWith='null'
validationRules='{[0]}'
webLinks='{[0]}'
]
I used the method mentioned here to generate the WSDL files and its java skeleton.
http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_quickstart.htm#topic-title-sample-code
My code exactly matches the example provided above. I simply copy pasted the whole thing.
I found this link, which mentioned the same exception. But this link is relating to creating a Folder.
http://boards.developerforce.com/t5/Java-Development/Metadata-API-errors-Must-specify-a-type-attribute-value-for-the/td-p/175253
Please let me know how to solve this problem.
I've not played with this myself, but from the looks of the exception, the MetaData block here:
[CustomObject [Metadata fullName='lead_5273_custom_reg__c']
needs to contain the object type, which I'm assuming in this case is CustomObject__c (all custom objects have the __c suffix), so maybe try the following:
[CustomObject [Metadata fullName='lead_5273_custom_reg__c' type='CustomObject__c']
Unless of course, fullname is actually the object name, which could be a possibility.
I am using Struts 2.1.8 and facing validation problem in IE. I am getting the following error
An exception occurred: Error. Error message: Invalid argument.
I tried out to figure out the cause and found the following. My generated javascript code is:
field = form.elements['district.name'];
var error = "Enter only alphabets for district";
if (continueValidation && field.value != null && !field.value.match("^[a-zA-Z ]*$")) {
addError(field, error);
errors = true;
}
I tried to mock up by putting the same code in a function and calling it in onclick event. The method addError() throws the exception and the reason is field variable. If I change it to field[0], it works fine. How to fix this error?
Check the generated HTML source. Open the page in webbrowser, rightclick and choose View Source. Is the input field's name really district.name? Isn't it prefixed/suffixed with some other autogenerated key (possibly the ID/name of the <form>) like as many other MVC frameworks do? If so, you'll need to change the JavaScript code accordingly that it uses the right element name as it appears in the HTML DOM tree. You know, JavaScript runs at the client machine and only sees the generated HTML DOM tree, not the "original" server-side code which is responsible for generating the HTML.
I have 3 language files idioma_CA.properties idioma_EN.properties idioma_ES.properties in the package "idiomas" and one default idioma.properties.
struts.properties has this properties:
hibernatePlugin.configurationType=annotation
struts.custom.i18n.resources = idiomas/idioma
So everytime I try to change the language struts2 ignores me and get always the text from the default properties at JSP's.
But using "getText" at execute method of my Action I get that NullPointerException whatever locale i have at request_locale.
Can someone tell me what am i doing wrong?
Thank you very much
I solved the problem.
The localization letters after "idioma_" must be lowercase like "idioma_ca.properties"