[英]JSP file opening like a download file
我已經在netbeans上創建了一個Web項目,並且像下載文件一樣打開了time.jsp頁面,而是在Internet Explorer上打開了該頁面。 為什么會這樣呢? 謝謝。
<jsp version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/page"
xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
<jsp:directive.page contentType="text/html:charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page id="page1">
<webuijsf:html id="html1">
<webuijsf:head id="head1" title="Web Time: A Simple Example">
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
<webuijsf:meta content="60" httpEquiv="refresh"/>
</webuijsf:head>
<webuijsf:body id="body1" style="-rave-layout: grid">
<webuijsf:form id="form1">
<webuijsf:staticText id="timeHeader"
style="font-size: 18px; left: 24px; top: 24px;
position: absolute"
text="Current time on the web server"/>
<webuijsf:staticText binding=""
id="clockText" style="background-color: black;
color: yellow; font-size: 18px; left: 24px;
top: 48px; position: absolute"/>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
這是因為您很可能不會在知道如何處理jsp的服務器上運行它,因此它將只是將文件傳遞給瀏覽器。 瀏覽器也不知道如何處理,因此只需下載即可。 您需要在服務器上運行諸如tomcat之類的Web容器。
本指南將告訴您您需要做什么。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.