간단한 문제가 있지만 작동시킬 수 없습니다. 여기에 제가 사용하고있는 코드가 있습니다. main.jsp의 버튼을 클릭하면 reportbuilder.do에서 업데이트 된 이미지를 얻을 수 있지만 빈 이미지 (사실 새 이미지가 생성되었음을 나타 내기 위해 이미지에 타임 스탬프가 제공됩니다). reportbuilder.do에서 reportType, reportScope 및 reportTime이 모두 null임을 알 수 있습니다. 내가 도대체 뭘 잘못하고있는 겁니까?하나의 JSP에서 다른 JSP로 매개 변수를 전달하면 정보가 전달되지 않습니다.
main.jsp
<html>
<head>
<title>Failing example</title>
<script src="/scripts/jquery-1.8.1.js"></script>
<script>
$(document).ready(function() {
$("#updateReport").click(function() {
$("#chart1").load("/chart.jsp?reportType=${reportType}&reportScope=${reportScope}&reportTime=${reportTime}");
return false;
});
});
</script>
</head>
<div id="chart1">
<img src="/reportbuilder.do?">
</div>
<div id="dropDown1">
<form method="GET" action="/chart.jsp">
<select name="reportType" style="width:100%">
<option value="devBugFix">Developer Bug Fixes</option>
<option value="devHrsWork">Developer Hours Worked</option>
</select>
<select name="reportScope" style="width:100%">
<option value="cmcProg">CMC Program</option>
<option value="equFarmAs">Equestrian Farmer's Association</option>
</select>
<select name="reportTime" style="width:100%">
<option value="daily">Daily</option>
<option value="weekly">Weekly</option>
<option value="monthly">Monthly</option>
</select>
<a href="#" id="updateReport"><button>Update Chart</button></a>
</form>
</div>
</html>
chart.jsp는
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>
<img src="/reportbuilder.do?reportType=${reportType}&reportScope=${reportScope}&reportTime=${reportTime}" alt="Image Loading Failed">
</body>
</html>
시간 내 주셔서 감사합니다!