Fix incorrect doc on injection of opsForXXX
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
requires raw-data (array of bytes), the <classname>RedisTemplate</classname> allow arbitrary objects to be passed
|
||||
in as messages:</para>
|
||||
|
||||
<programlisting lang="java"><![CDATA[// send message through connection
|
||||
<programlisting language="java">// send message through connection
|
||||
RedisConnection con = ...
|
||||
byte[] msg = ...
|
||||
byte[] channel = ...
|
||||
@@ -38,7 +38,8 @@ con.publish(msg, channel);
|
||||
|
||||
// send message through RedisTemplate
|
||||
RedisTemplate template = ...
|
||||
template.convertAndSend("hello!", "world");]]></programlisting>
|
||||
template.convertAndSend("hello!", "world");
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section id="redis:pubsub:subscribe">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
as when using Redis transactions. For example:
|
||||
</para>
|
||||
|
||||
<programlisting lang="java"><![CDATA[ //execute a transaction
|
||||
<programlisting language="java"><![CDATA[ //execute a transaction
|
||||
redisTemplate.execute(new SessionCallback<Object>() {
|
||||
public Object execute(RedisOperations operations) throws DataAccessException {
|
||||
operations.multi();
|
||||
|
||||
@@ -329,11 +329,11 @@
|
||||
<programlisting language="java"><![CDATA[public class Example {
|
||||
|
||||
// inject the actual template
|
||||
@Resource(name="redisTemplate")
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> template;
|
||||
|
||||
// inject the template as ListOperations
|
||||
@Autowired
|
||||
@Resource(name="redisTemplate")
|
||||
private ListOperations<String, String> listOps;
|
||||
|
||||
public void addLink(String userId, URL url) {
|
||||
|
||||
Reference in New Issue
Block a user