• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Sample web.xml.. may be useful for SCWCD Ranchers

 
Ranch Hand
Posts: 344
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Below is the list of elements in the web.xml.. may be useful for SCWCD ranchers.. pls include if anything is missed on exam perspective..



and tld also...



May be some spelling mistake will be there.. pls check it, since this is I typed without seeing the book to see how my memory power is ..so careful regd mistakes.. it's just a sample

[ February 10, 2007: Message edited by: Micheal John ]

[ February 10, 2007: Message edited by: Micheal John ]

[ February 10, 2007: Message edited by: Micheal John ]
[ February 26, 2007: Message edited by: Micheal John ]
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. That is much nicer than my penciled notes on my white board. It will make it easier to memorize.

Again, Thank you.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey Micheal John

thanks, its realy a nice list to prepare.....
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

Good job..I Appreciate your work
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you get this idea of putting this down here?? Awesome man! keep it up. It should be really useful for all those studying for SCWCD.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Awesome Work Michael
I appreciate that.
Marvelous !!

hugs
Vikas
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What combinations of questions can we expect in the real exam regarding the web.xml file?? Any idea guys??
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Few more small correction .. Great work !!!

<web-app>
<display>Sample web.xml </display>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- FILTER CONFIGURATION -->
<filter>
<filter-name>MyFilter</filter-name>
<filter-class>com.example.HelloFilter</filter-class>
<init-param>
<param-name>FilterName</param-name>
<param-value>Hello Filter</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/*.do</url-pattern>
<!-- or <servlet-name>MyServlet</servlet-name> -->
<dispatcher>REQUEST</dispatcher>
<!-- or
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
-->
</filter-mapping>

<!-- LISTENER CONFIGURATION -->

<listener>
<listener-class>com.example.MyContextListener</listener-class>
</listener>

<!-- SERVLET CONFIGURATION -->
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.example.HelloServlet</servlet-class>
<!-- or<jsp-file>/hello.jsp</jsp-file>-->
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>emailid</param-name>
<param-value>[email protected]</param-value>
</init-param>
<security-role-ref>
<role-name>Manager-TOM HENRY</role-name>
<role-link>admin</role-link>
</security-role-ref>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- JSP CONFIGURATION -->
<jsp-config>
<jsp-property-group>
<url-pattern>*.do</url-pattern>
<scripting-invalid>true</scripting-invalid>
<el-ignored>false</el-ignored>
</jsp-property-group>
<taglib>
<taglib-uri>helloWorld</taglib-uri>
<taglib-location>/WEB-INF/hello.tld</taglib-location>
</taglib>

</jsp-config>

<!-- SESSION CONFIGURATION -->
<session-config>
<session-timeout>15</session-timeout>
</session-config>

<!-- ERROR PAGE CONFIGURATION -->

<error-page>
<exception-type>java.lang.ArithimeticException</exception-type>
<!-- or<error-code>500</error-code>-->
<location>/WEB-INF/error.jsp</location>
</error-page>

<!-- CONTENT TYPE CONFIGURATION -->
<mime-mapping>
<extension>text</extension>
<mime-type>text/html</mime-type>
</mime-mapping>

<!-- ALL SECURITY RELATED CONFIGURATIONS -->

<security-role>
<role-name>admin</role-name>
<role-name>manager</role-name>
</security-role>

<security-constraint>
<welcome-resource-collection>
<welcome-resource-name>My Security</welcome-resource-name><url-pattern>/hello/*.do</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</welcome-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
<role-name>manager</role-name>
</auth-constraint>

<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
<!-- or
<transport-guarantee>CONFIDENTIAL</transport-guarantee><transport-guarantee>INTEGRAL</transport-guarantee>
-->
</user-data-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<!-- or
<auth-method>DIGEST</auth-method>
<auth-method>CLIENT-CERT</auth-method>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
-->
</login-config>

<!-- ALL EJD/JNDI RELATED CONFIGURATIONS -->

<env-entry>
<env-entry-name></env-entry-name>
<env-entry-type></env-entry-type>
<env-entry-value></env-entry-value>
</env-entry>

<ejb-local-ref>
<ejb-ref-name>ejb/Customer</ejb-ref-name>
<ejb-ref-type>ENTITY</ejb-ref-type>
<local-home>com.example.CustHome</local-home>
<local>come.exampleCust</local>
</ejb-local-ref>

<ejb-ref>
<ejb-ref-name>ejb/Customer</ejb-ref-name>
<ejb-ref-type>ENTITY</ejb-ref-type>
<home>com.example.CustHome</home>
<remote>com.example.Cust</remote>
</ejb-ref>

<resource-env-ref>
<resource-env-ref-name>jms/stockQueue</resource-env-ref-name><resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>

<resource-ref>
<res-ref-name>jdbc/EmpDB</res-ref-name>
<res-type>javax.sql.Datasource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</web-app>
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know why I've always found the nice diagrams in the spec easier to remember than a big web.xml sample
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very useful. Great work.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, congratulations for you, ranchers! This web.xml sample has been very useful! I wonder if the child tag within <security-constraint> should be <web-resource-collection> instead of <welcome-resource-collection>. Or both exists?!
And also, shouldn�t the resource name be <web-resource-name> instead of <welcome-resource-name>?!
Thanks!
 
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for this. I am about to prepare one.

 
Ranch Hand
Posts: 242
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Victor

I am agree with you as XML Schema says:

- <!-- ****************************************************
-->
- <xsd:complexType name="security-constraintType">
- <xsd:annotation>
<xsd ocumentation>The security-constraintType is used to associate security constraints with one or more web resource collections Used in: web-app</xsd ocumentation>
</xsd:annotation>
- <xsd:sequence>
<xsd:element name="display-name" type="j2ee isplay-nameType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="web-resource-collection" type="j2ee:web-resource-collectionType" maxOccurs="unbounded" />
<xsd:element name="auth-constraint" type="j2ee:auth-constraintType" minOccurs="0" />
<xsd:element name="user-data-constraint" type="j2ee:user-data-constraintType" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" />
</xsd:complexType>
- <!-- ****************************************************
-->

And DTD also verifies that

<!ELEMENT security-constraint (display-name?, web-resource-collection+, auth-constraint?, user-data-constraint?)>

Regards,
Khushhal
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Telling you seriously, I never imagined that much web.xml I would have
to learn/ (BTW I have learned now). Seeing them at a place collectively
is really awesome experience.





Nice effort!

Thanks,
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im drunked and remember all of the web.xml file.

Im really prepared for the exam !!!

I think the unique error in the web.xml schema posted by Micheal John is the
'web-resource-collection' that was corrected by Victor Maehira and khushhal yadav.

I was wondering if this child tag could appear in the exam since i didnt see in the HFSJ, just in Exam Study Kit book.

<variable>
<name-from-attribute>var</name-from-attribute>
<scope>AT_BEGIN</scope>
<variable>
<dynamic-attributes>true<dynamic-attributes>

Talking about the topic.

PERFECT POST !!!
[ August 16, 2007: Message edited by: Cristiano Sganzerla ]
 
khushhal yadav
Ranch Hand
Posts: 242
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cristiano

<variable>
<name-from-attribute>var</name-from-attribute>
<scope>AT_BEGIN</scope>
<variable>
<dynamic-attributes>true<dynamic-attributes>



I am not sure whether it can appear in exam or not.
But it's really something good to know. And also not difficult to grasp.

Moreover, it's not a part of web.xml. It's a part of tlds.
It's concerend with scripting varibles. And define their lexical scope.
There can be three values of it: AT_BEGIN, NESTED, AT_END.

Regards,
Khushhal
 
Cristiano Sganzerla
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks !!!
 
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks.
Padma priya N.G.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... and

should be
 
Ranch Hand
Posts: 246
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much everybody for your contribution and time. This will help everybody. It is a handy reference.

Thanks, Naveen.

 
Frank Knoll
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and there could be context parameters in the web-app:
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nice job, thanks
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to All,

Nice one.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Very nice listing! I wish I had had that a couple of months ago when I was preparing for the exam.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the sample web.xml. I took the liberty of correcting some typos and added few more items in the web.xml. I also validated in RAD (Rational Application Developer) to make sure it doesn't have any more errors. Hope its useful to others...

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
10000 thanks to you
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To Jay and all,
Thank you Jay for posting and validating.
You mentioned using "(Rational Application Developer)" for xml validation.

Sadly, I do not have RAD available.

How can I validate web.xml using Java?
e.g. once I put 2 error pages together, like this:




Java ignored 404/missing but used 500/error and I wasted lots of time trying to figure out why it caught 500 errors, and ignored 404 errors.

How could I find an error like this?

Thanks, Mitch
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you All
Kathir
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..it would really help
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I think we should specify form-login-page and form-error-page only if the auth-method has value 'FORM'.Please correct me if i have misunderstood.

Thanks,
Raj
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I think we should specify form-login-page and form-error-page only if the auth-method has value 'FORM'.


Yes that's right...
 
raj malhotra
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ankit !
 
Everybody's invited. Except this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic