jsp源代码正常,但页面显示空白
我用postMan模拟的时候可以用,就是在浏览器上显示空白(edge,QQ浏览器都试过了)<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false" %>
<%@ include file="../../foreinclude/foreHander1.jsp" %>
<style>
.order_goods_list li {
float: left;
height: 80px;
line-height: 80px;
}
.order_goods_list .col01 {
width: 20%
}
.order_goods_list .col01 img {
width: 60px;
height: 60px;
border: 1px solid #ddd;
margin: 10px auto;
}
.order_goods_list .col02 {
width: 24%;
text-align: center;
}
.order_goods_list .col02 em {
color: #999;
margin-left: 10px
}
.order_goods_list .col03 {
width: 10%
}
.order_goods_list .col04 {
width: 20%
}
.order_list_th {
width: 1107.2px;
border: 1px solid #ddd;
background-color: #f7f7f7;
margin: 20px auto 0;
}
.order_list_th li {
float: left;
height: 30px;
line-height: 30px
}
.order_list_th .col01 {
width: 35%;
margin-left: 20px
}
.order_list_th .col02 {
width: 20%
}
</style>
<div class="breadcrumb-area pt-15 pb-15">
<div class="container">
<div class="row">
<div class="col-lg-12">
<!--=======breadcrumb container=======-->
<div class="breadcrumb-container">
<nav>
<ul>
<li class="parent-page"><a href="/fore/foreIndex">Home</a></li>
<li>orders</li>
</ul>
</nav>
</div>
<!--=======End of breadcrumb container=======-->
</div>
</div>
</div>
</div>
<!--=== My Account page content ===-->
<div class="page-section mb-50">
<div class="container">
<div class="row">
<div class="col-12">
<div class="row">
<!-- My Account Tab Content Start -->
<div class="col-lg-12 col-12">
<div class="tab-content" id="myaccountContent">
<!-- Single Tab Content Start -->
<div class="tab-pane fade show active" role="tabpanel">
<div class="myaccount-content">
<h3>Orders</h3>
<c:forEach items="${os}" var="order" varStatus="vs">
<ul style="float:left" class="order_list_th">
<li class="col01">${vs.count} 订单号:${order.code},已支付</li>
</ul>
<div class="myaccount-table table-responsive text-center">
<table class="table table-bordered" width='100%' border='0' cellspacing='0'
cellpadding='0' style='table-layout: fixed'>
<tbody>
<tr>
<td width="55%">
<c:forEach items="${order.orderItems}" var="oi">
<ul class="order_goods_list">
<li class="col01"><img
src="${pageContext.request.contextPath}/${oi.product.imageurl}"
width="50px" height="50px"></li>
<li class="col02"><a
href="foreDetailUI?id=${oi.product.id}">${oi.product.name},${oi.product.price}</a>
</li>
<li class="col03">${oi.number}</li>
<li class="col04">¥${oi.product.price*oi.number}</li>
</ul>
</c:forEach>
</td>
<td width="15%">${order.total}元</td>
<td width="15%">
<div class="hover-icons">
<a href="#" id="addressMsg"
onclick="showAddressMsg('${order.address}');"
title="${order.address}">
<img src="${pageContext.request.contextPath}/images/address.png"
width="30px" height="30px">
</a>
</div>
</td>
<td width="15%">
<button style="margin-bottom: 10px"
onclick="receiving(${order.id}) "
class="btn btn-default">收货
</button>
<br>
<c:if test="${order.status==1}">未发货</c:if>
<c:if test="${order.status==2}">已发货</c:if>
<c:if test="${order.status==3}"><span
style="color: green">已收货</span></c:if>
<c:if test="${order.status==4}"><span
style="color: red">已申请退货</span></c:if>
<c:if test="${order.status==5}"><span
style="color: red">已退货</span></c:if>
<br>
<button style="margin-top: 10px" onclick="returns(${order.id}) "
class="btn btn-default">退货
</button>
</td>
</tr>
</tbody>
</table>
</div>
</c:forEach>
</div>
</div>
<!-- Single Tab Content End -->
</div>
</div>
<!-- My Account Tab Content End -->
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
function returns(id) {
$.ajax({
url: '/order/returns',
type: 'get',
dataType: 'json',
data: {id: id},
success: function (data) {
if (data.status === 200) {
alert(data.msg)
location = location
} else {
alert(data.msg)
}
}
})
}
function receiving(id) {
$.ajax({
url: '/order/receiving',
type: 'get',
dataType: 'json',
data: {id: id},
success: function (data) {
if (data.status === 200) {
alert(data.msg)
location = location
} else {
alert(data.msg)
}
}
})
}
function showAddressMsg(msg) {
alert(msg)
}
</script>
这个问题可能由多种原因导致,下面是几个可能的解决方案:
1. 检查服务器日志:服务器日志中可能会显示出现问题的原因。如果服务器返回了500错误,可能是服务器端的问题。如果服务器返回了200,但页面仍然是空白,那可能是客户端的问题。
2. 检查浏览器控制台:在浏览器中打开开发者工具(一般是F12),查看控制台中是否有错误消息。可能的错误包括JavaScript错误、资源加载错误等。
3. 检查JSP页面是否有语法错误:尽管你说源代码没有问题,但有时候可能会忽略掉一些小错误。尤其是在JSP表达式、标签库等方面。
4. 检查网络请求:使用浏览器的开发者工具,查看网络选项卡中的请求和响应。确认服务器是否返回了预期的内容。
5. 检查包含的文件:你的JSP页面包含了其他的JSP文件(比如 ../../foreinclude/foreHander1.jsp ),确保这些文件存在且没有错误。
6. 清理浏览器缓存:有时候浏览器缓存可能会导致页面加载问题。你可以尝试清理浏览器的缓存,然后重新加载页面看看。
如果上述步骤都无法解决问题,你可能需要进行更深入的调试,或者寻求专业的技术支持。 isdkz 发表于 2023-5-15 17:36
这个问题可能由多种原因导致,下面是几个可能的解决方案:
1. 检查服务器日志:服务器日志中可能会显示 ...
tomcat没有报错,浏览器控制台也没有报错,我的forHander1.jsp显示出来了就是forebought.jsp显示空白,强制刷新也试过了,已经禁用缓存了,就是空白{:5_104:} 源代码
<!DOCTYPE html>
<html class="no-js" lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>校园快捷订餐</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicon -->
<link rel="icon" href="/assets/images/favicon.ico">
<!-- CSS
============================================ -->
<!-- Bootstrap CSS -->
<link href="/assets/css/bootstrap.min.css" rel="stylesheet">
<!-- FontAwesome CSS -->
<link href="/assets/css/font-awesome.min.css" rel="stylesheet">
<!-- Ionicons CSS -->
<link href="/assets/css/ionicons.min.css" rel="stylesheet">
<!-- Plugins CSS -->
<link href="/assets/css/plugins.css" rel="stylesheet">
<!-- Helper CSS -->
<link href="/assets/css/helper.css" rel="stylesheet">
<!-- Main CSS -->
<link href="/assets/css/main.css" rel="stylesheet">
<!-- Modernizer JS -->
<script src="/assets/js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body class="grey-bg">
<!--=============================================
= header container =
=============================================-->
<div class="header-container header-container-home-4 header-sticky white-bg">
<!--=============================================
= header top =
=============================================-->
<div class="header-top pt-15 pb-15">
<div class="container">
<div class="row">
<div class="col-12 col-lg-6">
<!--=======header top dropdowns=======-->
<div class="header-top-dropdown d-flex justify-content-center justify-content-lg-end">
<!--=======single dropdown=======-->
<div class="single-dropdown">
<a href="/fore/foreIndex" id="changeLanguage"><span id="languageName">首页</span></a>
</div>
<span class="separator pl-15 pr-15">|</span>
<!--=======End of single dropdown=======-->
<div class="single-dropdown">
<a href="#"><span>欢迎您,byh
</span>
</a>
</div>
<span class="separator pl-15 pr-15">|</span>
<div class="single-dropdown">
<a href="/fore/foreCstLoginOut"><span>退出</span></a>
</div>
<!--=======End of single dropdown=======-->
</div>
<!--=======End of header top dropdowns=======-->
</div>
</div>
</div>
</div>
<!--=====End of header top======-->
<!--=============================================
= navigation menu top =
=============================================-->
<div class="navigation-menu-top navigation-menu-top-home-4 pt-35 pb-35 pt-md-15 pb-md-15 pt-sm-15 pb-sm-15 mb-md-55 mb-sm-55">
<div class="container">
<div class="row align-items-center">
<div class="col-6 col-lg-2 col-md-6 col-sm-6 order-1 order-lg-1">
<!--=======logo=======-->
<div class="logo">
<a href="/fore/foreIndex">
<img src="/assets/images/logo.png" class="img-fluid" alt="">
</a>
</div>
<!--=======End of logo=======-->
</div>
<!--=======End of header feature container=======-->
</div>
</div>
</div>
</div>
<!--=======End of navigation menu top=======-->
<!--=============================================
= navigation menu =
=============================================-->
<div class="navigation-menu">
<div class="container">
<div class="row align-items-center justify-content-between">
<div class="col-12 col-lg-3 col-md-12 col-sm-12">
<!--=======category menu=======-->
<div class="hero-side-category">
<!-- Category Toggle Wrap -->
<div class="category-toggle-wrap">
<!-- Category Toggle -->
<button class="category-toggle" id="categorys"> <i class="fa fa-bars"></i> 商品分类 </button>
</div>
<!-- Category Menu -->
<nav class="category-menu">
<ul>
<li><a href="foreFindCategory?id=1" >奶茶专区</a></li>
<li><a href="foreFindCategory?id=2" >甜品/蛋糕</a></li>
<li><a href="foreFindCategory?id=3" >包子/早点</a></li>
<li><a href="foreFindCategory?id=4" >午饭套餐</a></li>
<li><a href="foreFindCategory?id=5" >肉类炒菜</a></li>
<li><a href="foreFindCategory?id=6" >素菜专区</a></li>
</ul>
</nav>
</div>
<!--=======End of category menu =======-->
<!--=======sticky logo=======-->
<div class="sticky-logo" style="margin-top: -33px">
<a href="/fore/foreIndex">
<img src="/assets/images/logo.png" class="img-fluid" alt="">
</a>
</div>
<!--=======End of sticky logo=======-->
<!--=======search icon for tablet=======-->
<div class="search-icon-menutop-tablet text-right d-inline-block d-lg-none">
<a href="#" id="search-overlay-active-button">
<i class="icon ion-md-search"></i>
</a>
</div>
<!--=======End of search icon for tablet=======-->
</div>
<div class="col-12 col-lg-6">
<!-- navigation section -->
<div class="main-menu">
<nav>
<ul>
<li><a href="/fore/forecart">我的购物车</a></li>
<li><a href="/fore/forebought">我的订单</a></li>
<li><a href="/fore/faq">常问问题</a></li>
</ul>
</nav>
</div>
<!-- end of navigation section -->
</div>
<div class="col-12 col-lg-3">
<!--=======navigation search bar=======-->
<div class="navigation-search d-none d-lg-block">
<form method="post" action="/fore/foreNameLike">
<input type="search" placeholder="Search product ..." name="pName" id="">
<button type="submit"><i class="icon ion-md-search"></i></button>
</form>
</div>
<!--=======End of navigation search bar=======-->
</div>
<div class="col-12 d-block d-lg-none">
<!-- Mobile Menu -->
<div class="mobile-menu"></div>
</div>
</div>
</div>
</div>
<!--=====End of navigation menu======-->
</div>
<style>
.order_goods_list li {
float: left;
height: 80px;
line-height: 80px;
}
.order_goods_list .col01 {
width: 20%
}
.order_goods_list .col01 img {
width: 60px;
height: 60px;
border: 1px solid #ddd;
margin: 10px auto;
}
.order_goods_list .col02 {
width: 24%;
text-align: center;
}
.order_goods_list .col02 em {
color: #999;
margin-left: 10px
}
.order_goods_list .col03 {
width: 10%
}
.order_goods_list .col04 {
width: 20%
}
.order_list_th {
width: 1107.2px;
border: 1px solid #ddd;
background-color: #f7f7f7;
margin: 20px auto 0;
}
.order_list_th li {
float: left;
height: 30px;
line-height: 30px
}
.order_list_th .col01 {
width: 35%;
margin-left: 20px
}
.order_list_th .col02 {
width: 20%
}
</style>
<div class="breadcrumb-area pt-15 pb-15">
<div class="container">
<div class="row">
<div class="col-lg-12">
<!--=======breadcrumb container=======-->
<div class="breadcrumb-container">
<nav>
<ul>
<li class="parent-page"><a href="/fore/foreIndex">Home</a></li>
<li>orders</li>
</ul>
</nav>
</div>
<!--=======End of breadcrumb container=======-->
</div>
</div>
</div>
</div>
<!--=== My Account page content ===-->
<div class="page-section mb-50">
<div class="container">
<div class="row">
<div class="col-12">
<div class="row">
<!-- My Account Tab Content Start -->
<div class="col-lg-12 col-12">
<div class="tab-content" id="myaccountContent">
<!-- Single Tab Content Start -->
<div class="tab-pane fade show active" role="tabpanel">
<div class="myaccount-content">
<h3>Orders</h3>
<ul style="float:left" class="order_list_th">
<li class="col01">1 订单号:201811021055177112826,已支付</li>
</ul>
<div class="myaccount-table table-responsive text-center">
<table class="table table-bordered" width='100%' border='0' cellspacing='0'
cellpadding='0' style='table-layout: fixed'>
<tbody>
<tr>
<td width="55%">
<ul class="order_goods_list">
<li class="col01"><img
src="/images/product/2.jpg"
width="50px" height="50px"></li>
<li class="col02"><a
href="foreDetailUI?id=2">焦糖珍奶,10.0</a>
</li>
<li class="col03">1</li>
<li class="col04">¥10.0</li>
</ul>
</td>
<td width="15%">10.0元</td>
<td width="15%">
<div class="hover-icons">
<a href="#" id="addressMsg"
onclick="showAddressMsg('5a124');"
title="5a124">
<img src="/images/address.png"
width="30px" height="30px">
</a>
</div>
</td>
<td width="15%">
<button style="margin-bottom: 10px"
onclick="receiving(1) "
class="btn btn-default">收货
</button>
<br>
已发货
<br>
<button style="margin-top: 10px" onclick="returns(1) "
class="btn btn-default">退货
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Single Tab Content End -->
</div>
</div>
<!-- My Account Tab Content End -->
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="/js/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
function returns(id) {
$.ajax({
url: '/order/returns',
type: 'get',
dataType: 'json',
data: {id: id},
success: function (data) {
if (data.status === 200) {
alert(data.msg)
location = location
} else {
alert(data.msg)
}
}
})
}
function receiving(id) {
$.ajax({
url: '/order/receiving',
type: 'get',
dataType: 'json',
data: {id: id},
success: function (data) {
if (data.status === 200) {
alert(data.msg)
location = location
} else {
alert(data.msg)
}
}
})
}
function showAddressMsg(msg) {
alert(msg)
}
</script>
根据您提供的代码,似乎缺少了结尾的 HTML 标签。请查看您的代码,将缺失的标签进行添加,可以使用 W3C 官网提供的 (https://validator.w3.org/) 进行验证并找出问题所在。
另外,您也可以在浏览器中打开控制台(`F12`或右键点击网页选择“检查”),查看是否有报错信息,以便更好地定位问题。 sfqxx 发表于 2023-5-15 18:14
根据您提供的代码,似乎缺少了结尾的 HTML 标签。请查看您的代码,将缺失的标签进行添加,可以使用 W3C 官 ...
我这个是jsp页面{:10_250:} 最强废铁h 发表于 2023-5-15 18:17
我这个是jsp页面
看起来提供的代码不完整且中断在 HTML 标签的结尾。没有缺失的代码和更多上下文,很难确定为什么页面在某些浏览器上显示为空白屏幕。
然而,这里有一些建议:
- 检查 JSP 文件是否正确包含了所有必要的库和依赖项。
- 检查是否存在任何 JavaScript 错误或控制台日志可能会引起问题。
- 尝试清除浏览器缓存并重新加载页面。
- 在不同的浏览器上测试 JSP 文件,看看问题是否仍然存在。
页:
[1]