I want to send a POST - method line, for example, "Nadezhda Larionova," in the following way:

<select name="lawyer"> <option value="Π›Π°Ρ€ΠΈΠΎΠ½ΠΎΠ²Π° НадСТда НиколаСвна">Π›Π°Ρ€ΠΈΠΎΠ½ΠΎΠ²Π° НадСТда НиколаСвна</option>"); </select> 

In the servlet I get "Larionov" instead of the whole line, if it somehow helps, then just in case: I use portlets in jsp - pages.

 out.println("<select name=\"lawyer\">"); out.println("<option selected value=" + lawyerNames.get(0) + ">" + lawyerNames.get(0) + "</option>"); for(String lawyerName : lawyerNames) { out.println("<option value=" + lawyerName + ">" + lawyerName + "</option>"); } out.println("</select>"); 

Why don't I get a whole string?

    1 answer 1

    Judging by this line

     out.println("<option value=" + lawyerName + ">" + lawyerName + "</option>"); 

    At the exit you get

     <option value=Π›Π°Ρ€ΠΈΠΎΠ½ΠΎΠ²Π° НадСТда НиколаСвна>Π›Π°Ρ€ΠΈΠΎΠ½ΠΎΠ²Π° НадСТда НиколаСвна</option> 

    The value not enclosed in quotes, so only the character set is taken into account

    • one
      Thanks, really forgot to enclose the string in quotes! - Igor Gorbunov