Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Kenneth Bennett   on Mar 28 In Java Category.

  
Question Answered By: Madeeha Malik   on Mar 28

web.xml is a xml  file ok,that means xml file  should
follow the rules, 1.like every opening tag should be end tag
2.every attribute value must in single qotions(' ')or multiple (" ")
and
some other roles is like this:
for example:
<web-app>
<servlet>
<servlet-name>XXX</servlet-name>
</servlet-class>TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>/TestUrl</url-pattern>
</servlet-mapping>
</web-app>
this is correct xml file.
for eample if u write this :is incorrect
<web-app>
<servlet>
</servlet-class>TestServlet</servlet-class>
<servlet-name>XXX</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>/TestUrl</url-pattern>
</servlet-mapping>
</web-app>
(or)
<web-app>
<servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>/TestUrl</url-pattern>
</servlet-mapping>
<servlet-name>XXX</servlet-name>
</servlet-class>TestServlet</servlet-class>
</servlet>
</web-app>

how to know this rules u will see the schema files
or dtd files in jar files.

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on web.xml Or get search suggestion and latest updates.


Tagged: