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

209
Views
Spring MVC forward appending request parameter values comma separated when we have same parameter name for topRequest and forward request

Spring MVC forward appending request parameter values comma separated when we have same parameter name for topRequest and forward request

@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
}

Can someone please help me out how to resolve this. I want to get only 7890.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I am interested in the answer also. I also hit this problem hacked it by adding a method:

private String getLastPartFromFormValue(final String value) {
    if (value == null)
        return null;
    String[] parts = value.split(",");
    return parts[parts.length -1];
}
about 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!