From a5e2afc980b745343630c83879e222318ca3d479 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 24 Nov 2014 20:56:40 +0100 Subject: [PATCH] Fix documentation formatting Using the "quotes" substitution group by default leads to side effect when the "*" character is used. This is especially true for AOP pointcut or for MVC mappings. Plain verbatim might work most of the time unless you intend to highlight a piece of code or a comment. Issue: SPR-12456 (cherry picked from commit 0d00b674f4b2b7b6c7abd49b38c484c14d06bc94) --- src/asciidoc/index.adoc | 120 ++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/src/asciidoc/index.adoc b/src/asciidoc/index.adoc index c23941ec76..fcb838388d 100644 --- a/src/asciidoc/index.adoc +++ b/src/asciidoc/index.adoc @@ -8871,7 +8871,7 @@ a resource points to just one resource at a time. When the path location contains an Ant-style pattern, for example: [literal] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- /WEB-INF/*-context.xml com/mycompany/**/applicationContext.xml @@ -9139,7 +9139,7 @@ Implementing a `Validator` is fairly straightforward, especially when you know o `ValidationUtils` helper class that the Spring Framework also provides. [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- public class PersonValidator implements Validator { @@ -12661,16 +12661,16 @@ execution is in the trading module), and `tradingOperation` (which matches if a execution represents any public method in the trading module). [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @Pointcut("execution(public * *(..))") - private void anyPublicOperation() {} + private void anyPublicOperation() {} - @Pointcut("within(com.xyz.someapp.trading..*)") - private void inTrading() {} + @Pointcut("within(com.xyz.someapp.trading..*)") + private void inTrading() {} - @Pointcut("anyPublicOperation() && inTrading()") - private void tradingOperation() {} + @Pointcut("anyPublicOperation() && inTrading()") + private void tradingOperation() {} ---- It is a best practice to build more complex pointcut expressions out of smaller named @@ -12688,7 +12688,7 @@ defining a "SystemArchitecture" aspect that captures common pointcut expressions this purpose. A typical such aspect would look as follows: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- package com.xyz.someapp; @@ -12805,7 +12805,7 @@ Some examples of common pointcut expressions are given below. * the execution of any public method: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- execution(public * *(..)) ---- @@ -12813,7 +12813,7 @@ Some examples of common pointcut expressions are given below. * the execution of any method with a name beginning with "set": [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- execution(* set*(..)) ---- @@ -12821,7 +12821,7 @@ Some examples of common pointcut expressions are given below. * the execution of any method defined by the `AccountService` interface: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- execution(* com.xyz.service.AccountService.*(..)) ---- @@ -12829,7 +12829,7 @@ Some examples of common pointcut expressions are given below. * the execution of any method defined in the service package: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- execution(* com.xyz.service.*.*(..)) ---- @@ -12837,7 +12837,7 @@ Some examples of common pointcut expressions are given below. * the execution of any method defined in the service package or a sub-package: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- execution(* com.xyz.service..*.*(..)) ---- @@ -13056,7 +13056,7 @@ Before advice is declared in an aspect using the `@Before` annotation: If using an in-place pointcut expression we could rewrite the above example as: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; @@ -13385,7 +13385,7 @@ You can restrict interception of method types to certain parameter types by simp typing the advice parameter to the parameter type you want to intercept the method for: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @Before("execution(* ..Sample+.sampleGenericMethod(*)) && args(param)") public void beforeSampleMethod(MyType param) { @@ -13398,7 +13398,7 @@ pointing out that this won't work for generic collections. So you cannot define pointcut like this: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @Before("execution(* ..Sample+.sampleGenericCollectionMethod(*)) && args(param)") public void beforeSampleMethod(Collection param) { @@ -13806,7 +13806,7 @@ A pointcut representing the execution of any business service in the service lay be defined as follows: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -13838,7 +13838,7 @@ Assuming you have a `SystemArchitecture` aspect as described in < @@ -13859,7 +13859,7 @@ definition style may collect join point context. For example, the following poin collects the 'this' object as the join point context and passes it to advice: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -13893,7 +13893,7 @@ the keywords 'and', 'or' and 'not' can be used in place of '&&', '||' and '!' respectively. For example, the previous pointcut may be better written as: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -13946,7 +13946,7 @@ level. To define the pointcut inline instead, replace the `pointcut-ref` attribu a `pointcut` attribute: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -14356,7 +14356,7 @@ commonly see it used in conjunction with transactional advice, which also has it namespace support in Spring. Here's how it looks: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -14458,7 +14458,7 @@ annotations removed. The corresponding Spring configuration is: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -14500,7 +14500,7 @@ change to the aspect to retry only idempotent operations simply involves refinin pointcut expression so that only `@Idempotent` operations match: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -15921,7 +15921,7 @@ Using `RegexpMethodPointcutAdvisor` simplifies wiring, as the one bean encapsula pointcut and advice, as shown below: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -23313,7 +23313,7 @@ the setter for the `DataSource`. This leads to DAOs that look in part like the f The corresponding configuration might look like this. [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -28430,7 +28430,7 @@ your configuration. Use the __spring-context__ schema as shown in the following snippet: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- ` element has an to `false`. [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- > instead. [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -29573,7 +29573,7 @@ To support HTTP PUT and PATCH requests, the `spring-web` module provides the fil `HttpPutFormContentFilter`, which can be configured in `web.xml`: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- httpPutFormFilter @@ -32467,7 +32467,7 @@ then the default Servlet's name must be explicitly provided as in the following Or in XML: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- ---- @@ -32938,7 +32938,7 @@ collection so it can hold multiple values selected by the user. Below is an exam the JSP using this tag: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -34062,7 +34062,7 @@ If your application expects to handle cities by internal codes for example, the codes would be created with suitable keys like the example below. [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- protected Map referenceData(HttpServletRequest request) throws Exception { Map cityMap = new LinkedHashMap(); @@ -34118,7 +34118,7 @@ this directive. In similar fashion, HTML escaping can be specified per field: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- <#-- until this point, default HTML escaping is used --> @@ -34414,7 +34414,7 @@ Here's the complete listing for our POI Excel view which displays the word list model map in consecutive rows of the first column of a new spreadsheet: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- package excel; @@ -34452,7 +34452,7 @@ model map in consecutive rows of the first column of a new spreadsheet: And the following is a view generating the same Excel file, now using JExcelApi: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- package excel; @@ -34492,7 +34492,7 @@ The PDF version of the word list is even simpler. This time, the class extends `buildPdfDocument()` method as follows: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- package pdf; @@ -34558,7 +34558,7 @@ Typically, you will use the `ResourceBundleViewResolver` to map view names to vi classes and files in a properties file. [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- @@ -34644,7 +34644,7 @@ mapping key. From a coding perspective you add an entry to your model with the f key as the key and the mapping key as the value, for example: [source,java,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- public ModelAndView handleSimpleReportMulti(HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -34771,7 +34771,7 @@ report file must be configured to accept sub-reports from an external source. To you declare a parameter in your report file like so: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ---- ---- @@ -34779,7 +34779,7 @@ you declare a parameter in your report file like so: Then, you define your sub-report to use this sub-report parameter: [source,xml,indent=0] -[subs="verbatim,quotes"] +[subs="verbatim"] ----