Files
ofbiz-framework/framework/common/webcommon/WEB-INF/common-controller.xml
T
David E. Jones afe3dc9c81 A few related changes:
Big refactor of ControlServlet, RequestManager, RequestHandler, and ConfigXMLReader so that simple objects are used instead of Maps within Maps within Maps for the data from the controller.xml file, which results in eliminating hundreds of lines of code including the entire RequestHandler class. I have tested this a lot with different apps that use the ControlServlet differently, but this is a very big change so there could still be issues. Based on this cleanup future issues and new features should be easier and less error prone, and that is why doing it now in order to help with a number of other improvements and bug fixes that are part of this commit.

Also added redirect-parameter element to go under the request-map -> response element which allows you to specify which parameters will be passed on in a redirect instead of using all of them. Also improved default there and in various places to only include parameters from the URL to avoid issues with form data, but if the ID to display (like following a crAlso added redirect-parameter element to go under the request-map -> response element which allows you to specify which parameters will be passed on in a redirect instead of using all of them. Also improved default there and in various places to only include parameters from the URL to avoid issues with form data, but if the ID to display (like following a crAlso added redirect-parameter element to go under the request-map -> response element which allows you to specify which parameters will be passed on in a redirect instead of using all of them. Also improved default there and in various places to only include parameters from the URL to avoid issues wd in and also going to the same page after login from auth=true or from clicking on the login link.

Related to cleaning up login URLs also changed how the request and parameters passed to a request before a login are saved and used after a login is successful so that it URL parameters go on the URL in a redirect to the original request to make it more transparent, and non-URL parameters just stay in the session and are used when the original request is run again to avoid putting sensitive information like passwords and big information like textarea data in the URL, which has been a problem before.

To see what some of these things combined can do try going to the example app, login, click on the New Example link, then logout in another tab or window, then go back to the New Example page and enter a name and a whole bunch of text in the long description then click Create, the system will show you the login page so enter username/password, and then after login you'll see a nice URL to EditExample with the correct exampleId parameter and all of the data entered before login successfully saved and never appearing in a URL.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@741374 13f79535-47bb-0310-9956-ffa450edef68
2009-02-06 02:14:19 +00:00

168 lines
8.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd">
<description>Common ControlServlet Configuration File</description>
<owner>Copyright 2001-2008 The Apache Software Foundation</owner>
<errorpage>/error/error.jsp</errorpage>
<!-- event handlers -->
<handler name="java" type="request" class="org.ofbiz.webapp.event.JavaEventHandler"/>
<handler name="soap" type="request" class="org.ofbiz.webapp.event.SOAPEventHandler"/>
<handler name="xmlrpc" type="request" class="org.ofbiz.webapp.event.XmlRpcEventHandler"/>
<handler name="service" type="request" class="org.ofbiz.webapp.event.ServiceEventHandler"/>
<handler name="service-multi" type="request" class="org.ofbiz.webapp.event.ServiceMultiEventHandler"/>
<handler name="service-stream" type="request" class="org.ofbiz.webapp.event.ServiceStreamHandler"/>
<handler name="simple" type="request" class="org.ofbiz.webapp.event.SimpleEventHandler"/>
<handler name="groovy" type="request" class="org.ofbiz.webapp.event.GroovyEventHandler"/>
<handler name="jsonservice" type="request" class="org.ofbiz.webapp.event.JSONServiceEventHandler"/>
<handler name="jsonsimple" type="request" class="org.ofbiz.webapp.event.JSONSimpleEventHandler"/>
<handler name="rome" type="request" class="org.ofbiz.webapp.event.RomeEventHandler"/>
<!-- view handlers -->
<handler name="screen" type="view" class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>
<handler name="screenfop" type="view" class="org.ofbiz.widget.screen.ScreenFopViewHandler"/>
<handler name="screenxml" type="view" class="org.ofbiz.widget.screen.ScreenXmlViewHandler"/>
<handler name="screentext" type="view" class="org.ofbiz.widget.screen.ScreenTextViewHandler"/>
<handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/>
<handler name="ftl" type="view" class="org.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>
<handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/>
<preprocessor>
<!-- Events to run on every request before security (chains exempt) -->
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="check509CertLogin"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkRequestHeaderLogin"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkServletRequestRemoteUserLogin"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkExternalLoginKey"/>
<event type="java" path="org.ofbiz.webapp.control.ProtectViewWorker" invoke="checkProtectedView"/>
</preprocessor>
<postprocessor>
<!-- Events to run on every request after all other processing (chains exempt) -->
</postprocessor>
<!-- Security Mappings -->
<request-map uri="checkLogin" edit="false">
<description>Verify a user is logged in.</description>
<security https="true" auth="false"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkLogin" />
<response name="success" type="view" value="main"/>
<response name="error" type="view" value="login"/>
</request-map>
<request-map uri="login">
<security https="true" auth="false"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="login"/>
<response name="success" type="view" value="main"/>
<response name="requirePasswordChange" type="view" value="requirePasswordChange"/>
<response name="error" type="view" value="login"/>
</request-map>
<request-map uri="logout">
<security https="true" auth="true"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="logout"/>
<response name="success" type="request-redirect" value="main"/>
<response name="error" type="view" value="main"/>
</request-map>
<request-map uri="forgotPassword">
<security https="true" auth="false" />
<event type="java" path="org.ofbiz.securityext.login.LoginEvents" invoke="forgotPassword"/>
<response name="success" type="view" value="forgotPassword" />
<response name="error" type="view" value="forgotPassword" />
</request-map>
<!-- Common Mappings used for locales and timezones -->
<request-map uri="setSessionLocale">
<security https="true" auth="false"/>
<event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionLocale"/>
<response name="success" type="request" value="main"/>
<response name="error" type="request" value="main"/>
</request-map>
<request-map uri="setSessionTimeZone">
<security https="true" auth="false"/>
<event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionTimeZone"/>
<response name="success" type="request" value="main"/>
<response name="error" type="request" value="main"/>
</request-map>
<request-map uri="LookupLocales">
<security https="true" auth="false" />
<response name="success" type="view" value="LookupLocales" />
</request-map>
<request-map uri="LookupTimezones">
<security https="true" auth="false" />
<response name="success" type="view" value="LookupTimezones" />
</request-map>
<!-- User preference mapping -->
<request-map uri="setUserPreference">
<security https="true" auth="true"/>
<event type="service" invoke="setUserPreference"/>
<response name="success" type="request" value="main"/>
<response name="error" type="request" value="main"/>
</request-map>
<request-map uri="ajaxAutocompleteOptions">
<security https="true" auth="true"/>
<response name="success" type="view" value="ajaxAutocompleteOptions" />
</request-map>
<!-- Online help system mapping -->
<request-map uri="help">
<security https="true" auth="true"/>
<response name="success" type="view" value="help" />
</request-map>
<!-- Visual theme mapping -->
<request-map uri="LookupVisualThemes">
<security https="true" auth="true"/>
<response name="success" type="view" value="LookupVisualThemes" />
</request-map>
<request-map uri="main">
<response name="success" type="view" value="main"/>
</request-map>
<request-map uri="viewBlocked">
<response name="success" type="view" value="viewBlocked"/>
</request-map>
<request-map uri="geoLocation">
<response name="success" type="view" value="geoLocation"/>
</request-map>
<!-- View Mappings -->
<view-map name="error" page="/error/error.jsp"/>
<view-map name="main" type="none"/>
<view-map name="login" type="screen" page="component://common/widget/CommonScreens.xml#login"/>
<view-map name="requirePasswordChange" type="screen" page="component://common/widget/CommonScreens.xml#requirePasswordChange"/>
<view-map name="forgotPassword" type="screen" page="component://common/widget/CommonScreens.xml#forgotPassword"/>
<view-map name="EventMessages" type="screen" page="component://common/widget/CommonScreens.xml#EventMessages"/>
<view-map name="LookupLocales" type="screen" page="component://common/widget/LookupScreens.xml#LookupLocales"/>
<view-map name="LookupTimezones" type="screen" page="component://common/widget/LookupScreens.xml#LookupTimezones"/>
<view-map name="LookupVisualThemes" type="screen" page="component://common/widget/LookupScreens.xml#LookupVisualThemes"/>
<view-map name="ajaxAutocompleteOptions" type="screen" page="component://common/widget/CommonScreens.xml#ajaxAutocompleteOptions"/>
<view-map name="help" type="screen" page="component://common/widget/CommonScreens.xml#help"/>
<view-map name="geoLocation" type="screen" page="component://common/widget/CommonScreens.xml#geoLocation"/>
<view-map name="viewBlocked" type="screen" page="component://common/widget/CommonScreens.xml#viewBlocked"/>
</site-conf>