最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

IDEA 2020.2 部署JSF項(xiàng)目的詳細(xì)過程

 更新時(shí)間:2021年09月16日 10:34:33   作者:happy488127311  
本文通過圖文并茂的形式教大家如何在IDEA中創(chuàng)建一個(gè)JSF項(xiàng)目及遇到問題的解決方法,感興趣的朋友跟隨小編一起看看吧

1、下載glassfish

idea2021最新激活方法

去官網(wǎng)下載glassfish4.1.1(最后發(fā)現(xiàn)glassfish5也行)

官網(wǎng)地址:GlassFish

https://javaee.github.io/glassfish/

點(diǎn)擊download

選擇圖中版本

下載完解壓到自己指定的目錄即可

2、配置glassfish環(huán)境變量

將glassfish的bin目錄添加到系統(tǒng)變量path中

3、修改jdk環(huán)境變量

將之前系統(tǒng)環(huán)境變量path里的jdk1.8的環(huán)境變量上移到第一個(gè)

注意:jdk一定要是1.8,并且必須移到第一個(gè)

4、測(cè)試glassfish是否可以正常啟動(dòng)

在cmd里直接輸入 asadmin start-domain ,出現(xiàn)下圖所示即表明配置成功

再輸入 asadmin stop-domain 可以停止glassfish

5、在IDEA中創(chuàng)建一個(gè)JSF項(xiàng)目

1.選擇 java Enterprise, 點(diǎn)擊next

2.勾選 Web Profile,IDEA會(huì)自動(dòng)幫你勾選其他所需要的框架(包括JSF),點(diǎn)擊next

3.輸入模塊名,點(diǎn)擊finish

4.IDEA生成默認(rèn)的項(xiàng)目結(jié)構(gòu)

5.默認(rèn)pom文件內(nèi)容

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <groupId>org.example</groupId>
    <artifactId>jsf-03</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>jsf-03</name>
    <packaging>war</packaging>
 
    <properties>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <junit.version>5.6.2</junit.version>
    </properties>
 
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>8.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
 
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.0</version>
            </plugin>
        </plugins>
    </build>
</project>

6.修改默認(rèn)生成文件,不修改會(huì)報(bào)錯(cuò)

<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
        http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
              version="2.2">
 
</faces-config>

7.在webapp目錄下新建index.xhtml文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<f:view>
    <h:outputLabel value="Hello, world"/>
</f:view>
</html>

8.配置運(yùn)行環(huán)境

點(diǎn)擊運(yùn)行->編輯配置

9.點(diǎn)擊左上角➕,選擇glassfish,local

10.點(diǎn)擊配置,找到自己解壓的glassfish的根目錄

11.點(diǎn)擊部署,點(diǎn)擊➕,點(diǎn)擊工件,選擇war_explore結(jié)尾的

12.點(diǎn)擊應(yīng)用,點(diǎn)擊服務(wù)器,修改默認(rèn)生成的url

13.點(diǎn)擊確定, 啟動(dòng)服務(wù)器,在瀏覽器里輸入相應(yīng)鏈接進(jìn)行訪問


6.問題:部分標(biāo)簽元素?zé)o法顯示

1.頁面代碼如圖所示

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<head>
    MessagesTags
</head>
<h:head>
</h:head>
<h:body>
    <h:form>
        <h:panelGrid columns="1" width="60%">
            <f:facet name="header">Login</f:facet>
            <f:facet name="footer">
                <h:outputText value="快到中秋節(jié)了"/>
                <h:commandButton action="Layoutpage" value="Submit"/>
            </f:facet>
            <h:panelGroup>
                <h:outputText value="Enter ID:"/><h:inputText id="it1" required="true" requiredMessage="ynb"/>
                <h:message for="it1"/>
            </h:panelGroup>
            <h:panelGroup>
                <h:inputSecret required="true">
                    <h:outputLabel value="Enter Password"/>
                </h:inputSecret>
            </h:panelGroup>
        </h:panelGrid>
        <h:messages/>
    </h:form>
</h:body>
</html>

2.運(yùn)行效果圖

3.報(bào)錯(cuò)代碼:

Error in event handler: Error: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
    at Updater.check (chrome-extension://fhopckooaleifhophcpcakhfkajmnffo/js/gmWrapper.js:4:3204)
    at init (chrome-extension://fhopckooaleifhophcpcakhfkajmnffo/js/jquery-1.7.2.js:1:3311)
    at onReadyGM (chrome-extension://fhopckooaleifhophcpcakhfkajmnffo/js/jquery-1.7.2.js:1:76)
    at Object.onInitializedGM (chrome-extension://fhopckooaleifhophcpcakhfkajmnffo/js/gmWrapper.js:4:636)
    at Object.callbackResponse (chrome-extension://fhopckooaleifhophcpcakhfkajmnffo/js/gmWrapper.js:4:331)
    at chrome-extension://fhopckooaleifhophcpcakhfkajmnffo/js/gmWrapper.js:4:3378

4.原因,web.xml 文件配置錯(cuò)誤

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
    <display-name>JSF_SE_CH2_html01_0915</display-name>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <context-param>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
    </context-param>
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

5.解決辦法,將web.xml文件內(nèi)容刪除,只保留 <welcome-file-list> 即可

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
    <display-name>JSF_SE_CH2_html01_0915</display-name>
  
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

6.運(yùn)行截圖,至此,大功告成!

到此這篇關(guān)于IDEA 2020.2 部署JSF項(xiàng)目的文章就介紹到這了,更多相關(guān)IDEA 2020.2 部署JSF項(xiàng)目內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Spring中的事務(wù)操作、注解及XML配置詳解

    Spring中的事務(wù)操作、注解及XML配置詳解

    這篇文章主要給大家介紹了關(guān)于Spring中事務(wù)操作、注解及XML配置的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2018-12-12
  • springcloud集成zookeeper的方法示例

    springcloud集成zookeeper的方法示例

    這篇文章主要介紹了springcloud集成zookeeper的方法示例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-04-04
  • Java利用蒙特卡洛方法求解圓周率π值

    Java利用蒙特卡洛方法求解圓周率π值

    蒙特·卡羅方法(Monte Carlo method),也稱統(tǒng)計(jì)模擬方法,是一種以概率統(tǒng)計(jì)理論為基礎(chǔ)的數(shù)值計(jì)算方法。本文將利用該方法實(shí)現(xiàn)圓周率的計(jì)算,需要的可以參考一下
    2022-08-08
  • elasticsearch集群cluster主要功能詳細(xì)分析

    elasticsearch集群cluster主要功能詳細(xì)分析

    這篇文章主要為大家介紹了elasticsearch集群cluster主要功能詳細(xì)分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-04-04
  • Java自定義異常簡單示例

    Java自定義異常簡單示例

    使用Java內(nèi)置的異常類可以描述在編程時(shí)出現(xiàn)的大部分異常情況,除此之外用戶還可以自定義異常,下面這篇文章主要給大家介紹了關(guān)于Java自定義異常的相關(guān)資料,需要的朋友可以參考下
    2023-04-04
  • JAVA ArrayList詳細(xì)介紹(示例)

    JAVA ArrayList詳細(xì)介紹(示例)

    本文對(duì)JAVA ArrayList做了詳細(xì)介紹,文中學(xué)到了ArrayList源碼解析、ArrayList遍歷方式、toArray()異常,最后給出了ArrayList示例。
    2013-11-11
  • Spring事件監(jiān)聽器之@EventListener原理分析

    Spring事件監(jiān)聽器之@EventListener原理分析

    這篇文章主要介紹了Spring事件監(jiān)聽器之@EventListener原理分析,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-12-12
  • FactoryBean?BeanFactory方法使用示例詳解講解

    FactoryBean?BeanFactory方法使用示例詳解講解

    這篇文章主要為大家介紹了FactoryBean?BeanFactory方法使用示例詳解講解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-12-12
  • Mybatis一對(duì)多與多對(duì)一查詢處理詳解

    Mybatis一對(duì)多與多對(duì)一查詢處理詳解

    這篇文章主要給大家介紹了關(guān)于Mybatis一對(duì)多與多對(duì)一查詢處理的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-03-03
  • Java8中的default關(guān)鍵字詳解

    Java8中的default關(guān)鍵字詳解

    這篇文章主要介紹了Java8中的default關(guān)鍵字詳解,在實(shí)現(xiàn)某個(gè)接口的時(shí)候,需要實(shí)現(xiàn)該接口所有的方法,這個(gè)時(shí)候default關(guān)鍵字就派上用場(chǎng)了。通過default關(guān)鍵字定義的方法,集成該接口的方法不需要去實(shí)現(xiàn)該方法,需要的朋友可以參考下
    2023-08-08

最新評(píng)論

丹阳市| 五莲县| 新源县| 巴马| 喀什市| 通化县| 钟祥市| 寿宁县| 枣阳市| 六枝特区| 南郑县| 清新县| 甘德县| 班戈县| 漠河县| 禄丰县| 竹山县| 铅山县| 丰宁| 偃师市| 贵定县| 安徽省| 观塘区| 湟中县| 晋州市| 双流县| 铅山县| 文成县| 土默特右旗| 澎湖县| 电白县| 云林县| 黑龙江省| 德令哈市| 江山市| 平乡县| 呼和浩特市| 高青县| 高安市| 泸西县| 镇江市|