com.clickntap.tool.f.FContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of click_framework Show documentation
Show all versions of click_framework Show documentation
Java Framework based on Spring Framework, Freemarker and Simplicity
The newest version!
package com.clickntap.tool.f;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
import com.clickntap.api.HttpUtils;
import com.clickntap.api.SecureApiController;
import com.clickntap.smart.SmartContext;
public class FContext extends SmartContext {
private Map params;
public FContext() {
super(null, null);
params = new HashMap();
}
public FContext(HttpServletRequest request, HttpServletResponse response) {
super(request, response);
params = new HashMap();
}
public void addParam(String name, String value) {
params.put(name, value);
}
public String http(String url) throws Exception {
return HttpUtils.get(url);
}
public String param(String key) {
if (params.containsKey(key)) {
return params.get(key);
}
return super.param(key);
}
public JSONObject fapi(String uri, String folder) throws Exception {
SecureApiController controller = (SecureApiController) getBean("apiController");
return controller.fapi(this, uri, folder);
}
}