web.xml

Do JSR-286 portlets require a web.xml file in their WAR files?

与世无争的帅哥 提交于 2019-12-13 00:53:02
问题 Does the JSR 286 spec require the presence of a web.xml file in WARs containing portlets? At first, I thought so but then I created a portlet without a web.xml , deployed it in Liferay and it worked flawlessly. So is it an extension (or a bug) of Liferay, or is it not necessary to have such a file? 回答1: As Olaf rightly said portlet is nothing but a web application. Liferay has a listener that gets triggered when the portlet auto deploys. It explodes the war and adds web.xml and the content

Tomcat host configuration server.xml

霸气de小男生 提交于 2019-12-12 22:23:23
问题 I have this web.xml in my application. <web-app> <filter> <filter-name>app</filter-name> <filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class> </filter> <filter-mapping> <filter-name>openSessionInView</filter-name> <url-pattern>/app/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>app</filter-name> <url-pattern>/app/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>app</filter-name> <url-pattern>/assets/*</url-pattern> </filter-mapping>

Error pages with Servlet 3.0

懵懂的女人 提交于 2019-12-12 22:10:25
问题 In the web.xml file, I'm trying to specify an error page as follows. <error-page> <location>/WEB-INF/jsp/admin/ErrorPage.jsp</location> </error-page> I expect it to go without an error code according to Servlet 3.0 but it doesn't. I have to explicitly specify an appropriate error code for it to work something like the following. <error-page> <description>Missing page</description> <error-code>404</error-code> <location>/WEB-INF/jsp/admin/ErrorPage.jsp</location> </error-page> Why doesn't the

Session timeout upon refresh at login page

馋奶兔 提交于 2019-12-12 17:15:31
问题 I made a really simple login and session structure for reuse in my future JSP based applications. It's like this: web.xml (the 1 minute timeout is to test my problem): <session-config> <session-timeout>1</session-timeout> </session-config> <filter> <filter-name>Access</filter-name> <filter-class>com.app.Access</filter-class> </filter> <filter-mapping> <filter-name>Access</filter-name> <url-pattern>*</url-pattern> </filter-mapping> <servlet> <servlet-name>Login</servlet-name> <servlet-class

web.xml welcome file from WEB-INF folder

感情迁移 提交于 2019-12-12 14:06:02
问题 I get the resquested resource is not available error while trying to load a welcome file from the WEB-INF folder, in my web.xml it looks like this: <welcome-file-list> <welcome-file>WEB-INF/html/index.html</welcome-file> </welcome-file-list> In other words, the html files are located in the WEB-INF directory in the folder named "html"... So how do I do this correctly? It's so complex all this paths thing, I mean is there some kind of paths guide or anything? Because I just can't develop

Groovy - how to delay Groovlet modification recompile check

北城余情 提交于 2019-12-12 13:11:44
问题 I am new to Groovy, and I am thinking about using Groovlets (not GRAILS) to replace some Servlets. If I change a Groovlet's script file, the Groovlet re-compiles and automatically picks up the changes, including scripts referenced from the Groovlet. This is great for development, but I imagine that groovy must perform lots of file checks to see if any of the scripts have been modified, not just on the main Groovlet, but on all referenced sub-scripts. In a production environment, I imagine

Configuring for RichFaces: java.lang.ClassNotFoundException: org.ajax4jsf.Filter

妖精的绣舞 提交于 2019-12-12 12:21:17
问题 I have a project that contains some RichFaces components. All other components get displayed but the RichFaces. From the server logs I get: java.lang.ClassNotFoundException: org.ajax4jsf.Filter I am aware that with RichFaces 4.0 no filters are needed in the Web.xml. Here is my library : commons-beanutils-1.7.0.jar commons-collections-3.2.jar commons-digester-1.8.jar commons-digester.jar commons-discovery.jar commons-logging-1.0.4.jar cssparser-0.9.5.jar guava-r08.jar jhighlight-1.0.jar jsf

How to block a IP address using web.xml?

橙三吉。 提交于 2019-12-12 11:09:06
问题 How can I block a ip address with some configuration on web.xml? Do I need a filter? How can I implement one? 回答1: You can't do this purely through config in web.xml , no. A servlet filter would be a good place to implement such a thing, though. The Filter interface supplies the HttpServletRequest as part of the filter chain invocation, and from that you can get the IP address of the client (using getRemoteAddr ), and compare that to your list of permitted addresses. Alternatively, your

How to specify multiple package names for service classes in REST web service using Jersey

允我心安 提交于 2019-12-12 10:29:40
问题 How do I specify multiple <param-value> for a given <param-name> under servlet's <init-param> tag. Following is my web.xml file: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>com.vogella.jersey.first</display-name> <servlet> <servlet-name>Jersey REST

Programmatically change session timeout

心不动则不痛 提交于 2019-12-12 09:00:02
问题 I can logout user after defined time of inactivity. <session-timeout>240</session-timeout> But, is there some way to logout in specified time, or better, for example until 5 minutes of inactivity after specified time.? 回答1: You can change the session timeout by HttpSession#setMaxInactiveInterval() wherein you can specify the desired timeout in seconds. When you want to cover a broad range of requests for this, e.g. all pages in folder /admin or something, then the best place to do this is to