當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。