0 Replies Latest reply on Jun 6, 2012 6:42 AM by MatheusOliveira

    ConstraintViolationException when I create inputs or selections tags on my jsp code

    MatheusOliveira Level 1

      Hello everyone,

       

         I have two pages on my website, and I need to get parameters from one to another. I just do some jsp/html coding, as you can see above, but i'm getting this error page. Can't figure out the error reason, but when I remove the tags that the error page references, the pages open normally. Anyone can tell me why this is happening and how can I solve?

       

       

      Codes:

      Page 1 >

       

      <div class="campos">

                              <select name="estado" id="estado" class="select-estado">

                                  <!--  onchange="javascript:carregaCidades();"-->

                                  <option></option>

                                   <option value="RJ">RJ</option>

                                   <option value="SP" selected="selected">SP</option>

                              </select>

                              <select name="cidade" id="cidade" class="select-cidade">

                                  <option>...</option>

                                  <option selected="selected" value="SPO">SAO PAULO</option>

                              </select>

                             

                              <div class="clear"></div>

                             

                              <%

                              if(request.getParameter("ok") != null)

                                  response.sendRedirect("home.html?estado=" + request.getParameter("estado"));

                              %>                     

                              <form method="post">

                                    <input type="submit" value="Ok" class="botao-ok" name="ok"/>

                              </form>

       

      Page 2 >

       

       

      <%if (request.getParameter("estado") = "SP"){

                          %><li><a href="http://www.gvt.com.br/portal/residencial/autoatendimento/index.jsp" rel="atendimento"><span>São Paulo</span></a></li>

                          <%

                      }else if(request.getParameter("estado") = "SP"){   

                          %><li><a href="http://www.gvt.com.br/portal/residencial/autoatendimento/index.jsp" rel="atendimento"><span>Rio de Janeiro</span></a></li>

                          <%

                      }

                      %>

       

      Error page:

       

        Erro página CQ5.jpg

       

      See that the error page says that there is no no matching property definition found for {}estado, in this case. "estado" is the name of my first select tag. If I just delete this tag, then the error page appears telling that there is no matching property for the "{} cidade", my next select tag.