我在AdobeCQ5一個新手。我在張貼表單時遇到了一些麻煩。這裏是我的結構 -無法發佈形式Adode CQ5
/apps/<myproject>/components/mytestcomponent
mytestcomopnent.jsp有以下代碼 -
<form id="myForm" action="<%=resource.getPath()+".html" %>">
<input type="text" id="t1" class="input-small" placeholder="Temprature F" />
<input type="text" id="t2" class="input-small" placeholder="Temprature C" readonly/>
<button type="button" id="cbtn" class="btn">Convert</button>
</form>
<script>
$(document).ready(function() {
$('#cbtn').click(function() {
var URL = $("#myForm").attr("action");
alert(URL);
var t1=$("#t1").val();
var t2=$("#t2").val();
$.ajax({
url: URL,
data:{'t1':t1},
type:"post",
success: function(data, status) {
$("#t2").val(data);
},
error: function(xhr, txtStat, errThrown) {
alert("ajax error! " + txtStat + ":::" + errThrown);
}
});
});
});
</script>
這是給我的回覆代碼200(成功),但輸出不期望的。我mycomponent.POST.jsp有以下代碼 -
<%
// TODO add you code here
String t1=request.getParameter("t1");
%>
<%= t1 %>
它提供了以下輸出
Content modified /content/imobile/en/jcr:content/social.html
Status
200
Message
OK
Location /content/imobile/en/_jcr_content/social.html
Parent Location /content/imobile/en/_jcr_content
Path
/content/imobile/en/jcr:content/social.html
Referer http://example.comt:4502/content/imobile/en.html
ChangeLog
<pre></pre>
Go Back
Modified Resource
Parent of Modified Resource
請幫助解決這個問題。
謝謝編輯此。 – Hitesh