Rqgg Page 1/2

tieplantlimabeansSoftware and s/w Development

Oct 28, 2013 (3 years and 7 months ago)


JSP request is not pass to another jsp page when using jquery load method
Asked by
on 2013-03-26T03:59:30-04:00
I encountered a problem when using jquery's load() method in JSP page. In the first page, I am
trying to set attribute list1 into request and use load() to load contents of page 2 into page 1's

list1 = new ArrayList
(); request.setAttribute("list1", list1); %>

In second page, list1 is being retrieved from request and do some processing before being output by

list2 = (ArrayList
) request.getAttribute("list1"); // process something here if (list2==null){
out.println("list2 is null"); } else { // out.println() contents of list2 } %>
Then here is where the
problem lies.
in page 2 returns null pointer, and after some research I
found that request is not being sent to page 2 so I cannot retrieve "list1" from request.

I cannot use
request.getRequestDispatcher("page2.jsp").forward(request, response)
in page 1 as
it will redirect me to page2.jsp, that is not what I intended to do.

Is there any work around that I can pass request to page 2 so that I can retrieve the data? Thanks.

Best Answer
Answer by
on 2013-03-26T04:02:05-04:00
wrap it in
doc ready

$(function(){ $("#content").load("page2.jsp"); });
Mar 26th, 2013
Week 13, 2013
March, 2013
Dynamically adding links in a webpage by retreiving values from database
jquery - drill down into iframe
simplexml_load_string fails to load xml from a url
How to show form input fields based on select value?
How to add JSP variable in jQuery?
Dont submit form after pressing a button
Why does jQuery .data() method only return the first word in a String?
jquery trigger action on option add
AutoComplete using jquery pass value to hidden field
How to call Action using Ajax in Strut2
View Online
Page 1/2
JSP request is not pass to another jsp page when using jquery load method
Page 2/2