Search in sources :

Example 1 with HttpContextNull

use of com.genexus.internet.HttpContextNull in project JavaClasses by genexuslabs.

the class JavaModelContextExtension method submitCopy.

@Override
public ModelContext submitCopy(ModelContext modelContext) {
    ModelContext newContext = new ModelContext(modelContext);
    newContext.setHttpContext(new HttpContextNull());
    initializeSubmitSession(modelContext, newContext);
    HttpContext ctx = (HttpContext) modelContext.getHttpContext();
    if (ctx != null) {
        HttpContext newHttpContext = (HttpContext) newContext.getHttpContext();
        newHttpContext.setDefaultPath(ctx.getDefaultPath());
        newHttpContext.setContextPath(ctx.getContextPath());
        newHttpContext.setStaticContentBase(ctx.getStaticContentBase());
        newHttpContext.setClientId(ctx.getClientId());
        newHttpContext.setLanguage(ctx.getLanguage());
    }
    return newContext;
}
Also used : IExtensionModelContext(com.genexus.common.interfaces.IExtensionModelContext) HttpContext(com.genexus.internet.HttpContext) HttpContextNull(com.genexus.internet.HttpContextNull)

Example 2 with HttpContextNull

use of com.genexus.internet.HttpContextNull in project JavaClasses by genexuslabs.

the class WebWrapper method setSource.

public void setSource(GXWebPanel panel) {
    this.panel = panel;
    ModelContext context = panel.getModelContext();
    HttpRequest httpReq = ((HttpContext) context.getHttpContext()).getHttpRequest();
    IHttpServletRequest httpSerReq = ((HttpContext) context.getHttpContext()).getRequest();
    context.setHttpContext(new HttpContextNull());
    ((HttpContext) context.getHttpContext()).setHttpRequest(httpReq);
    ((HttpContext) context.getHttpContext()).setRequest(httpSerReq);
    ((HttpContext) context.getHttpContext()).setContext(context);
    panel.setHttpContext(((HttpContext) context.getHttpContext()));
    panel.getHttpContext().setCompression(false);
    panel.getHttpContext().setBuffered(false);
    panel.getHttpContext().useUtf8 = true;
    panel.getHttpContext().setOutputStream(new java.io.ByteArrayOutputStream());
}
Also used : ModelContext(com.genexus.ModelContext) HttpRequest(com.genexus.internet.HttpRequest) IHttpServletRequest(com.genexus.servlet.http.IHttpServletRequest) ByteArrayOutputStream(java.io.ByteArrayOutputStream) HttpContext(com.genexus.internet.HttpContext) HttpContextNull(com.genexus.internet.HttpContextNull)

Aggregations

HttpContext (com.genexus.internet.HttpContext)2 HttpContextNull (com.genexus.internet.HttpContextNull)2 ModelContext (com.genexus.ModelContext)1 IExtensionModelContext (com.genexus.common.interfaces.IExtensionModelContext)1 HttpRequest (com.genexus.internet.HttpRequest)1 IHttpServletRequest (com.genexus.servlet.http.IHttpServletRequest)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1