C++ and Thrift

Java code posted by Mike Pigott
created at 15 Apr 19:51, updated at 29 Apr 23:06

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
protected String src() throws JspException 
  {
    // 1 : deal with src 
        if (this.srcName != null)
        {
            if (this.srcKey != null || this.page != null || this.pageKey !=null)
            {
              // we can not have src and srcKey simultaneously
              throw new JspException("ImgTag >> One of this is (srcName,srcKey,page,pageKey,action) permit not all simultaneously");
            }

           // Get skin image directory.
      Skin lc_skin = LayoutUtils.getSkin(pageContext.getSession());
      String lc_imgSrc = lc_skin.getImageDirectory(pageContext.getRequest());
      
      // Generate image URL code.
      StringBuffer lc_buffer = new StringBuffer(lc_imgSrc);      
      if (!lc_imgSrc.endsWith("/") && !srcName.startsWith("/")) {
        lc_buffer.append('/');
      }      
      lc_buffer.append(srcName);
      return lc_buffer.toString();
        }

        // 2 : deal with srcKey
        if (this.srcKey != null)
        {
          if (this.srcName != null || this.page != null || this.pageKey !=null)
            {
              // we can not have src and srcKey simultaneously
            throw new JspException("ImgTag >> One of this is (srcName,srcKey,page,pageKey,action) permit not all simultaneously");
            }
          return TagUtils.message(pageContext, getBundle(),
                    getLocale(), this.srcKey);
        }

        // 3 : page 
  }
1.38 KB in 3 ms with coderay