GoDaddy空间添加Java服务器小程序(Java Servlet)
GoDaddy空间支持Java和servlet,下面介绍如何添加Java servlet
配置servlet, 你需要在本地编译,然后上传到WEB-INF/classes 目录,输入http://www.xxxx.com/servlet/yourservletname运行servlet
你也可以选择把servlet打包成jar包上传到WEB-INF/lib目录,然后等tomcat生效(北京时间下午四点重启tomcat)
你可以将main configuration文件,web.xml文件放到WEB-INF/文件夹,web.xml文件告诉Tomcat如何处理请求以及direct url
war文件第二天会在子目录自动激活
注意:
引用:
如果尝试访问被禁止的安全策略,你的空间会被自动停止。例如, writing or reading to a directory other than /tmp, attempting to connect to a host that is not defined as an allowed host/port, and using the log4j module would be considered a violation. For directories Tomcat, Java, or Java Servlet pages disable, the pages will not load until the server is restarted the next morning.
官方:Adding a Java Servlet to Your Web Site