You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2019/03/27 18:06:19 UTC

[portals-pluto] branch master updated: PLUTO-752 ChatRoomDemo injects dependent-scoped strings into @ApplicationScoped bean

This is an automated email from the ASF dual-hosted git repository.

asfgriff pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/portals-pluto.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e9430f  PLUTO-752 ChatRoomDemo injects dependent-scoped strings into @ApplicationScoped bean
4e9430f is described below

commit 4e9430fff5df3b26da59c97a43c8a2bcbf6014b3
Author: Neil Griffin <ne...@gmail.com>
AuthorDate: Wed Mar 27 14:05:56 2019 -0400

    PLUTO-752 ChatRoomDemo injects dependent-scoped strings into @ApplicationScoped bean
---
 .../main/java/com/ibm/portal/samples/HelloWorldImage.java    | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/ChatRoomDemo/src/main/java/com/ibm/portal/samples/HelloWorldImage.java b/ChatRoomDemo/src/main/java/com/ibm/portal/samples/HelloWorldImage.java
index 7f3cea6..498dbb0 100644
--- a/ChatRoomDemo/src/main/java/com/ibm/portal/samples/HelloWorldImage.java
+++ b/ChatRoomDemo/src/main/java/com/ibm/portal/samples/HelloWorldImage.java
@@ -25,8 +25,6 @@ import javax.portlet.HeaderRequest;
 import javax.portlet.HeaderResponse;
 import javax.portlet.MimeResponse;
 import javax.portlet.PortletRequest;
-import javax.portlet.annotations.ContextPath;
-import javax.portlet.annotations.Namespace;
 import javax.portlet.annotations.HeaderMethod;
 import javax.portlet.annotations.RenderMethod;
 import javax.portlet.annotations.ServeResourceMethod;
@@ -37,18 +35,10 @@ import javax.portlet.annotations.ServeResourceMethod;
  */
 public class HelloWorldImage {
 
-   // Injecting the namespace & MimeResponse
-   @Inject
-   @Namespace
-   private String                pid;
    @Inject
    private MimeResponse          mimeresp;
 
    @Inject
-   @ContextPath
-   String                        ctxPath;
-
-   @Inject
    PortletRequest                req;
 
    @Inject
@@ -109,7 +99,7 @@ public class HelloWorldImage {
             ind += 0xFF & b;
          }
          ind = ind % chimps.length;
-         String path = ctxPath + chimps[ind];
+         String path = req.getContextPath() + chimps[ind];
          path = mimeresp.encodeURL(path);
       
          txt.append("<p>Your image appears here:</p>\n");