Subversion Repositories SmartDukaan

Rev

Rev 2351 | Rev 2778 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2351 Rev 2468
Line 2... Line 2...
2
 
2
 
3
import java.util.Map;
3
import java.util.Map;
4
import javax.servlet.ServletContext;
4
import javax.servlet.ServletContext;
5
import org.apache.struts2.interceptor.ParameterAware;
5
import org.apache.struts2.interceptor.ParameterAware;
6
import org.apache.struts2.util.ServletContextAware;
6
import org.apache.struts2.util.ServletContextAware;
7
import org.apache.velocity.context.Context;
-
 
8
import org.apache.velocity.util.ContextAware;
-
 
9
 
-
 
10
import com.thoughtworks.xstream.core.util.Base64Encoder;
7
import com.thoughtworks.xstream.core.util.Base64Encoder;
11
 
8
 
12
public class CommunityPromotionController implements ParameterAware, ServletContextAware {
9
public class CommunityPromotionController implements ParameterAware, ServletContextAware {
13
 
10
 
14
    protected Map<String, String[]> parameters;
11
    protected Map<String, String[]> parameters;
Line 51... Line 48...
51
        String str = "";
48
        String str = "";
52
        for(String key: this.parameters.keySet())   {
49
        for(String key: this.parameters.keySet())   {
53
            str = this.parameters.get(key)[0];
50
            str = this.parameters.get(key)[0];
54
        }
51
        }
55
        Base64Encoder decoder = new Base64Encoder();
52
        Base64Encoder decoder = new Base64Encoder();
-
 
53
        try {
56
        byte[] decodedBytes = decoder.decode(str.split("\\.")[1]);
54
            byte[] decodedBytes = decoder.decode(str.split("\\.")[1]);
57
        return new String(decodedBytes);
55
            return new String(decodedBytes);
-
 
56
        }
-
 
57
        catch (ArrayIndexOutOfBoundsException e) {
-
 
58
            e.printStackTrace();
-
 
59
            return "{}";
-
 
60
        }
58
    }
61
    }
59
    
62
    
60
    public String test()  {
63
    public String test()  {
61
        String[] test = new String[] {"str1", "str2", "str3"};
64
        String[] test = new String[] {"str1", "str2", "str3"};
62
        String str = "";
65
        String str = "";