Results 1 to 1 of 1
  1. #1
    Kenan_89 is offline Member
    Join Date
    Jan 2012
    Posts
    25
    Rep Power
    0

    Default Delivering an array to jsp

    Hello guys,

    I have a problem.

    How can I deliver an array to my JSP?

    The problem is I get "null" if I let print out
    the array on the jsp with system.out.println().

    Here is my code:

    javascript:
    PHP Code:
    var test = [];
    test.push("value1");
    test.push("value2");
    test.push("value3");
    
    	$.ajax({
    		type : "POST",
    		url : "edit.jsp",
    		dataType : "json",
    		data : ({"test" : test}),	
    		success : function(data){
                               //...
    		}
    	});
    ----

    edit.jsp
    PHP Code:
    String[] test= request.getParameterValues("test");
    
    System.out.println(test);

    Thanks for help :-)
    Last edited by Kenan_89; 10-23-2012 at 06:19 PM.

Similar Threads

  1. Replies: 3
    Last Post: 12-28-2013, 10:39 PM
  2. Replies: 15
    Last Post: 05-14-2012, 01:42 PM
  3. Replies: 0
    Last Post: 05-12-2011, 08:04 PM
  4. Replies: 2
    Last Post: 09-06-2010, 02:03 AM
  5. Replies: 1
    Last Post: 03-31-2009, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •