@Override
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
SiteInfo site = siteService.getSite(req.getParameter(PARAM_SITE));
//Making sure that the site exists
if(site!=null){
//Making sure that the site preset is of type municipality
String preset = site.getSitePreset();
if(preset.equals(PARAM_MUNICIPALITY)){
NodeRef noderef = site.getNodeRef();
WebScriptRequest req2 = req;
//dreamscenario req2.setParameter("nodeRef", nodeRef);
super.serviceRegistry = this.serviceRegistry;
super.execute(req2, res);
}else{
res.getWriter().write("Site preset is not of municipality");
}
}else{
res.getWriter().write("Site was not found");
}
}
This is my class that overrides/extends the web script method called execute. I want to change the parameter WebScriptRequest req
//dreamscenario req2.setParameter("nodeRef", nodeRef);
is basically what I want to achieve. So whenever the super class calls:
req.getParameter("nodeRef")
it will get whatever parameter I put in my method.
Obviously this approach is not working. I could just override the entire super class that im extending, but that doesn't feel like the correct solution if "all" I want to do is change the parameter.