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

315
Views
Why I can't execute Java method in JavaScript code?

Please have a look at the JavaScript code below.

const locations = /*[[${locations}]]*/ null;
locations.forEach(location => {
    location.description = 44;
    location.lnglat = 127;

    location.fun(); // error
});

description and lnglat are variables from Java list of objects of class 'Location'; fun is a function from this class.

There is no problem assigning values to variables, but I can't call the function fun. Unfortunately, I don't know what the reason is and how can I fix it. In Java, I use Spring Boot and method addAttribute:

@GetMapping("/")
public String homePage(Model model) {
     model.addAttribute("locations", locations());
     return "home";
} 
about 4 years ago · Juan Pablo Isaza
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!