web.xml

when container call deployment descriptor (web.xml)

↘锁芯ラ 提交于 2019-12-08 04:19:10
问题 We know that whenever a request for a servlet comes, servlet container will first check web.xml file for url and corresponding servlet classes. This is fine, But the confusion comes after that. Suppose I am using load-on-startup property. SO, the servlet should be ready before first call comes in. In that case container need servlet Config object to make servlet in work. But again load-on-start up and init-parameter for servlet is defined in web.xml file. So when exactly container uses web

Can I set Tomcat with a welcome-file in a subfolder?

雨燕双飞 提交于 2019-12-08 03:16:51
问题 Someone at the office threw me this weird-yet-interesting question. If I have something like this in a web.xml (either app' file or container's file) <welcome-file-list> <welcome-file>something.html</welcome-file> </welcome-file-list> and the thing has another page in a subfolder that can be used so I change it... <welcome-file-list> <welcome-file>subfolder/something.html</welcome-file> </welcome-file-list> ¿Should the second option work? Thanks! 回答1: Answering to myself just to let it in the

Servlet-Filter is not honoured for welcome file

坚强是说给别人听的谎言 提交于 2019-12-08 02:43:48
问题 I am using a Filter do generate dynamicly content to be visible for webcrawlers (https://developers.google.com/webmasters/ajax-crawling/docs/specification). This filter is working fine if the incoming url contains a path (http://www.unclestock.com/app.jsp#!s=GOOG). If the incoming url contains just my domain (and a fragment), say http://www.unclestock.com#!s=GOOG, the welcome file (app.jsp) is returned, but the filter is not honnoured. My web.xml contains the following filter map: <filter

Glassfish jdbc/database lookup failed

只谈情不闲聊 提交于 2019-12-08 00:44:01
问题 I hope I am not asking a duplicate question just because I was unable to find an answer. I am getting this error: javax.naming.NamingException: Lookup failed for 'jdbc/osclassDB' in SerialContext This is what I did: I set up a JDBC Connection Pool and a JDBC Resource pointing to that pool (both in Glassfish). Then I told my web.xml that there is a JDBC Resource: <resource-ref> <res-ref-name>jdbc/osclassDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth>

There is no Action mapped for namespace / and action name hello

走远了吗. 提交于 2019-12-07 19:59:19
问题 package com.tutorialspoint.struts2; public class HelloWorldAction{ private String name; public String execute() throws Exception { return "success"; } public String getName() { return name; } public void setName(String name) { this.name = name; } } index.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose

Web.xml: Are url-pattern tags relative to each other?

依然范特西╮ 提交于 2019-12-07 17:43:33
问题 <servlet-mapping> <servlet-name>myName</servlet-name> <url-pattern>/aName</url-pattern> </servlet-mapping> <security-constraint> <web-resource-collection> ... <url-pattern> /* </url-pattern> </web-resource-collection> ... </security-constraint> This is an excerpt from web.xml (using it to configure a jboss/tomcat webservice). Just wondering if the url-pattern in web-resource-collection is relative to the url-pattern in servlet-mapping . 回答1: The url-pattern used to select the constraints for

How to map a servlet filter on /* in Jetty?

佐手、 提交于 2019-12-07 16:44:25
I have a servlet filter which I want to map to http://127.0.0.1:8888/ in Jetty. I have put a servlet filter mapping with url pattern /* . However, the filter is not called. I also tried with / mapping. It does not work either. How is this caused and how can I solve it? If you name your war root.war it will be deployed to the root / context. http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications You can redirect requests from "/" to "/urlToRedirect" and handle "/urlToRedirect" by special servlet. Like in example: public static void main(String[] args) throws Exception { Servlet frontend =

How do I get HttpServletRequestObject in the @service class

浪尽此生 提交于 2019-12-07 13:38:24
问题 I'm successfully able to integrate Spring and Spring4GWT. Everything is working fine. The only problem I'm facing is How do I get HttpServletRequestObject in the @service class? Some of the configuration and code web.xml <servlet> <servlet-name>test</servlet-name> <servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>test</servlet-name> <url-pattern>/ui/test/*</url-pattern> </servlet

WebService is not “visible” in WebLogic 10.3

痴心易碎 提交于 2019-12-07 09:53:53
问题 I am currently trying to let my application provide a webservice. The application uses spring and is running under a Weblogic 10.3 instance. I built the webservice following the "contract first" approach. So what I basicaly have is a generated WS-Interface, my implementation of that interface, a web.xml defining the servlet-bindings and a sun-jaxws.xml defining the endpoint. (more or less similar to this: http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/). Now,

Apache Tomcat cannot load web.xml - Connection timed out

六眼飞鱼酱① 提交于 2019-12-07 09:03:02
问题 If I try to deploy a webapp in Tomcat I get an exception. The web.xml seems correct to me so the problem should be somewhere else. Any help would be appreciated... web.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.4//EN" "http://java.sun.com/dtd/web-app_2_4.dtd"> <web-app> <context-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/applicationContext.xml</param-value> </context-param> <listener>