How to use Primefaces Extensions InputNumber with String - jsf-2

I am using Primefaces Extensions 3.20 with Primefaces 5.2.11 running in a Weblogic 10.3.6. I tried to use inputNumber to refer to a String property. However, when I submitted the page, I got a null String from this field. Just when the inputNumber came to refer to a numeric property (such as a Long), I got a value. Apparently the inputNumber component works just with numbers.
Does someone know a way how to use inputNumber with Strings?
Thanks,
Rafael Afonso

Related

Where can I see the specification for thymeleaf th:method?

I've seen a lot of answers about how to send PUT/DELETE/PATCH HTTP requests with thymeleaf, and it's by using th:method = "the_specific_method", but i haven't found the thymeleaf specification about that. Can anyone help showing me where is it?
Thanks in advance.
I've tried to google for the answer, but no luck.
th:method isn't special to Thymeleaf -- it's just like any other plain old attribute which will output the result of an expression to the method attribute. It doesn't do (or care about) anything else. You can put any string and/or string expression into it, and Thymeleaf will happily output it.
th:method="${'the_specific_method'}"
will output
method="the_specific_method"
without regards to whether or not it's valid. If you want to learn about the method attribute, you just need to learn about how method works in plain old regular html and how browsers (and/or Spring) work with it.

How to store byte array field in Elasticsearch using spring data elasticsearch without indexing?

I need to store byte array field in Elasticsearch without indexing it. I'm using spring data elasticsearch module. What is the right way? Thanks
The correct fieldtype in Elasticsearch for this would be the binary field type. Alas this is currently not available in Spring Data Elasticsearch, I just created a Jira issue for this.
Even if the binary field type were implemented, you still would need to base64 encode the binary data, so that in Elasticsearch it would be stored in a text representation.
Until this binary field type is implemented, you might try to use a field definition like:
#Field(type = FieldType.Keyword, index = false)
private String base64Data;
Like with the binary field type you have to encode your data as base64 String and decode it when it's coming back from the search. Even better wer if you could add the doc_values=false argument to #Field annotation, to have support for this, there is currently a PullRequest open, but which is not yet ready to be merged; not sure, if this will make it into the 3.2.0 release.
Edit March 2020:
in version 4.0.0, you can user the FieldType.Binary type together with a byte[] and this will be converted to a base64 encoded string (and back again).

Swagger 3.x : Query params act as readonly values

I tried swagger 3.2.2 by running a GET operation with few query params.
I find defaults values I set in REST API can't override in swagger UI. All the text boxes are read only, and drop-down of Boolean query param always sends 'false' though I select it to 'true'. It seems program default values are super hard-corded here. I was playing with swagger #ApiPram(..) to fix this but it didn't help me.
Did anyone ran in to the same issue I describe above with Swagger 3.x?
I start using Swagger UI 3.5.0 and fixed the issue

Different md5 hash for same string in Swift

I'm currently working on a swift application based on a particular API of a website. I use the md5 function to create valid url and access some JSON data which I can bring in my application with SwiftJSON.
I worked fine for the 6 first url but then I got an error in the checksum of my url. I checked it out and realize my md5 function in swift got the wrong hash
In my swift program, the hash of the string "answerfr1%3D%3DQf7AjOptTN6k2OyoTa7QjOptDM6k2OzoTa7cjOptjM6k2O1oTa7EjOptDMxoTa7AjOptnO2oTY"
Give me this "09938c1325c87ef89251f668a8cf5d42"
But it's not correct because my link isn't valid
But by doing it myself with http://www.md5.cz/
I have this for result "9d78b73d28f590beb8ef25b5e4b99a1d" and my link works perfectly.
I don't know why my md5 function have no issues with the 6 first hash but give me a wrong hash for the 7.
And I realize www.md5.fr give me the same wrong code. Why is there different md5 hash for the same strings ?
My md5 function in swift :
How to convert string to MD5 hash using ios swift
Hope you guys understand my issues here!
Sorry for my bad english
Thanks Martin R, you solved my problem
"%3D" is equal to "="
so "%3D%3D" is equal to "=="

How to localize no-script (iframe) reCAPTCHA?

I know that to localize the regular (JavaScript) reCAPTCHA I can provide lang attribute to Recaptcha.create method as specified in documentation I've tried to do the same for noscript version by passing lang in query string like this http://www.google.com/recaptcha/api/noscript?k=<key>&lang=ru, but I still got an English version.
Does anyone know how to localize the iframe version?
try using &hl=ru parameter. hope this help.

Resources