Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Encode your url. It is possible that the & is being interpreted differently in a java script. Look at URL Encoding when you pass parameters.
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?
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
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..
"cmd /c start chrome " + URLEncoder.encode("http://localhost:8080/TestDataUpdate?tablename=temp_staging_table&pk=empid", "UTF-8")
Thanks for the reply.
But now I am getting the error that URL encoder cannot be resolved!
Prefix the URLEncoder class with its package name
java.net.
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.