0

In the source code below:

@Override
protected void execute(WebScriptRequest request, Map params, JSONObject resultat) throws Exception
{
 String user = request.getParameter( PARAM_USER );
 //Need to set the parameter here using instruction like  request.setParameter(...)
 resultat.put(RESULTAT_JSON_PARAM, "OK");
}

I need to set the request parameter in the webscript. Any idea on how to do it?

Dinidu Hewage
  • 2,169
  • 6
  • 40
  • 51
aoulhent
  • 301
  • 1
  • 4
  • 18
  • So, you have called your web script without the parameter, but would like to set it up when executing the script? Why, what are you trying to achieve? – Lista Jul 11 '16 at 13:43
  • We had about 15 webscripts where we got the user parameter as follows: String user = request.getParameter( PARAM_USER ); Today we have a specific bug to fix and we calculate the new user in a base class and from that base class i want to set the parameter just once that all 15 webscripts will get the new calculated user parameter. – aoulhent Jul 11 '16 at 14:37
  • I don't understand the connection between the base class you mentioned, 15 web scripts, and the web script in which you want to set the parameter, could you please explain a bit more? – Lista Jul 11 '16 at 15:11
  • All the 15 webscripts extends a class call it AbstractWebscript. In this AbstractWebscript suppose we do some traitement to user parameter and we want to set this parameter back for the other webscripts. And when we call request.getParameter( PARAM_USER ); we want to have the last calculated user and not the one which was sent. In fact there are many ways to do it but we didn't want to change in the webscripts but just in the abstract one. Hope you got it this time :) – aoulhent Jul 11 '16 at 16:15
  • I think setting the request is not possible, i ll do it otherwise. – aoulhent Jul 11 '16 at 16:18

0 Answers0