my dog learned polymorphism*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSR-315 ch.14 - web-fragment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSR-315 ch.14 - web-fragment" Watch "JSR-315 ch.14 - web-fragment" New topic
Author

JSR-315 ch.14 - web-fragment

Roy Pozarelli
Ranch Hand

Joined: Oct 17, 2009
Posts: 39
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.


OCP Java SE 6 Programmer,
OCM Java SE 6 Developer
OCE Web Components
OCE JPA 6
OCE EJB 6
MySQL Certified Administrator & Developer,
OMG Certified UML Prof. Fund., Int., Adv.
Ashok Kurakula
Greenhorn

Joined: May 16, 2011
Posts: 15

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.


  • OCPJP 6, OCE Java EE 6 JSP and Servlets Developer, OCE Java EE 6 EJB Developer...
    Piotr Nowicki
    Ranch Hand

    Joined: Jul 13, 2010
    Posts: 610

    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!


    OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
    Roy Pozarelli
    Ranch Hand

    Joined: Oct 17, 2009
    Posts: 39
    Thanks Pedro, do you have any links to the reading the symbolism issue?
    Piotr Nowicki
    Ranch Hand

    Joined: Jul 13, 2010
    Posts: 610

    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

    Joined: Oct 17, 2009
    Posts: 39
    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

    Joined: Jul 13, 2010
    Posts: 610

    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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: JSR-315 ch.14 - web-fragment
     
    Similar Threads
    Understanding JAAS/Web app SSO
    Tag file
    XML fragment processing
    Page-centric design vs Servlet-centric design
    how this book help for web application development