Hi,

Has somebody idea how to solve it.

I'm not sure but it seems that jsp are not so flexible technology.

 

Regards,

Rafal

 

 

Dnia 11-02-2011 o godz. 19:02 Rafał Laczek napisał(a):

Hi,

In my Form.jsp page I have a simple checkbox.

I need to send selected results to CategoryResult  servlet.

I can do that but in the browser the name of the servlet is automatically appended to the address as follow:

http://localhost:8080/Rss/CategoryResult

I know that this is executed by "action" in the form.

My goal is to keep the earlier address:  http://localhost:8080/Rss and send inserted data to the CategoryResult.

Other solution may be to keep inserted data in form.jsp but here I must have possibility to create any getter method and finally to be able to invoke this method in for example CategoryResult.java.

Below I give you my present jsp and servlet.

I tried also with post method.

Thanks and regards,

Rafal

 

Form.jsp

<form action="/Rss/CategoryResult" method="get">

<input type="checkbox" name="id" value="Nord"> Nord<BR>

<input type="checkbox" name="id" value="Sor"> Sor<BR>

<input type="checkbox" name="id" value="Vest"> Vest<BR>

<input type="checkbox" name="id" value="Ost"> Ost<BR>

<input type="submit" value="Submit">

</form>

<%

/*

String select[] = request.getParameterValues("id");

if (select != null && select.length != 0) {

System.out.println("I'm in Form. You have selected: ");

for (int i = 0; i < select.length; i++) {

System.out.println(select[i]);

out.println(select[i]);

}

}

*/

%>

 

CategoryResult.java

       public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException{

         this.doPost(request,response);

         String select[] = request.getParameterValues("id");

         if (select != null && select.length != 0) {

         System.out.println("You have selected: ");

         for (int i = 0; i < select.length; i++) {

         System.out.println(select[i]);

         }

         }

       

 }

 


 

--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en



--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to