Providing a .java servlet file as a welcome file in a Google application

Is there an ant way that I can provide a .java (basically a servlet file) that is located in the "src" folder as a welcome file in the web.xml file?

+4
source share
2 answers

I do

<servlet-mapping> <servlet-name>WelcomeServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> 

and delete both the <welcome-file-list> element and index.html .

It works great.

+6
source

In web.xml, you can specify a welcome file to map to the servlet:

 <servlet> <servlet-name>WelcomeServlet</servlet-name> <servlet-class>foo.bar.WelcomeServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>WelcomeServlet</servlet-name> <url-pattern>*.foo</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/welcome.foo</welcome-file> </welcome-file-list> 

I would suggest that this also works in App Engine.

Of course, this will call the compiled servlet, and not the source code in the "src" folder (which is most likely not even deployed to the server).

0
source

All Articles