当前位置: 首页>>代码示例>>Java>>正文


Java Response类代码示例

本文整理汇总了Java中org.apache.wicket.request.Response的典型用法代码示例。如果您正苦于以下问题:Java Response类的具体用法?Java Response怎么用?Java Response使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Response类属于org.apache.wicket.request包,在下文中一共展示了Response类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterRender

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public void afterRender(Component component) {
    FormComponent<?> fc = (FormComponent<?>) component;
    Response r = component.getResponse();

    r.write("</span>");

    if (fc.hasFeedbackMessage()) {
        r.write("<span class=\"feedbackPanelTextField\">");

        IFeedbackMessageFilter filter = new ComponentFeedbackMessageFilter(component);

        for (FeedbackMessage message : fc.getFeedbackMessages().messages(filter)) {
            r.write("<span class=\"feedbackPanel");
            r.write(message.getLevelAsString().toUpperCase());
            r.write("\">");
            r.write(Strings.escapeMarkup(message.getMessage().toString()));
        }

        r.write("</span>");
    }
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:23,代码来源:FieldFeedbackDecorator.java

示例2: afterRender

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public void afterRender(final Component component) {
	super.afterRender(component);
	final Response r = component.getResponse();
	
	final String text = ResourceBundleLocator.getLabelModel(this.getClass(), "ajax.loading.text").getObject();

	r.write("<span style=\"display:none;\" class=\"");
	r.write(getSpanClass());
	r.write("\" ");
	r.write("id=\"");
	r.write(getMarkupId());
	r.write("\">");
	r.write("<img src=\"");
	r.write(getIndicatorUrl());
	r.write("\" alt=\"\" class=\"spinner\"/>");
	r.write("<span class=\"loading blink\">");
	r.write(text);
	r.write("</span>");
	r.write("</span>");
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:22,代码来源:AjaxIndicatorAppender.java

示例3: set

import org.apache.wicket.request.Response; //导入依赖的package包/类
public void set(final Request request, final Response response, final Map<String, List<String>> prefs) {
    Map<String, String> current = new HashMap<>();

    String prefString = COOKIE_UTILS.load(COOKIE_NAME);
    if (prefString != null) {
        current.putAll(getPrefs(new String(Base64.getDecoder().decode(prefString.getBytes()))));
    }

    // after retrieved previous setting in order to overwrite the key ...
    prefs.entrySet().forEach(entry -> {
        current.put(entry.getKey(), StringUtils.join(entry.getValue(), ";"));
    });

    try {
        COOKIE_UTILS.save(COOKIE_NAME, Base64.getEncoder().encodeToString(setPrefs(current).getBytes()));
    } catch (IOException e) {
        LOG.error("Could not save {} info: {}", getClass().getSimpleName(), current, e);
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:20,代码来源:PreferenceManager.java

示例4: onComponentTagBody

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
    super.onComponentTagBody(markupStream, openTag);

    if (addFakeInputFields) {
    	final Response response = getResponse();
    	response.write("<input style=\"display:none\">\n" +
            "<input type=\"password\" style=\"display:none\">");
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:11,代码来源:Form.java

示例5: renderChoice

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
protected void renderChoice(ItemDefinition<?> object, Response response, String criteria) {
	String textValue = getTextValue(object);
	textValue = Strings.escapeMarkup(textValue).toString();
	response.write(textValue);
	
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:AutoCompleteItemDefinitionRenderer.java

示例6: newSession

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public Session newSession(final Request request, final Response response) {
    if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
        return super.newSession(request, response);
    } 
    
    // else demo mode
    final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
    final org.apache.wicket.util.string.StringValue user = request.getRequestParameters().getParameterValue("user");
    final org.apache.wicket.util.string.StringValue password = request.getRequestParameters().getParameterValue("pass");
    s.signIn(user.toString(), password.toString());
    return s;
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:14,代码来源:EcpCrmApplication.java

示例7: newSession

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public Session newSession(Request request, Response response) {
	try {
		return webSessionClassRef.get().getDeclaredConstructor(Request.class).newInstance(request); // NOSONAR
	} catch (RuntimeException | InstantiationException | IllegalAccessException
			| InvocationTargetException | NoSuchMethodException e) {
		throw new WicketRuntimeException("Unable to instantiate web session " +
			webSessionClassRef.get(), e);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:11,代码来源:CoreWicketAuthenticatedApplication.java

示例8: beforeRender

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public void beforeRender(Component component) {
	Response response = component.getResponse();
	response.write("<!--");
	if (StringUtils.hasText(condition)) {
		response.write(
				new StringBuilder("[if ").append(condition).append("]>").toString()
		);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:11,代码来源:CommentOutModifier.java

示例9: afterRender

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public void afterRender(Component component) {
	Response response = component.getResponse();
	if (StringUtils.hasText(condition)) {
		response.write("<![endif]");
	}
	response.write("-->");
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:9,代码来源:CommentOutModifier.java

示例10: set

import org.apache.wicket.request.Response; //导入依赖的package包/类
public void set(final Request request, final Response response,
        final Map<String, List<String>> prefs) {

    Cookie prefCookie =
            ((WebRequest) request).getCookie(Constants.PREFS_COOKIE_NAME);

    final Map<String, String> current = new HashMap<String, String>();

    if (prefCookie == null || !StringUtils.hasText(prefCookie.getValue())) {
        prefCookie = new Cookie(Constants.PREFS_COOKIE_NAME, null);
    } else {
        current.putAll(getPrefs(new String(Base64.decodeBase64(
                prefCookie.getValue().getBytes()))));
    }

    // after retrieved previous setting in order to overwrite the key ...
    for (Entry<String, List<String>> entry : prefs.entrySet()) {
        current.put(entry.getKey(), StringUtils.collectionToDelimitedString(
                entry.getValue(), ";"));
    }

    try {
        prefCookie.setValue(new String(
                Base64.encodeBase64(setPrefs(current).getBytes())));
    } catch (IOException e) {
        LOG.error("Could not set preferences " + current, e);
    }

    prefCookie.setMaxAge(ONE_YEAR_TIME);
    ((WebResponse) response).addCookie(prefCookie);
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:32,代码来源:PreferenceManager.java

示例11: getContainerResponse

import org.apache.wicket.request.Response; //导入依赖的package包/类
public static HttpServletResponse getContainerResponse() {
    final RequestCycle requestCycle = RequestCycle.get();
    if (requestCycle == null) {
        return null;
    }
    final Response response = requestCycle.getResponse();
    if (response == null) {
        return null;
    }
    return (HttpServletResponse) response.getContainerResponse();
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:12,代码来源:RequestCycles.java

示例12: newSession

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
public Session newSession(final Request request, final Response response) {
    if(!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
        return super.newSession(request, response);
    } 
    
    // else demo mode
    final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
    IRequestParameters requestParameters = request.getRequestParameters();
    final org.apache.wicket.util.string.StringValue user = requestParameters.getParameterValue("user");
    final org.apache.wicket.util.string.StringValue password = requestParameters.getParameterValue("pass");
    s.signIn(user.toString(), password.toString());
    return s;
}
 
开发者ID:TesisTarjetasMejorar,项目名称:TarjetasISIS,代码行数:15,代码来源:SimpleApplication.java

示例13: newSession

import org.apache.wicket.request.Response; //导入依赖的package包/类
/**
 * Action at the session start :
 *  * Add the User provided by GASSI in the application session
 *  * Add the corresponding PaaS user into session
 *  * Add demo data
 */
@Override
public Session newSession(Request request, Response response) {
    if (logger.isDebugEnabled()) {
        logger.debug("Created a new AcpSession");
    }
    WicketSession session = new WicketSession(request);
    // english is default language
    session.setLocale(Locale.US);
    return session;
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:17,代码来源:WicketApplication.java

示例14: beforeRender

import org.apache.wicket.request.Response; //导入依赖的package包/类
public void beforeRender(Component component) {
    FormComponent<?> fc = (FormComponent<?>) component;
    Response r = component.getResponse();

    String label = (fc.getLabel() != null) ? fc.getLabel().getObject(): null;
    if (label != null) {
        r.write("<span class=\"param\">");
        r.write("<label for=\"");
        r.write(fc.getMarkupId());
        r.write("\"");
        if (!fc.isValid()) {
            r.write(" class=\"error\"");
        }
        r.write(" />");
        r.write(Strings.escapeMarkup(label));
        r.write("</label>");
        r.write("</span>");

        NotNull clazz;

        try {
            Field field = fc.getForm().getModelObject().getClass().getDeclaredField(fc.getInputName());
            clazz = field.getAnnotation(NotNull.class);
        } catch (NoSuchFieldException e) {
            clazz = null;
        }

        if (clazz != null || fc.isRequired()) {
            r.write("<span class=\"required\" title=\"");
            r.write(fc.getString("portal.error.required.field.title"));
            r.write("\">");
            r.write(fc.getString("portal.required.field")+"</span>");
        } else {
            r.write("<span class=\"notrequired\"></span>");
        }
        r.write("<span class=\"value\">");

    }
    super.beforeRender(component);
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:41,代码来源:FieldFeedbackDecorator.java

示例15: newSession

import org.apache.wicket.request.Response; //导入依赖的package包/类
@Override
 public Session newSession(Request request, Response response) {
     PaasTestSession session = new PaasTestSession(request, useAuthentication);
         // english is default language
     session.setLocale(Locale.US);
     return session;
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:8,代码来源:PaasTestApplication.java


注:本文中的org.apache.wicket.request.Response类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。