Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pass multiple values in tSystem component

I am trying to pass 2 querystring parameters in my Job using tSystem component to launch a JSP page. The page gets launched properly but always i am getting the second parameter as null.

Can you help me in that? See in my screenshot below, i am passing the value as:

"cmd /c start chrome http://localhost:8080/TestDataUpdate?tablename=temp_staging_table&pk=empid"

This gives first parameter as correct, but second parameter is null.

 

0683p000009Lver.jpg0683p000009LvIU.jpg

Labels (2)
8 Replies
Anonymous
Not applicable
Author

Encode your url.  It is possible that the & is being interpreted differently in a java script.  Look at URL Encoding when you pass parameters.

Anonymous
Not applicable
Author

Ok. But I am not able to understand how to use  encodeURI in our example.

I think we need to do something like this:

var uri = "my test.asp?name=ståle&car=saab";
var res = encodeURI(uri);

 

How to do it in our case i.e. what would command line look like?

Anonymous
Not applicable
Author

Hi @ppp_rrr

These are simple developer questions.  It takes less time to google it and find the answer 

https://stackoverflow.com/questions/10786042/java-url-encoding-of-query-string-parameters

Anonymous
Not applicable
Author

Ya sure @iburtally, it was easy to find on net about encoding, but what I wanted that how to pass it in our URL. i am trying to pass value as:

"cmd /c start chrome " + "URLEncoder.encode(http://localhost:8080/TestDataUpdate?tablename=temp_staging_table&pk=empid, \"UTF-8"\ +")"; "

 

But not getting success, there are errors in it..so I am only seeking help on Syntax..

Anonymous
Not applicable
Author

"cmd /c start chrome " + URLEncoder.encode("http://localhost:8080/TestDataUpdate?tablename=temp_staging_table&pk=empid", "UTF-8")

Anonymous
Not applicable
Author

Thanks for the reply.

But now I am getting the error that URL encoder cannot be resolved!

0683p000009LwBC.jpg

Anonymous
Not applicable
Author

Prefix the URLEncoder class with its package name

java.net.

Anonymous
Not applicable
Author

This resolves my compiler error and my final string is now:

"cmd /c start chrome " + java.net.URLEncoder.encode("http://localhost:8080/TestDataUpdate?tablename=temp_staging_table&pk=empid", "UTF-8")

 

However, on executing my Job, this only launches 'chrome' and the application hosted doesn't gets launched.