Ensure PDF version of Reference Manual does not contain HTML <strong> tags
Prior to this commit, the PDF version of the Spring Reference Manual
contained HTML <strong></strong> tags in code examples due to the fact
that Asciidoctor converts bold formatting (i.e., elements wrapped in
`**` or `*`) within source code blocks into HTML tags even for PDF
rendering.
This commit addresses this issue by removing all bold formatting from
example code blocks.
Closes gh-22577
@ -1808,14 +1808,14 @@ respectively. For example, the previous pointcut can be better written as follow
@@ -1808,14 +1808,14 @@ respectively. For example, the previous pointcut can be better written as follow
@ -2806,7 +2806,7 @@ to do so:
@@ -2806,7 +2806,7 @@ to do so:
[source,java,indent=0]
[subs="verbatim,quotes"]
----
**@RequestScope**
@RequestScope
@Component
public class LoginAction {
// ...
@ -2846,7 +2846,7 @@ When using annotation-driven components or Java configuration, you can use the
@@ -2846,7 +2846,7 @@ When using annotation-driven components or Java configuration, you can use the
[source,java,indent=0]
[subs="verbatim,quotes"]
----
**@SessionScope**
@SessionScope
@Component
public class UserPreferences {
// ...
@ -2885,7 +2885,7 @@ following example shows how to do so:
@@ -2885,7 +2885,7 @@ following example shows how to do so:
@ -5113,7 +5113,7 @@ provide the `@Qualifier` annotation within your definition, as the following exa
@@ -5113,7 +5113,7 @@ provide the `@Qualifier` annotation within your definition, as the following exa
<!-- inject any dependencies required by this bean -->
</bean>
@ -5496,7 +5496,7 @@ named `movieFinder` injected into its setter method:
@@ -5496,7 +5496,7 @@ named `movieFinder` injected into its setter method:
private MovieFinder movieFinder;
**@Resource**
@Resource
public void setMovieFinder(MovieFinder movieFinder) {
this.movieFinder = movieFinder;
}
@ -5705,7 +5705,7 @@ You can then use `@SessionScope` without declaring the `proxyMode` as follows:
@@ -5705,7 +5705,7 @@ You can then use `@SessionScope` without declaring the `proxyMode` as follows:
[subs="verbatim,quotes"]
----
@Service
**@SessionScope**
@SessionScope
public class SessionScopedService {
// ...
}
@ -5719,7 +5719,7 @@ You can also override the value for the `proxyMode`, as the following example sh
@@ -5719,7 +5719,7 @@ You can also override the value for the `proxyMode`, as the following example sh
public class CachingMovieCatalog implements MovieCatalog {
// ...
}
@ -7189,7 +7189,7 @@ as the following example shows:
@@ -7189,7 +7189,7 @@ as the following example shows:
public class MyConfiguration {
@Bean
**@Scope("prototype")**
@Scope("prototype")
public Encryptor encryptor() {
// ...
}
@ -7217,7 +7217,7 @@ it resembles the following:
@@ -7217,7 +7217,7 @@ it resembles the following:
----
// an HTTP Session-scoped bean exposed as a proxy
@Bean
**@SessionScope**
@SessionScope
public UserPreferences userPreferences() {
return new UserPreferences();
}
@ -7298,7 +7298,7 @@ annotation, as the following example shows:
@@ -7298,7 +7298,7 @@ annotation, as the following example shows:
public class AppConfig {
@Bean
**@Description("Provides a basic example of a bean")**
@Description("Provides a basic example of a bean")
public Thing thing() {
return new Thing();
}
@ -8127,7 +8127,7 @@ can rewrite the `dataSource` configuration as follows:
@@ -8127,7 +8127,7 @@ can rewrite the `dataSource` configuration as follows:
[subs="verbatim,quotes"]
----
@Configuration
**@Profile("development")**
@Profile("development")
public class StandaloneDataConfig {
@Bean
@ -8145,7 +8145,7 @@ can rewrite the `dataSource` configuration as follows:
@@ -8145,7 +8145,7 @@ can rewrite the `dataSource` configuration as follows:
[subs="verbatim,quotes"]
----
@Configuration
**@Profile("production")**
@Profile("production")
public class JndiDataConfig {
@Bean(destroyMethod="")
@ -8186,7 +8186,7 @@ of creating a custom composed annotation. The following example defines a custom
@@ -8186,7 +8186,7 @@ of creating a custom composed annotation. The following example defines a custom
----
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
**@Profile("production")**
@Profile("production")
public @interface Production {
}
----
@ -8423,7 +8423,7 @@ following example:
@@ -8423,7 +8423,7 @@ following example:
[subs="verbatim,quotes"]
----
@Configuration
**@Profile("default")**
@Profile("default")
public class DefaultDataConfig {
@Bean
@ -8540,7 +8540,7 @@ a call to `testBean.getName()` returns `myTestBean`:
@@ -8540,7 +8540,7 @@ a call to `testBean.getName()` returns `myTestBean`:
@ -1078,7 +1078,7 @@ Consider the following class definition:
@@ -1078,7 +1078,7 @@ Consider the following class definition:
[subs="verbatim,quotes"]
----
// the service class that we want to make transactional
**@Transactional**
@Transactional
public class DefaultFooService implements FooService {
Foo getFoo(String fooName);
@ -1553,7 +1553,7 @@ The following code shows the simple profiling aspect discussed earlier:
@@ -1553,7 +1553,7 @@ The following code shows the simple profiling aspect discussed earlier:
this.order = order;
}
// this method *is* the around advice
// this method is the around advice
public Object profile(ProceedingJoinPoint call) throws Throwable {
Object returnValue;
StopWatch clock = new StopWatch(getClass().getName());
@ -1817,7 +1817,7 @@ with an anonymous class, as follows:
@@ -1817,7 +1817,7 @@ with an anonymous class, as follows:
@ -1840,7 +1840,7 @@ Code within the callback can roll the transaction back by calling the
@@ -1840,7 +1840,7 @@ Code within the callback can roll the transaction back by calling the
updateOperation1();
updateOperation2();
} catch (SomeBusinessException ex) {
**status.setRollbackOnly();**
status.setRollbackOnly();
}
}
});
@ -2606,7 +2606,7 @@ the setter for the `DataSource`. This leads to DAOs that resemble the following:
@@ -2606,7 +2606,7 @@ the setter for the `DataSource`. This leads to DAOs that resemble the following:
private JdbcTemplate jdbcTemplate;
public void setDataSource(DataSource dataSource) {
**this.jdbcTemplate = new JdbcTemplate(dataSource);**
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
// JDBC-backed implementations of the methods on the CorporateEventDao follow...
@ -5044,7 +5044,7 @@ errors in the SQL it executes from the scripts, as the following example shows:
@@ -5044,7 +5044,7 @@ errors in the SQL it executes from the scripts, as the following example shows:
@ -47,12 +47,12 @@ The following example shows how to use JNDI to look up a data source without the
@@ -47,12 +47,12 @@ The following example shows how to use JNDI to look up a data source without the
@ -2119,7 +2119,7 @@ containers that ships with Spring (in this case, `DefaultMessageListenerContaine
@@ -2119,7 +2119,7 @@ containers that ships with Spring (in this case, `DefaultMessageListenerContaine
@ -2219,17 +2219,17 @@ POJO that we can make into an MDP through the following configuration:
@@ -2219,17 +2219,17 @@ POJO that we can make into an MDP through the following configuration:
@ -2818,7 +2818,7 @@ namespace elements, you need to reference the JMS schema, as the following examp
@@ -2818,7 +2818,7 @@ namespace elements, you need to reference the JMS schema, as the following examp
@ -7323,13 +7323,13 @@ do yourself a favor and read <<core.adoc#expressions, Spring Expression Language
@@ -7323,13 +7323,13 @@ do yourself a favor and read <<core.adoc#expressions, Spring Expression Language
[source,java,indent=0]
[subs="verbatim,quotes"]
----
@Cacheable(cacheNames="books", **key="#isbn"**)
@Cacheable(cacheNames="books", key="#isbn")
public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)
public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)
----
====
@ -7345,7 +7345,7 @@ so, specify the name of the `KeyGenerator` bean implementation to use, as the fo
@@ -7345,7 +7345,7 @@ so, specify the name of the `KeyGenerator` bean implementation to use, as the fo
public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)
----
====
@ -7481,7 +7481,7 @@ supported wrapper, so the previous example can be rewritten as follows:
@@ -7481,7 +7481,7 @@ supported wrapper, so the previous example can be rewritten as follows:
@ -3346,11 +3346,11 @@ The first code listing shows a JUnit 4 based implementation of the test class th
@@ -3346,11 +3346,11 @@ The first code listing shows a JUnit 4 based implementation of the test class th
----
@RunWith(SpringRunner.class)
// specifies the Spring configuration to load for this test fixture
@ -3435,8 +3435,8 @@ method in the superclass as well):
@@ -3435,8 +3435,8 @@ method in the superclass as well):
@Autowired
@Override
public void setDataSource(**@Qualifier("myDataSource")** DataSource dataSource) {
**super**.setDataSource(dataSource);
public void setDataSource(@Qualifier("myDataSource") DataSource dataSource) {
super.setDataSource(dataSource);
}
// ...
@ -3809,11 +3809,11 @@ following example shows the relevant annotations in bold:
@@ -3809,11 +3809,11 @@ following example shows the relevant annotations in bold:
----
@RunWith(SpringRunner.class)
@ContextConfiguration
**@Transactional(transactionManager = "txMgr")**
**@Commit**
@Transactional(transactionManager = "txMgr")
@Commit
public class FictitiousTransactionalTest {
**@BeforeTransaction**
@BeforeTransaction
void verifyInitialDatabaseState() {
// logic to verify the initial state before a transaction is started
}
@ -3825,7 +3825,7 @@ following example shows the relevant annotations in bold:
@@ -3825,7 +3825,7 @@ following example shows the relevant annotations in bold:
@Test
// overrides the class-level @Commit setting
**@Rollback**
@Rollback
public void modifyDatabaseWithinTransaction() {
// logic which uses the test data and modifies database state
}
@ -3835,7 +3835,7 @@ following example shows the relevant annotations in bold:
@@ -3835,7 +3835,7 @@ following example shows the relevant annotations in bold:
// execute "tear down" logic within the transaction
}
**@AfterTransaction**
@AfterTransaction
void verifyFinalDatabaseState() {
// logic to verify the final state after transaction has rolled back
@ -475,7 +475,7 @@ through the `syncBody` method, as the following example shows:
@@ -475,7 +475,7 @@ through the `syncBody` method, as the following example shows:
@ -1368,7 +1368,7 @@ content types that a controller method produces, as the following example shows:
@@ -1368,7 +1368,7 @@ content types that a controller method produces, as the following example shows:
@ -2023,7 +2023,7 @@ You can automatically apply validation after data binding by adding the
@@ -2023,7 +2023,7 @@ You can automatically apply validation after data binding by adding the
@ -2078,7 +2078,7 @@ The following example shows how to do so:
@@ -2078,7 +2078,7 @@ The following example shows how to do so:
// ...
@GetMapping
public String setupForm(**@RequestParam("petId") int petId**, Model model) { <1>
public String setupForm(@RequestParam("petId") int petId, Model model) { <1>
Pet pet = this.clinic.loadPet(petId);
model.addAttribute("pet", pet);
return "petForm";
@ -2633,8 +2633,8 @@ probably want it deserialized from JSON (similar to `@RequestBody`). Use the
@@ -2633,8 +2633,8 @@ probably want it deserialized from JSON (similar to `@RequestBody`). Use the
[subs="verbatim,quotes"]
----
@PostMapping("/")
public String handle(**@RequestPart("meta-data") MetaData metadata,
@RequestPart("file-data") MultipartFile file**) {
public String handle(@RequestPart("meta-data") MetaData metadata,
@RequestPart("file-data") MultipartFile file) {
// ...
}
----
@ -2652,8 +2652,8 @@ as the following example shows:
@@ -2652,8 +2652,8 @@ as the following example shows:
[subs="verbatim,quotes"]
----
@PostMapping("/")
public String handle(**@Valid** @RequestPart("meta-data") MetaData metadata,
**BindingResult result**) {
public String handle(@Valid @RequestPart("meta-data") MetaData metadata,
@ -1743,7 +1743,7 @@ The following example shows how to do so in Java configuration:
@@ -1743,7 +1743,7 @@ The following example shows how to do so in Java configuration:
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
@ -1766,16 +1766,14 @@ The following example shows the XML configuration equivalent of the preceding ex
@@ -1766,16 +1766,14 @@ The following example shows the XML configuration equivalent of the preceding ex