기본적으로 나는 우연한 타임 라인 위젯을 사용하는 timeline.html 페이지를 여는 서블릿을 가지고 있습니다. 웹 페이지가 user.dir/timeline.html에서 직접 열리면 타임 라인이 완벽하게 표시됩니다. 그러나 웹 페이지가 localhost : 8080에서 서블릿에 의해 열리면 xml 파일이로드되지 않습니다.Simile 타임 라인은 직접 열었을 때 열지 만 서블릿으로 열지 않은 경우에만 표시됩니다.
이유가 궁금하십니까?
if (action.equals("create")) {
request.getRequestDispatcher("/timeline.html").forward(request, response); }
타임 라인 코드 :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Timeline</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script src="http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js?bundle=true" type="text/javascript"></script>
<script>
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
var bandInfos = [
Timeline.createBandInfo({
eventSource: eventSource,
date: "Jun 28 2013 00:00:00 GMT",
width: "70%",
intervalUnit: Timeline.DateTime.MONTH,
intervalPixels: 100
}),
Timeline.createBandInfo({
overview: true,
eventSource: eventSource,
date: "Jun 28 2013 00:00:00 GMT",
width: "30%",
intervalUnit: Timeline.DateTime.YEAR,
intervalPixels: 200
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
Timeline.loadXML("/timeline.xml", function(xml, url) { eventSource.loadXML(xml, url); });}
</script>
</head>
<body onload="onLoad();" onresize="onResize();">
<div id="my-timeline" style="height: 300px; border: 1px solid #aaa"></div>
<noscript>
This page uses Javascript to show you a Timeline. Please enable Javascript in your browser to see the full page. Thank you.
</noscript>
어떤 오류가 발생합니까? 어떤 URL이 작동합니까? 어느 쪽이 아니야? – MaVRoSCy