Hi Michèle

Thanks for the tip.

I tested and it works perfectly.

So, the only thing I did was manually adding a "web.xml" file to the WEB-INF directory (the same that contains sun-web.xml) with only this content:
*
**<?xml version="1.0" encoding "UTF-8"?>
<web-app
           version="2.5"
           xmlns="http://java.sun.com/xml/ns/javaee";
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
   <welcome-file-list>
       <welcome-file>MyOwnServlet6UseDifferentURL</welcome-file>
   </welcome-file>
</web-app>*

The rest is managed by annotations (automatically added by NetBeans 6.8 for JEE6), such as:

*...
@WebServlet(name="MyOwnServlet6", urlPatterns={"/MyOwnServlet6UseDifferentURL"})
public class MyOwnServlet6 extends HttpServlet {
...
}*

Hope it helps
mihai

miga a écrit :
I wonder if I have been explicit enough. So to allow another page than
the index.jsp, or index.html files (default) to be the welcome file,
you may proceed as follows:

1 - When creating the servlet, check the Add information to deployment
descriptor (web.xml) in the second panel of the servlet creation named
Configure Servlet Deployment
This will creates a web.xml, which will takes the information from
what you have entered.
Note that this does not impede to have annotations. It will eventually
override annotations if you specify values different from the ones in
annotations.
Also it will override the default values - that is what we do here:
overriding the default index.jsp/index.html.

See section

2 - Create another jsp file, say myOwnJSP.jsp

3 - Add to the web.xml the corresponding fragment to override the
default value for welcome list:

    <welcome-file-list>
      <welcome-file>MyOwnJSP.jsp</welcome-file>
    </welcome-file-list>

4 - Run and Enjoy!

References: the Servlet 3.0 final release:
http://cds-esd.sun.com/ESD5/JSCDL/servlet/3.0-final/servlet-3_0-final-spec.pdf?AuthParam=1270463383_a843e2e1ace141dde4075fafdf4dfdd8&TicketId=B%2Fw9lxyETFpNQRRGOVVakA%2Fn&GroupName=CDS&FilePath=/ESD5/JSCDL/servlet/3.0-final/servlet-3_0-final-spec.pdf&File=servlet-3_0-final-spec.pdf

Sections: 8.1.6, 8.2.1, 10.10

And of course, the whole reading is a must.

Michèle


--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to