Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JSR-315 ch.14 - web-fragment

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In studying for SCWCD/OCPJWCD for J2EE 6, I've run across the issue that the subject spec does NOT list <web-fragment> and all of its elements like it does for <web-abb> (Figures/text). Is this anywhere? I've sort of derived it from ch.8, but was looking for something more definitive. Aside, in reading the diagrams, I'm a bit unsure of some of the symbolism used. Is there a spec out there that explains the symbolism in detail? I get the obvious stuff just not every detail.
 
Greenhorn
Posts: 15
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roy Pozarelli wrote:I've run across the issue that the subject spec does NOT list <web-fragment> and all of its elements like it does for <web-abb> (Figures/text). Is this anywhere?


I don't think that there are figures for web-fragment in the specs. But the specs clearly indicate that a web fragment is a part or all of the web.xml, meaning that it can include almost all the same elements that the web.xml uses. I think the only differences between the two are:

  • The root element for web fragments is <web-fragment>, while for the web.xml it is <web-app>
  • The web fragment descriptor file MUST be called web-fragment.xml, while the main app's deployment descriptor is called web.xml
  • For ordering purposes, web.xml contains <absolute-ordering> element while a web-fragment.xml contains an <ordering> element. Accordingly the sub elements also change.

  •  
    Ranch Hand
    Posts: 623
    1
    IntelliJ IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Also remember that metadata-complete attribute of <web> element works different than <web-fragment> one.

    You can take a look at the exact elements and their values here: http://java.sun.com/xml/ns/javaee/

    There is a common part and a parts specific for web.xml only and for web-fragment.xml only.

    HTH,

    Cheers!
     
    Roy Pozarelli
    Ranch Hand
    Posts: 52
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Pedro, do you have any links to the reading the symbolism issue?
     
    Piotr Nowicki
    Ranch Hand
    Posts: 623
    1
    IntelliJ IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Roy, sorry but I didn't understand your question... You mean links to the XML structure definition or a summary of web.xml vs web-fragment.xml or to the XML element types used in the link I provided?

    If you don't know what particular element do, check it's type, i.e. on http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd:


    So, the mime-mapping element type is "mime-mappingType". If you search for this in the same page you'll get:



    And so on. All element types are quite explanatory. I know it's hard to read, but it's the most accurate source of knowledge - this is the XML Schema that every Servlets 3.0 web.xml and web-fragment.xml must conform to.

    Does it answer your question?

    Cheers!
     
    Roy Pozarelli
    Ranch Hand
    Posts: 52
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    In reading the actual JSR-315 Java Servlet Specification (Dec. 2009), in chapter 14 Deployment Descriptor, for ex. Figure 14-1 web-app Element Structure. They have symbols used to display the elements of <web-app> and they use various sybols for the elements, as well as within them. What I'm looking for is a link/document that defines those symbols that are used. I understand the obvious ones like 0..infinite, but I'm not sure of some others.
     
    Piotr Nowicki
    Ranch Hand
    Posts: 623
    1
    IntelliJ IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I really don't know what some of those symbols mean... I admit that I read about the obligatory/optional and multiplicity of elements from SCWCD Study Companion book and from the XML Schema.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic