You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2010/08/03 21:29:08 UTC
svn commit: r982010 - in /wicket/trunk/wicket-examples/src/main:
java/org/apache/wicket/examples/requestmapper/
resources/org/apache/wicket/examples/requestmapper/
Author: mgrigorov
Date: Tue Aug 3 19:29:08 2010
New Revision: 982010
URL: http://svn.apache.org/viewvc?rev=982010&view=rev
Log:
Add a demo for HttpsMapper usage
Added:
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/HttpsPage.java (with props)
Modified:
wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperApplication.java
wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html
Added: wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/HttpsPage.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/HttpsPage.java?rev=982010&view=auto
==============================================================================
--- wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/HttpsPage.java (added)
+++ wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/HttpsPage.java Tue Aug 3 19:29:08 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.examples.requestmapper;
+
+import org.apache.wicket.examples.WicketExamplePage;
+import org.apache.wicket.protocol.https.HttpsMapper;
+import org.apache.wicket.protocol.https.RequireHttps;
+
+/**
+ * This page is just to demonstrate how {@link HttpsMapper} works.<br/>
+ * Since the demo web servers usually are not configured with https support the page itself will be
+ * never rendered. Please use browser's back button to return back to examples
+ */
+@RequireHttps
+public class HttpsPage extends WicketExamplePage
+{
+}
Propchange: wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/HttpsPage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperApplication.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperApplication.java?rev=982010&r1=982009&r2=982010&view=diff
==============================================================================
--- wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperApplication.java (original)
+++ wicket/trunk/wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/RequestMapperApplication.java Tue Aug 3 19:29:08 2010
@@ -19,6 +19,8 @@ package org.apache.wicket.examples.reque
import org.apache.wicket.Application;
import org.apache.wicket.Page;
import org.apache.wicket.examples.WicketExampleApplication;
+import org.apache.wicket.protocol.https.HttpsConfig;
+import org.apache.wicket.protocol.https.HttpsMapper;
import org.apache.wicket.request.mapper.MountedMapper;
/**
@@ -49,6 +51,10 @@ public class RequestMapperApplication ex
getRootRequestMapperAsCompound().add(
new LocaleFirstMapper(new MountedMapper("/localized", LocalizedPage.class)));
+
+ getRootRequestMapperAsCompound().add(new MountedMapper("secured", HttpsPage.class));
+
+ setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));
}
/**
Modified: wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html?rev=982010&r1=982009&r2=982010&view=diff
==============================================================================
--- wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html (original)
+++ wicket/trunk/wicket-examples/src/main/resources/org/apache/wicket/examples/requestmapper/RequestMapperHomePage.html Tue Aug 3 19:29:08 2010
@@ -26,18 +26,22 @@
<a href="Index.html" wicket:id="back">[go back]</a><p/>
<wicket:child/>
+ <p>This page uses custom home page request mapper. Loading http://localhost:8080/wicket-examples/mappers/ automatically appends
+ a preconfigured locale: http://localhost:8080/wicket-examples/mappers/en_US</p>
+
<wicket:link>
<a href="en_US/localized">en_US Localized</a><br/>
<a href="bg_BG/localized">bg_BG Localized</a>
</wicket:link>
- <p>This page uses custom home page request mapper. Loading http://localhost:8080/wicket-examples/mappers/ automatically appends
- a preconfigured locale: http://localhost:8080/wicket-examples/mappers/en_US</p>
-
<p>Clicking to any of the links above will lead to a page mounted at "localized" path but the session locale will be automatically set
depending on the locale in the url. I.e. loading http://localhost:8080/wicket-examples/mappers/bg_BG/localized will show the page with
text localized in Bulgarian.</p>
+ <p><wicket:link><a href="secured">Go to https</a></wicket:link> - clicking this link will redirect the browser to <em>http<strong>s</strong>://wicketstuff.org/wicket-examples/mappers/secured</em>.<br/>
+ <strong>Note</strong>: this site is not configured to work with HTTPS so your browser will report that the address cannot be found. Please use
+ browser's back button to return.
+
</body>
</html>
\ No newline at end of file