Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
establecer el valor de hashmap de struts en javascript

El siguiente código js no establece el valor en hashmap.

POJO:

 private HashMap myMap = new HashMap(); public String getHashmapField(String key) { return (String) myMap.get(key); } public void setHashmapField(String key, String val) { myMap.put(key, val); }

campo jsp:

 <input type="hidden" id="hashmapField(lastname)" name="hashmapField(lastname)" />

codigo js:

 document.getElementById("hashmapField(lastname)").value = "XYZ";
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Por lo que recuerdo, debe usar etiquetas especiales para establecer valores.

https://struts.apache.org/tag-developers/hidden-tag.html

en este caso:

 <s:hidden name="foo" value="%{hashmapField}" />

No sé cómo configura el objeto que tiene hashmapField, por lo que no puedo decir si debe tener un prefijo, pero verifique la documentación y vea si esto es lo que necesita.

El código que tiene, a menos que las cosas hayan cambiado mucho, en realidad no usa ninguna propiedad del servidor. Por lo menos esperaría %{...}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!