У меня есть веб-приложение jsp. Я хочу хранить jsp в отдельных папках, таких как f1 / jsp1.jsp, f2 / jsp21.jsp, f2 / jsp22.jsp, f3 / jsp3.jsp, а также некоторые файлы сервлетов непосредственно в пакете по умолчанию. Теперь, если мне нужно вызвать сервлет в ajax, я должен вернуться на шаг назад, как показано ниже (../ Категория). Как я могу избежать этого. Я хочу вызвать его напрямую (Категория), а также сохранить файлы jsp в папке
$.ajax({
url: '../Category',
data: {"category_id": id, "status": value3, "mode": button_id},
dataType: "html",
contentType: "application/json",
type: 'GET',
success: function () {
if (status === "Active") {
swal({title: "Deactivated!", text: "De-activated the course category successfully.", type: "success"},
function () {
// $('#sampleTable').load(location.href+"#sampleTable");
location.reload();
});
} else {
swal({title: "Activated!", text: "Activated the course category successfully.", type: "success"},
function () {
// $('#sampleTable').load(location.href+"#sampleTable");
location.reload();
});
}
},
error: function () {
swal("Error", "System Error: Could not " + value2 + " the category in the database. Please try again or report to the system admin.", "error");
}
});