• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

172
Views
Spring MVC adelante agregando valores de parámetros de solicitud separados por comas cuando tenemos el mismo nombre de parámetro para topRequest y solicitud de reenvío

Spring MVC adelante agregando valores de parámetros de solicitud separados por comas cuando tenemos el mismo nombre de parámetro para topRequest y solicitud de reenvío

 @RequestMapping(path = "/details") public ModelAndView details(@ModelAttribute final DetailsForm detailsForm){ //DetailsForm contain a parameter called destinationId with value 1234 final ModelAndView mav = new ModelAndView(); //Some logic to get targeted destinationId (7890) using destinationId (1234) from detailForm mav.setViewName("forward:/search?destinationId=7890"); return mav; } @RequestMapping(path = "/search") public ModelAndView details(@ModelAttribute final SearchForm searchForm){ //Here I tried to get destinationId from model-attribute searchForm final Integer destinationId = searchForm.getDestinationId(); //Then it returned me 1234,7890 }

¿Alguien puede ayudarme a resolver esto? Quiero obtener solo 7890.

about 3 years ago · Santiago Trujillo
1 answers
Answer question

0

Yo también estoy interesado en la respuesta. También me encontré con este problema, lo pirateé agregando un método:

 private String getLastPartFromFormValue(final String value) { if (value == null) return null; String[] parts = value.split(","); return parts[parts.length -1]; }
about 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error