Seeing org.springframework.beans.NotWritablePropertyException for query string parameters. Here are the details.My application URL is :http://localhost:9001/xx/xx.do?param1=Hello&param2=Hai.. When I run the application, I am seeing exception for param1 and param2.Snippet below:

Invalid property 'param1' of bean class [ClassName]: Bean property 'param1' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Could you please help me If somebody has seen something similar before.

share|improve this question
  • 1
    could you please paste some code here?– Axel AmthorFeb 14 at 20:21
  • Thank you. As part of my JSP, I have not defined any param1 or param2. I am just passing some static parameters from each JSP. Jsp: <form:form modelAttribute="BeanName" action="/xx/xx.do?param1=Hello&param2=Hai." > And, neither my bean has any information about these two parameters. My logic is, Read the query parameter from the request object and execute required logic. Controller: @RequestMapping(value="/xx.do") public ModelAndView handle(HSR req,HSRes res,@ModelAttribute("BeanName") BeanNameClass BeanName,BindingResult result) { String pa1=req.getParameter("param1");– Prasad BollaFeb 14 at 20:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.