• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

web.xml hard work

 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers I wrote web.xml without seeing any where just look at it , tell me if any mistakes are there.

Thanks Micheal John, form you only I learned how to write web.xml.


<web-app ....>

<context-param>
<param-name>
<param-value>
</context-param>

<description>web application description</description>

<display-name> Web apllication </display-name>

<distributable/>

<ejb-local-ref>
<ejb-ref-name>ejb local</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>come.example.LocalHomeInterface</local-home>
<local>come.example.LocalRemoteInterface</local>
</ejb-local-ref>

<ejb-ref>
<ejb-ref-name>ejb reference</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>come.example.HomeInterface</home>
<remote>com.example.RemoteInterface</remote>
</ejb-ref>

<env-entry>
<env-entry-name>EJB Data source Name</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>10</env-entry-value>
</env-entry>

<error-page>
<exception-type>java.io.IOException<exception-type>

<-- or
<error-code>404</error-code>
-->
<location>/error.jsp</location>
</error-page>


<filter>
<filter-name>Comprestion Filter</filter-name>
<filter-class>com.example.MyFilter</filter-class>
<init-param>
<param-name>nameformFilter</param-name>
<param-vlaue>chintu</param-vlaue>
</init-param>
</filter>

<filter-mapping>
<filter-name>Comprestion Filter</filter-name>
<url-pattern>/*</url-pattern>
<-- or
<servlet-name>MyServlet</servlet-name>
-->
<dispatcher>REQUEST</dispatcher>
<-- or
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
-->
</filter-mapping>

<jsp-config>
<taglib>
<taglib-uri>mytaguri</taglib-uri>
<taglib-location>/WEB-INF/mytag.tld</taglib-location>
</taglib>
<jsp-property-group>
<url-pettern>*.jsp</url-pettern>
<el-ignored>false</el-ignored>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>

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

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>LADAP REALM<realm-name>
<--or
<auth-method>DIGEST</auth-method>
<auth-method>CLIENT-CERT</auth-method>
<auth-method>FORM</auth-method>
-->
<-- OR
<auth-method>BASIC</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/formerror.jsp</form-error-page>
</form-login-config>
-->

</login-config>

<mime-mapping>
<extention>pdf</extention>
<mime-type>apllication/pdf</mime-type>
</mime-mapping>

<resource-env-ref>
<resource-env-ref-name>some jms resource</resource-env-ref-name>
<resource-env-ref-type>come.example.JMSExample</resource-env-ref-type>
</resource-env-ref>

<resource-ref>
<resource-ref-name>EJB Reource name</resource-ref-name>
<res-auth>container</res-auth>
<res-type>com.exampele.SomeClass</res-type>
<res-sharing-scope>Sharable</res-sharing-scope>
</resource-ref>

<secirity-constraint>

<web-resource-collection>
<web-resource-name>my web resource</web-resource-name>
<url-pettern>/*</url-pettern>
<http-method>GET</http-method>
</web-resource-collection>

<auth-constraint>
<role-name>member</role-name>
</auth-constraint>

<user-data-contraint>
<transport-gaurantee>NONE</transport-gaurantee>
<-- or
<transport-gaurantee>INTEGRAL</transport-gaurantee>
<transport-gaurantee>CONFIDENTIAL</transport-gaurantee>
-->
</user-data-contraint>
</secirity-constraint>


<security-role>
<role-name>member</role-name>
</security-role>

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

<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>com.example.myServlet</servlet-class>
<-- or
<jsp-file>/myjsp.jsp</jsp-file>
-->

<load-on-startup>1</load-on-startup>

<run-as>don't know what to write</run-as>

<security-role-ref>
<role-name>admin</role-name>
<role-link>administrator</role-name>
<security-role-ref>

</servlet>

<session-config>
<session-timeout>30</session-timeout>
</session-config>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>home.jsp</welcome-file>
</welcome-file-list>

</web-app>



tell me if any mistakes are there or need to add any tags in this...
please tommorow is my exam ...
[ August 20, 2008: Message edited by: Chintu sirivennela ]
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tremendous
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best way to check out whether your xml file is correct (well formed and valid) is to have any IDE like, Netbeans or eclipse, copy paste t your code with DTD definition and he ll tell you whether you wrote correct xml or not !
 
Ranch Hand
Posts: 433
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think there are two mistakes:
1)

2) <taglib> should be outside <jsp-config>. I am not very much sure about this point, as i never heard of taglib inside jsp-config. so it should be outside.

[ August 21, 2008: Message edited by: Sunny Jain ]
[ August 21, 2008: Message edited by: Sunny Jain ]
 
Grow your own food... or this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic