Author: ivaynberg Date: Tue Mar 23 16:08:38 2010 New Revision: 926640 URL: http://svn.apache.org/viewvc?rev=926640&view=rev Log: WICKET-2758 various patches
Modified: wicket/trunk/pom.xml wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/images/Home.java wicket/trunk/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml wicket/trunk/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml wicket/trunk/wicket/src/main/java/org/apache/wicket/DefaultExceptionMapper.java wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java Modified: wicket/trunk/pom.xml URL: http://svn.apache.org/viewvc/wicket/trunk/pom.xml?rev=926640&r1=926639&r2=926640&view=diff ============================================================================== --- wicket/trunk/pom.xml (original) +++ wicket/trunk/pom.xml Tue Mar 23 16:08:38 2010 @@ -25,6 +25,7 @@ <description>Wicket is a Java-based open source component web application framework.</description> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <jetty.version>6.1.21</jetty.version> </properties> <profiles> @@ -386,13 +387,13 @@ <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> - <version>6.1.21</version> + <version>${jetty.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>servlet-api-2.5</artifactId> - <version>6.1.21</version> + <version>${jetty.version}</version> <scope>provided</scope> </dependency> <dependency> @@ -404,13 +405,13 @@ <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-util</artifactId> - <version>6.1.21</version> + <version>${jetty.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-management</artifactId> - <version>6.1.21</version> + <version>${jetty.version}</version> <scope>provided</scope> </dependency> <dependency> @@ -743,7 +744,7 @@ <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.1</version> + <version>${jetty.version}</version> <configuration> <scanIntervalSeconds>60</scanIntervalSeconds> <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory> Modified: wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/images/Home.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/images/Home.java?rev=926640&r1=926639&r2=926640&view=diff ============================================================================== --- wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/images/Home.java (original) +++ wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/images/Home.java Tue Mar 23 16:08:38 2010 @@ -69,7 +69,7 @@ public final class Home extends WicketEx public Home() { // Image as package resource - add(new Image("image2", new PackageResourceReference(Home.class, "image2.gif"))); + add(new Image("image2", new PackageResourceReference(Home.class, "Image2.gif"))); // Dynamically created image. Will re-render whenever resource is asked // for. Modified: wicket/trunk/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml?rev=926640&r1=926639&r2=926640&view=diff ============================================================================== --- wicket/trunk/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml (original) +++ wicket/trunk/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml Tue Mar 23 16:08:38 2010 @@ -15,11 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!DOCTYPE web-app - PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> - -<web-app> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> <display-name>Wicket Examples</display-name> Modified: wicket/trunk/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml?rev=926640&r1=926639&r2=926640&view=diff ============================================================================== --- wicket/trunk/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml (original) +++ wicket/trunk/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml Tue Mar 23 16:08:38 2010 @@ -15,11 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --> -<!DOCTYPE web-app - PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> - -<web-app> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> <display-name>Wicket Examples</display-name> Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/DefaultExceptionMapper.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/DefaultExceptionMapper.java?rev=926640&r1=926639&r2=926640&view=diff ============================================================================== --- wicket/trunk/wicket/src/main/java/org/apache/wicket/DefaultExceptionMapper.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/DefaultExceptionMapper.java Tue Mar 23 16:08:38 2010 @@ -1,50 +1,70 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.wicket; - -import org.apache.wicket.protocol.http.PageExpiredException; -import org.apache.wicket.request.IExceptionMapper; -import org.apache.wicket.request.IRequestHandler; -import org.apache.wicket.request.handler.PageProvider; -import org.apache.wicket.request.handler.RenderPageRequestHandler; -import org.apache.wicket.request.mapper.StalePageException; - -public class DefaultExceptionMapper implements IExceptionMapper -{ - - public IRequestHandler map(Exception e) - { - if (e instanceof StalePageException) - { - // If the page was stale, just rerender it - return new RenderPageRequestHandler(new PageProvider(((StalePageException)e).getPage())); - } - else if (e instanceof PageExpiredException) - { - return new RenderPageRequestHandler(new PageProvider(Application.get() - .getApplicationSettings() - .getPageExpiredErrorPage())); - } - else - { - return new RenderPageRequestHandler(new PageProvider(Application.get() - .getApplicationSettings() - .getInternalErrorPage())); - } - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.wicket; + +import org.apache.wicket.markup.html.pages.ExceptionErrorPage; +import org.apache.wicket.protocol.http.PageExpiredException; +import org.apache.wicket.request.IExceptionMapper; +import org.apache.wicket.request.IRequestHandler; +import org.apache.wicket.request.handler.EmptyRequestHandler; +import org.apache.wicket.request.handler.PageProvider; +import org.apache.wicket.request.handler.RenderPageRequestHandler; +import org.apache.wicket.request.mapper.StalePageException; +import org.apache.wicket.settings.IExceptionSettings; +import org.apache.wicket.settings.IExceptionSettings.UnexpectedExceptionDisplay; + +public class DefaultExceptionMapper implements IExceptionMapper +{ + + public IRequestHandler map(Exception e) + { + if (e instanceof StalePageException) + { + // If the page was stale, just rerender it + return new RenderPageRequestHandler(new PageProvider(((StalePageException)e).getPage())); + } + else if (e instanceof PageExpiredException) + { + return new RenderPageRequestHandler(new PageProvider(Application.get() + .getApplicationSettings() + .getPageExpiredErrorPage())); + } + else + { + final Application application = Application.get(); + final UnexpectedExceptionDisplay unexpectedExceptionDisplay = application.getExceptionSettings() + .getUnexpectedExceptionDisplay(); + + if (IExceptionSettings.SHOW_EXCEPTION_PAGE.equals(unexpectedExceptionDisplay)) + { + return new RenderPageRequestHandler(new PageProvider( + // TODO WICKET-NG How to provide the page to ExceptionErrorPage ?! + new ExceptionErrorPage(e, null))); + } + else if (IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE.equals(unexpectedExceptionDisplay)) + { + return new RenderPageRequestHandler(new PageProvider( + application.getApplicationSettings().getInternalErrorPage())); + } + else + { + // IExceptionSettings.SHOW_NO_EXCEPTION_PAGE + return new EmptyRequestHandler(); + } + } + } +} Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java?rev=926640&r1=926639&r2=926640&view=diff ============================================================================== --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java Tue Mar 23 16:08:38 2010 @@ -292,6 +292,9 @@ public class WicketFilter implements Fil } webApplication.initApplication(); + + // Give the application the option to log that it is started + webApplication.logStarted(); } finally {