Can I make a website welcome file a servlet? If so, how? I tried something like:
<welcome-file-list> <welcome-file>FilterForwarded</welcome-file> </welcome-file-list>
During deployment, I see no errors, but when I try to open abc.com, I get a message from the browser that it cannot connect to this website. Why is this so?
I want someone to visit the website, I should be able to store the public IP address of the client. To do this, I wrote a filter, which after accepting IP passed it to the servlet (from there I could update the logs). After saving the IP address, the client is automatically redirected to index.jsp. Is there any way to achieve this?
EDIT:
<servlet-mapping> <servlet-name>FilterForwarded</servlet-name> <url-pattern>/FilterForwarded</url-pattern> </servlet-mapping>
This is the mapping defined in web.xml. When I use /FilterForwarded in the welcome file, I get this message when I try to deploy: Bad configuration: the greeting files should be relative: / FilterForwarded
From the magazines:
com.google.apphosting.utils.config.AppEngineConfigException: Welcome files must be relative paths: /FilterForwarded at com.google.apphosting.utils.config.WebXml.validate(WebXml.java:125) at com.google.appengine.tools.admin.Application.<init>(Application.java:150) at com.google.appengine.tools.admin.Application.readApplication(Application.java:225) at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:145) at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:69) at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:65)
source share