当我使用netbeans运行时,它始终打开HTTP状态404 - 在我的浏览器上找不到。我试着解决这个问题,但没有任何改变。请帮我。这是我的代码:
calendar.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<link href='css/fullcalendar.css' rel='stylesheet' />
<script src='js/jquery-1.9.1.min.js'></script>
<script src='js/jquery-ui-1.10.2.custom.min.js'></script>
<script src='js/fullcalendar.min.js'></script>
<script>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var calendar = $('#calendar').fullCalendar({
editable: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: "event.jsp",
// Convert the allDay from string to boolean
eventRender: function(event, element, view) {
if (event.allDay === 'true') {
event.allDay = true;
} else {
event.allDay = false;
}
},
selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
var title = prompt('Event Title:');
var url = prompt('Type Event url, if exits:');
if (title) {
var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss");
var end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss");
$.ajax({
url: 'add_event.jsp',
data: 'title='+ title+'&start='+ start +'&end='+ end +'&url='+ url ,
type: "POST",
success: function(json) {
alert('Added Successfully');
}
});
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
}
calendar.fullCalendar('unselect');
},
editable: true,
eventDrop: function(event, delta) {
var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
$.ajax({
url: 'update_event.jsp',
data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id ,
type: "POST",
success: function(json) {
alert("Updated Successfully");
}
});
},
eventResize: function(event) {
var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss");
var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss");
$.ajax({
url: 'update_event.jsp',
data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id ,
type: "POST",
success: function(json) {
alert("Updated Successfully");
}
});
}
});
});
</script>
<style>
body {
margin-top: 40px;
text-align: center;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#calendar {
width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>
event.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page import="java.sql.*"%>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/fullcalendar",
"root", "");
Statement st = con.createStatement();
ResultSet rs;
rs = st.executeQuery("SELECT * FROM evenement ORDER BY id");
%>
add_event.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page import="java.sql.*"%>
<%
String start = request.getParameter("start");
String end = request.getParameter("end");
String title = request.getParameter("title");
String url = request.getParameter("url");
Class.forName("com.mysql.jdbc.Driver");
Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/fullcalendar",
"root", "");
Statement st = con.createStatement();
ResultSet rs;
rs = st.executeQuery("INSERT INTO evenement (title, start, end, url) "
+ "values ('" + title + "','" + start + "','" + end + "','" + url + "')");
%>
update_event.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page import="java.sql.*"%>
<%
String start = request.getParameter("start");
String end = request.getParameter("end");
String title = request.getParameter("title");
String url = request.getParameter("url");
Class.forName("com.mysql.jdbc.Driver");
Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/fullcalendar",
"root", "");
Statement st = con.createStatement();
ResultSet rs;
rs = st.executeQuery("UPDATE evenement set ('" + title + "','" + start + "','" + end + "','" + url + "')");
%>
答案 0 :(得分:0)
请原谅我,如果这听起来很基本,但404错误意味着所提到的东西不在那里。我会查看您的链接,确保所有内容都已上传到托管位置。