web.xml

Realm name in tomcat (web.xml)

99封情书 提交于 2019-12-09 14:38:08
问题 What is the realm-name in the tomcat. <login-config> <auth-method>BASIC</auth-method> <realm-name></realm-name> </login-config> In the above code I have to fill the realm-name element. I have seen the following code in the server.xml file: <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> Where is the realm-name specified? Is it the user name? 回答1: Realm name is not the user name. It is the authentication realm, 'typically a description of the

Some information about Spring web.xml <context-param> and <listener> tag (referred to an Hello World example)

て烟熏妆下的殇ゞ 提交于 2019-12-09 04:19:30
问题 I am quite new in the Spring MVC World. Today I am studing the simple "Hello World" Example generated by STS doing: File ---> Spring Template Project ---> Spring MVC Project In the web.xml I have the declaration of the DispatcherServlet and the request mapping handled by it...Up to here everything ok In the web.xml I have also this part of code: <!-- The definition of the Root Spring Container shared by all Servlets and Filters --> <context-param> <param-name>contextConfigLocation</param-name

Servlet JSP web.xml

南笙酒味 提交于 2019-12-09 00:30:45
问题 I see a feature in NetBeans for selecting a JSP for a Servlet and the result XML in web.xml is like this: <servlet> <servlet-name>TestServlet</servlet-name> <jsp-file>/index.jsp</jsp-file> </servlet> What does it mean? And what is it for? Is it like code behind architecture in ASP .NET? 回答1: What does it mean? and What is it for? It is used to map a canonical name for a servlet (not an actual Servlet class that you've written) to a JSP (which happens to be a servlet). On its own it isn't

The listener “com.sun.faces.config.ConfigureListener” is already configured for this context. The duplicate definition has been ignored

牧云@^-^@ 提交于 2019-12-08 21:06:48
问题 i am getting the following info when running my application: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored. and i want to know what is the cause for such error ? 回答1: First of all, this is a warning , not an error . The difference is pretty huge. The web application can just continue to run. Warnings are merely to inform the developer about circumstances which are different from expected/natural

Setting 'HttpOnly' and 'Secure' in web.xml

泪湿孤枕 提交于 2019-12-08 17:24:56
问题 I need to have the 'HttpOnly' and 'Secure' attributes set to 'true' to prevent the CWE-614: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute and CWE-402: Transmission of Private Resources into a New Sphere flaws from showing in the Veracode report. After doing some online searching, it seems that the best thing to do is to simply set the attributes in the project's web.xml file as follows: <session-config> <cookie-config> <http-only>true</http-only> <secure>true</secure> </cookie

scan resteasy resources by package name

喜欢而已 提交于 2019-12-08 11:22:52
问题 I'm configuring my resteasy app and need to turn of auto scanning (two jaxrs applications are in the classpath and it breaks at loading) For that reason I have configured my web.xml as follow: <context-param> <param-name>resteasy.scan</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>resteasy.resources</param-name> <param-value> io.swagger.jaxrs.listing.ApiListingResource, com.mycompany.resource.ClientResource, com.mycompany.resource.AccountResource, .

Why can web.xml welcome-file be located inside WEB-INF

Deadly 提交于 2019-12-08 08:30:06
问题 I have read that a jsp file inside WEB-INF cannot be accessed from outside (it must be called from a Servlet ). But, why can the welcome-file in web.xml file, point to a file inside the WEB-INF directory? because this way the file can be accessed from outside : <welcome-file-list> <welcome-file>WEB-INF/page.jsp</welcome-file> </welcome-file-list> I'm testing with Google App engine and default Servlet container Jetty 6 . 回答1: It's because the welcome file is served by a RequestDispatcher

ContextLoadListener and DispatcherServlet

天大地大妈咪最大 提交于 2019-12-08 07:19:18
问题 Is it ok to define both the ContextLoadListener and DispatcherServlet in the web.xml or are they mutually exclusive? 回答1: No, they're not mutually exclusive. ContextLoaderListener manages an appcontext which is associated with the whole webapp. DispatcherServlet manages a context associated with that specific servlet. The webapp context is the "parent" of the servlet appcontext, and all beans in the webapp appcontext are visible to beans in the servlet appcontext. If you have only one servlet

Configuring web.xml in a Spring MVC with Hibernate project.DispatcherServlet and ContextLoaderListener have each a sessionFactory

时光怂恿深爱的人放手 提交于 2019-12-08 05:55:23
问题 Like the title says, am about to configure a Spring MVC project with Hibernate/JPA for persistence. I remember I used the same context for both DispatcherServlet and ContextLoaderListener until recently I've being advised to separate them. But in separating the I've found out that both were loading a SessionFactory making my OpenSessionInViewFilter a pain then I've separated the concerns, leaving only MVC concerns to the DispatcherServlet . Aside having a mechanism to load collections when

Why I am getting error “web.xml is missing and <failOnMissingWebXml> is set to true” even when web.xml is present under WEB-INF?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 04:55:27
问题 Why I am getting error "web.xml is missing and <failOnMissingWebXml> is set to true" even when web.xml is present under WEB-INF? This is not duplicate of this question. My issue is different as I already have web.xml file in my WEB-INF folder, but still getting the error. 回答1: You may have a corrupted Eclipse-specific settings file. Check out the answer to Spring cannot find file in classpath, but it's right there at the root of the war file. For me, both problems had the same root cause. 来源: