Storing web content in a JAR file

后端 未结 6 1701
被撕碎了的回忆
被撕碎了的回忆 2021-02-14 03:16

Is it possible to store web content (such as JSPs, HTML, images, CSS etc) in a JAR file?

I\'ve been looking at various options at modularising our web applications and t

6条回答
  •  自闭症患者
    2021-02-14 03:38

    In Core JavaServer Faces, 3rd edition, under "Packaging Composite Components in JARs" on p. 382, it talks about packaging composite components in JAR files.

    "All you have to do is put your composite component, and its artifacts, such as JavaScript, stylesheets, or properties files, under a META-INF directory in the JAR, as shown in Figure 9-14."

    components.jar
    +-- META-INF
        +-- resources
            +-- css
            |   +-- styles.css
            +-- images
            |   +-- back.png
            +-- util
                +-- icon.xhtml
                +-- login.js
                +-- login.properties
    

    I'm not sure how easily these resources can be accessed directly from other applications as opposed to the contained composite components.

提交回复
热议问题