jsp頁面修改爲html頁面

主要修改之處
javascript

  1. 對於c:if標籤的修改html

    在jsp中:java

<c:if test="${sessionScope.UVO.guestName==null}">
	<meta http-equiv="REFRESH" content="0;url=initGuestLogin">
</c:if>

  在html中修改成:session

<div th:if="${#strings.isEmpty(session.UVO.guestName)}">
	<meta http-equiv="REFRESH" content="0;url=initGuestLogin"/>
</div>

2.包含的文件修改:jsp

 在jsp中:post

<div class="copy">
<jsp:include page="/WEB-INF/jsp/shop/copyRight.jsp"></jsp:include>
								</div>

在html中:ui

<div class="copy">
				<div th:replace="shop/ page-copy-right ::  page-copy-right"></div>
								</div>
 page-copy-right標識的是 copyRight.html的name

3.在jsp中url

  <form:form modelAttribute="alipayForm" action="replayAlipaySubmit"
							method="post">
			<form:hidden path="outTradeNo" value="${alipayForm.outTradeNo}"/>
			<form:hidden path="subject" value="${alipayForm.subject}"/>
		        <form:hidden path="body" value="${alipayForm.body}"/>
			<form:hidden path="price" value="${alipayForm.price}"/>   
			<form:hidden path="showUrl" value="${alipayForm.showUrl}"/>
			<form:hidden path="receiveName" value="${alipayForm.receiveName}"/>
			<form:hidden path="receiveAddress" value="${alipayForm.receiveAddress}"/>
			<form:hidden path="receiveZip" value="${alipayForm.receiveZip}"/>
			<form:hidden path="receivePhone" value="${alipayForm.receivePhone}"/>
		        <form:hidden path="receiveMobile" value="${alipayForm.receiveMobile}"/>
				                                     </form:form>

在html中code

 <form th:object="${alipayForm}" action="replayAlipaySubmit" method="post">
		<input type="hidden" name="outTradeNo" th:value="${alipayForm.outTradeNo}"/>
		<input type="hidden" name="subject" th:value="${alipayForm.subject}"/>
		<input type="hidden" name="body" th:value="${alipayForm.body}"/>
		<input type="hidden" name="price" th:value="${alipayForm.price}"/>
		<input type="hidden" name="showUrl" th:value="${alipayForm.showUrl}"/>
		<input type="hidden" name="receiveName" th:value="${alipayForm.receiveName}"/>
		<input type="hidden" name="receiveAddress" th:value="${alipayForm.receiveAddress}"/>
		<input type="hidden" name="receiveZip" th:value="${alipayForm.receiveZip}"/>
		<input type="hidden" name="receivePhone" th:value="${alipayForm.receivePhone}"/>
		<input type="hidden" name="receiveMobile" th:value="${alipayForm.receiveMobile}"/>
		</form>


實現該頁面轉到原頁面,產生一個新窗口orm

$一個Query標識

<script type="text/javascript">
$(document).ready(function(){//前臺頁面的read方法
	$("#submitAlipay").click(function(){
	//Id爲submitAlipay的按鈕點擊是會產生功能
		alipayForm.target = "newWindow";//定義一個newwindow		
		var win = window.open("about:blank", "newWindow");//產生一個新的頁面
		win.focus();//新產生頁面獲取焦點
		alipayForm.submit();//提交form單
		window.location.href="initGoods?type=liangshi";//跳轉到首頁
	});
});
</script>
相關文章
相關標籤/搜索