web.xml

password protected application in tomcat

為{幸葍}努か 提交于 2019-12-07 06:09:08
问题 I am developing a web application using(JSP + Servlet), and I have used Tomcat 7.0.33 as a web container . So my requirement is that each application in tomcat will be password protected like the manager application in tomcat is protected. So far I have done following: server.xml <Realm className="org.apache.catalina.realm.MemoryRealm" /> tomcat-users.xml <tomcat-users> <role rolename="tomcat"/> <role rolename="manager-gui"/> <role rolename="role1" /> <user username="tomcat" password="tomcat"

JAX-RS without jersey on WAS7

空扰寡人 提交于 2019-12-07 04:58:46
问题 I have JAX-RS WS application deployed on WAS 8.0 with an empty 2.4 web.xml, class that extends 'javax.ws.rs.core.Application' and 2 resources, and it works great. I would like to deploy this application on WAS 7.0, but I'm getting: 'Error 404: SRVE0190E: File not found: /rest/source' (that's the path of the resource). How can I deploy JAX-RS application on WAS 7.0 without using Jersey or any other application-server related classes? Thanks 回答1: In WAS 7 you must defined the servlet in the web

Weblogic upgrade to 12c: deployment fails because url mapped to multiple servlet

喜你入骨 提交于 2019-12-07 04:17:11
问题 I've recently setup a new Weblogic 12c environment. On deploying an application that I know works in Weblogic 11g I get the error "The url-pattern /resources/* in web application is mapped to multiple Servlets." The mapping it's referring to is in the web.xml inside the application.ear that's being deployed, but it's only mapped once: <servlet-mapping> <servlet-name>velocity</servlet-name> <url-pattern>/resources/*</url-pattern> </servlet-mapping> The project doesn't contain any other

Best practices for defining and initializing variables in web.xml and then accessing them from Java code

痴心易碎 提交于 2019-12-07 03:22:37
问题 I would like to define and initialize some variables in web.xml and the access the values of these variables inside my Java application. The reason I want to do this is because I would like to be able to change the values of these variables without having to recompile the code. What is the best practice for doing this? Most of the variables are just strings, maybe some numbers as well. Does the class that accesses the variables have to be a servlet? Thanks! Chris 回答1: You could use your own

ServerEndpoint and web.xml

旧城冷巷雨未停 提交于 2019-12-07 03:13:08
问题 I have some Soap, REST servlets and now one WebSocket: @ServerEndpoint("/game") public class WebSocketgame{ ... } I have next trouble: WebSocket dont visible, if web.xml is exists. In web.xml describes jdbc resources,servlets ant other... When i'm delete web.xml - websocket successfully visible. How can I fix this problem? Update web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema

RequestMappingHandlerMapping.getHandlerInternal:230 - Did not find handler method for

流过昼夜 提交于 2019-12-07 02:27:13
问题 trying to make some spring example program - constantly getting the error - it happens that my controller cannot handle /hello request. Here is debug info from log4j. 13:50:58,502 {TRACE} DispatcherServlet.initContextHolders:1018 - Bound request context to thread: org.apache.catalina.connector.RequestFacade@636f2067 13:50:58,503 {DEBUG} DispatcherServlet.doService:823 - DispatcherServlet with name 'springtest' processing GET request for [/springtest_2/hello] 13:50:58,504 {TRACE}

TomCat 6: can welcome page be inside WEB-INF?

喜欢而已 提交于 2019-12-07 01:43:58
问题 I'm following this example to get Spring up & running: http://static.springsource.org/docs/Spring-MVC-step-by-step/part2.html What they do is move all .jsp files inside the WEB-INF, to stop users accessing them directly... so far so good. However the servlet has a welcome page of index.jsp, and when this is moved inside the WEB-INF dir I get errors. I can't determine if Tomcat 6 should allow the welcome page to be inside WEB-INF or not? 回答1: Nothing inside WEB-INF can be directly accessed,

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

好久不见. 提交于 2019-12-06 23:42:40
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 . BalusC It's because the welcome file is served by a RequestDispatcher#forward() call. As evidence, do you see /WEB-INF/page.jsp appearing in browser's address bar? No? Then it

web.xml validation error

旧巷老猫 提交于 2019-12-06 22:27:28
问题 I have got one more error in web xml -Cannot resolve the name 'javaee:web-appType' to a(n) 'type definition' component. and web.xml file <?xml version="1.0" encoding="UTF-8"?><!--error here--> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 回答1: You forgot the xmlns:web namespace. Here's the complete Servlet 3.0 compatible

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

大兔子大兔子 提交于 2019-12-06 16:33:53
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 needed, when calling this parent objects, what are the other tips to avoid the infamous