Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

210
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda