I have a normal Java object that holds a parameter of type
private HashMap<String, String> lizt = new HashMap()
public ObjectTemp(HashMap<String, String> lizt ) {
this.lizt = lizt ;
}
And a JavaScript map that contains the data
var map1 = new Map();
When the user clicks the button
<form action="#" class="ui_formz" th:action="@{/SomeMethod}" th:object="${object_temp}" method="post">
<button class="btn btn-primary" onclick="dothis(${object_temp.lizt })" type="button "> Buy </button>
</form>
In HTML, it calls a function
function dothis(argm){
argm=map1;
}
However, it does not work. The constructor parameters do not receive or do anything. Anybody can explain why and what I am doing wrong?
For further explanation.
Basically, it does not register the map from JavaScript. It simply returns an object with an empty map
this.lizt = {[]}
I want to receive an HashMap stored in JavaScript to Java. Usually, the data would be an integer or a string or others primitive and it would do the job by simply storing the variable in HTML.
<input value="data_stored"></input>
This times it is an HashMap present in a JavaScript variable, not a string, so I don't know what to do. I am not working with a string but a map. Any solution?