I've a variable in jsp which has been passed from servlet. Now I want fetch the value of that variable in Jquery function
Here is my servlet:
request.setAttribute("bt", list);
request.setAttribute("rep", docbase);
request.getRequestDispatcher("Welcome.jsp").forward(request, response);
Here is my jsp where I'm retrieving the variable:
<%String repository = (String)request.getAttribute("rep"); %>
Here is my jQuery where I want to fetch the value of "repository":
<script type="text/javascript">
$(document).ready(function() {
var name = $('select[name="doctype"]').attr('id');
alert($.name);
$.ajax({
url:'',
type:'post',
cache:false,
success: function(response){
}
});
});
</script>
I'm very new to jQuery, any kind of help is appreciated. Thank you!