• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/site/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/site/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/site/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Fetchinng JSON data from servlet to display on JSP

i have a servlet where it fetches my data from MySQL, i forward the request to my JSP page, at the moment, i can't seem to fetch my data properly.

I can get my JSON String "listJ" just fine, but i am unable to assign it to a var "listJson". Can anyone advise me on the right way to fetch data, i will eventually need to implement AJAX and i think the only way forward is that the data has to be in JSON form in order to do that.

My previous issue is: Using Jquery Ajax on JSP to display on Datatables

Servlet

ArrayList listS = DBUtils.load(searchKey); .... String json =  gson.toJson(listS); request.setAttribute("listS", json); request.getRequestDispatcher("WEB-INF/index.jsp").forward(request, response); 

JSP


						
					
					

Popular Questions

Trending Tags

Related Questions