Question
![](https://accounts.pega.com/sites/default/files/pega-user-image/35/REG-34624.png?source=PUMINIT)
Pegasystems Inc.
GB
Last activity: 14 Nov 2016 2:23 EST
Trying to use : tools.getParameterPage().putParamValue( String, Object ) - but seen as putParamValue( String, String ) ?
As a follow-on from this post : https://pdn.pega.com/community/product-support/question/how-create-prpc-page-pxresults-type-page-java-step
I'm trying the following Java Step Code in an Activity on PRPC721 :
try {
javax.net.ssl.TrustManagerFactory trustManagerFactory = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm() );
trustManagerFactory.init((java.security.KeyStore)null);
for (javax.net.ssl.TrustManager trustManager : trustManagerFactory.getTrustManagers() ) {
javax.net.ssl.X509TrustManager x509TrustManager = (javax.net.ssl.X509TrustManager)trustManager;
int i = 1;
for (java.security.cert.X509Certificate cert : x509TrustManager.getAcceptedIssuers()) {
tools.getParameterPage().putParamValue( "cert", cert );
oLog.infoForced( i + ":"+cert.getIssuerX500Principal());
i++;
}
}
}
catch(Exception e) { throw new PRRuntimeException(e); }
But this will not compile; I get:
This record has 1 error(s) in 1 place(s) .
—
Java at step: 1 line: 9
The method putParamValue(String, String) in the type ParameterPage is not applicable for the arguments (String, X509Certificate)
—
Compile failed.
The putParamValue ("PublicAPI") has several method signatures, I'm trying to use this one:
As a follow-on from this post : https://pdn.pega.com/community/product-support/question/how-create-prpc-page-pxresults-type-page-java-step
I'm trying the following Java Step Code in an Activity on PRPC721 :
try {
javax.net.ssl.TrustManagerFactory trustManagerFactory = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm() );
trustManagerFactory.init((java.security.KeyStore)null);
for (javax.net.ssl.TrustManager trustManager : trustManagerFactory.getTrustManagers() ) {
javax.net.ssl.X509TrustManager x509TrustManager = (javax.net.ssl.X509TrustManager)trustManager;
int i = 1;
for (java.security.cert.X509Certificate cert : x509TrustManager.getAcceptedIssuers()) {
tools.getParameterPage().putParamValue( "cert", cert );
oLog.infoForced( i + ":"+cert.getIssuerX500Principal());
i++;
}
}
}
catch(Exception e) { throw new PRRuntimeException(e); }
But this will not compile; I get:
This record has 1 error(s) in 1 place(s) .
—
Java at step: 1 line: 9
The method putParamValue(String, String) in the type ParameterPage is not applicable for the arguments (String, X509Certificate)
—
Compile failed.
The putParamValue ("PublicAPI") has several method signatures, I'm trying to use this one:
putParamValue
void putParamValue(java.lang.String aName,
java.lang.Object aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.
Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter.
But it seems (I think?) that the compiler is trying to use this one instead ?
void putParamValue(java.lang.String aName,
java.lang.String aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.
Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.
Is there something I'm doing wrong here ?
(I tried casting my 'X509Certificate' to 'java.lang.Object' into a temporary variable and called with that - but that doesn't seem to help either).