I am calling a JSP page in Jquery as
onExpandRow: function(index,row){
height:160,
border:true,
cache:true,
href:'service.jsp?empNo='+empNo,
and in service.jsp I would like to pass the parameter to a servlet and return data in JSON.
JSP code snippet
$(document).ready(function(){
$.ajax({ url: "service.jsp",
context: document.body,
success: function(){
$.get('myservlet?empNo=<%=request.getParameter("empNo")%>',
function(data) {
For some reason this is not working, however if I am directly calling service.jsp?empNp=JAMES, then it works as I expect.
How and what is the best way to get values from servlet when I am calling service.jsp when I am clicking a row in Jquery? Ideally I would like to call service.jsp, as soon as service.jsp is called, would like to invoke servlet and return data and display the results.
Any help is highly appreciable.