[CONF] Confluence Changes in the last 24 hours
- This is a daily summary of all recent changes in Confluence. - Updated Spaces: - Apache Geronimo SandBox (GMOxSBOX) http://cwiki.apache.org/confluence/display/GMOxSBOX | |-Pages Added or Edited in This Space |-- Using Derby with Geronimo was last edited by mazzag (08:30 AM). | http://cwiki.apache.org/confluence/display/GMOxSBOX/Using+Derby+with+Geronimo Apache Felix (FELIX) http://cwiki.apache.org/confluence/display/FELIX | |-Pages Added or Edited in This Space |-- news was last edited by [EMAIL PROTECTED] (06:45 PM). | http://cwiki.apache.org/confluence/display/FELIX/news |-- Index was last edited by [EMAIL PROTECTED] (06:43 PM). | http://cwiki.apache.org/confluence/display/FELIX/Index |-- Alternative designs was created by marrs (12:58 PM). | http://cwiki.apache.org/confluence/display/FELIX/Alternative+designs |-- Apache Felix Application Demonstration was last edited by [EMAIL PROTECTED] (09:56 AM). | http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Application+Demonstration OpenEJB (OPENEJB) http://cwiki.apache.org/confluence/display/OPENEJB | |-Pages Added or Edited in This Space |-- July2007 was created by dblevins (01:57 PM). | http://cwiki.apache.org/confluence/display/OPENEJB/July2007 Apache ActiveMQ (ACTIVEMQ) http://cwiki.apache.org/confluence/display/ACTIVEMQ | |-Pages Added or Edited in This Space |-- Getting Started was last edited by [EMAIL PROTECTED] (01:19 AM). | http://cwiki.apache.org/confluence/display/ACTIVEMQ/Getting+Started Apache ActiveMQ CPP (AMQCPP) http://cwiki.apache.org/confluence/display/AMQCPP | |-Pages Added or Edited in This Space |-- CMS API 1.1 Release was created by nmittler (05:49 AM). | http://cwiki.apache.org/confluence/display/AMQCPP/CMS+API+1.1+Release |-- ActiveMQ-CPP 2.1 Release was created by nmittler (06:56 AM). | http://cwiki.apache.org/confluence/display/AMQCPP/ActiveMQ-CPP+2.1+Release Apache Struts 2 Documentation (WW) http://cwiki.apache.org/confluence/display/WW | |-Pages Added or Edited in This Space |-- OGNL Expression Compilation was created by jkuhnert (08:44 AM). | http://cwiki.apache.org/confluence/display/WW/OGNL+Expression+Compilation Tuscany Wiki (TUSCANYWIKI) http://cwiki.apache.org/confluence/display/TUSCANYWIKI | |-Pages Added or Edited in This Space |-- Multiple bindings and reference multiplicity was last edited by rfeng (03:42 PM). | http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Multiple+bindings+and+reference+multiplicity Apache Tuscany (TUSCANY) http://cwiki.apache.org/confluence/display/TUSCANY | |-Pages Added or Edited in This Space |-- Making releases was last edited by svkrish (12:57 AM). | http://cwiki.apache.org/confluence/display/TUSCANY/Making+releases - CONFLUENCE INFORMATION This message is automatically generated by Confluence Unsubscribe or edit your notifications preferences http://cwiki.apache.org/confluence/users/viewnotifications.action If you think it was sent incorrectly contact one of the administrators http://cwiki.apache.org/confluence/administrators.action If you want more information on Confluence, or have a bug to report see http://www.atlassian.com/software/confluence
svn commit: r556503 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java
Author: mrdon Date: Sun Jul 15 22:11:44 2007 New Revision: 556503 URL: http://svn.apache.org/viewvc?view=rev&rev=556503 Log: Streamline code to not execute code when an attribute is not null WW-1959 Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java?view=diff&rev=556503&r1=556502&r2=556503 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StrutsRequestWrapper.java Sun Jul 15 22:11:44 2007 @@ -63,24 +63,26 @@ ActionContext ctx = ActionContext.getContext(); Object attribute = super.getAttribute(s); -boolean alreadyIn = false; -Boolean b = (Boolean) ctx.get("__requestWrapper.getAttribute"); -if (b != null) { -alreadyIn = b.booleanValue(); -} +if (attribute == null) { +boolean alreadyIn = false; +Boolean b = (Boolean) ctx.get("__requestWrapper.getAttribute"); +if (b != null) { +alreadyIn = b.booleanValue(); +} -// note: we don't let # come through or else a request for -// #attr.foo or #request.foo could cause an endless loop -if (!alreadyIn && attribute == null && s.indexOf("#") == -1) { -try { -// If not found, then try the ValueStack -ctx.put("__requestWrapper.getAttribute", Boolean.TRUE); -ValueStack stack = ctx.getValueStack(); -if (stack != null) { -attribute = stack.findValue(s); +// note: we don't let # come through or else a request for +// #attr.foo or #request.foo could cause an endless loop +if (!alreadyIn && s.indexOf("#") == -1) { +try { +// If not found, then try the ValueStack +ctx.put("__requestWrapper.getAttribute", Boolean.TRUE); +ValueStack stack = ctx.getValueStack(); +if (stack != null) { +attribute = stack.findValue(s); +} +} finally { +ctx.put("__requestWrapper.getAttribute", Boolean.FALSE); } -} finally { -ctx.put("__requestWrapper.getAttribute", Boolean.FALSE); } } return attribute;
svn commit: r556506 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/dispatcher/mapper/ test/java/org/apache/struts2/dispatcher/mapper/
Author: mrdon Date: Sun Jul 15 22:30:37 2007 New Revision: 556506 URL: http://svn.apache.org/viewvc?view=rev&rev=556506 Log: Adding ability to add custom action parameter prefixes WW-1815 Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/ParameterAction.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java?view=diff&rev=556506&r1=556505&r2=556506 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java Sun Jul 15 22:30:37 2007 @@ -235,6 +235,17 @@ } }; } + +/** + * Adds a parameter action. Should only be called during initialization + * + * @param prefix The string prefix to trigger the action + * @param parameterAction The parameter action to execute + * @since 2.1.0 +*/ +protected void addParameterAction(String prefix, ParameterAction parameterAction) { +prefixTrie.put(prefix, parameterAction); +} @Inject(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION) public void setAllowDynamicMethodCalls(String allow) { @@ -491,11 +502,4 @@ return allowSlashesInActionNames; } - /** - * Defines a parameter action prefix - */ -interface ParameterAction { -void execute(String key, ActionMapping mapping); -} - } Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/ParameterAction.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/ParameterAction.java?view=auto&rev=556506 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/ParameterAction.java (added) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/mapper/ParameterAction.java Sun Jul 15 22:30:37 2007 @@ -0,0 +1,13 @@ +package org.apache.struts2.dispatcher.mapper; + +/** + * Defines a parameter action prefix. This is executed when the configured prefix key is matched in a parameter + * name, allowing the implementation to manipulate the action mapping accordingly. For example, if the "action:foo" + * parameter name was found, and a ParameterAction implementation was registered to handle the "action" prefix, the + * execute method would be called, allowing the implementation to set the "method" value on the ActionMapping. + * + * @since 2.1.0 + */ +public interface ParameterAction { +void execute(String key, ActionMapping mapping); +} Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java?view=diff&rev=556506&r1=556505&r2=556506 == --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java Sun Jul 15 22:30:37 2007 @@ -302,7 +302,7 @@ assertEquals(actionMapping.getName(), "myAction"); } - + public void testActionPrefix_fromImageButton() throws Exception { Map parameterMap = new HashMap(); parameterMap.put(DefaultActionMapper.ACTION_PREFIX + "myAction", ""); @@ -381,6 +381,25 @@ assertTrue(result instanceof ServletRedirectResult); // TODO: need to test location but there's noaccess to the property/method, unless we use reflection +} + +public void testCustomActionPrefix() throws Exception { +Map parameterMap = new HashMap(); +parameterMap.put("foo:myAction", ""); + +StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest(); +request.setParameterMap(parameterMap); +request.setupGetServletPath("/someServletPath.action"); + +DefaultActionMapper defaultActionMapper = new DefaultActionMapper(); +defaultActionMapper.addParameterAction("foo", new ParameterAction() { +public void execute(String key, ActionMapping mapping) { +mapping.setName("myAction"); +
svn commit: r556512 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java
Author: mrdon Date: Sun Jul 15 23:06:53 2007 New Revision: 556512 URL: http://svn.apache.org/viewvc?view=rev&rev=556512 Log: Somewhat improving the location variable name WW-1807 Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java?view=diff&rev=556512&r1=556511&r2=556512 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java Sun Jul 15 23:06:53 2007 @@ -143,28 +143,28 @@ } /** - * Execute this result, using the specified template location. + * Execute this result, using the specified template locationArg. * - * The template location has already been interoplated for any variable substitutions + * The template locationArg has already been interoplated for any variable substitutions * * this method obtains the freemarker configuration and the object wrapper from the provided hooks. * It them implements the template processing workflow by calling the hooks for * preTemplateProcess and postTemplateProcess */ -public void doExecute(String location, ActionInvocation invocation) throws IOException, TemplateException { -this.location = location; +public void doExecute(String locationArg, ActionInvocation invocation) throws IOException, TemplateException { +this.location = locationArg; this.invocation = invocation; this.configuration = getConfiguration(); this.wrapper = getObjectWrapper(); -if (!location.startsWith("/")) { +if (!locationArg.startsWith("/")) { ActionContext ctx = invocation.getInvocationContext(); HttpServletRequest req = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST); String base = ResourceUtil.getResourceBase(req); -location = base + "/" + location; +locationArg = base + "/" + locationArg; } -Template template = configuration.getTemplate(location, deduceLocale()); +Template template = configuration.getTemplate(locationArg, deduceLocale()); TemplateModel model = createModel(); // Give subclasses a chance to hook into preprocessing