Package org.apache.wicket

Examples of org.apache.wicket.Application


         * Method to test the content type on null or unknown. if this is the case the content type
         * is tried to be resolved throw the servlet context
         */
        private void testContentType() {
            if (contentType == null || contentType.indexOf("unknown") != -1) {
                Application application = Application.get();
                if (application instanceof WebApplication) {
                    // TODO Post 1.2: General: For non webapplication another method
                    // should be implemented (getMimeType on application?)
                    contentType = ((WebApplication) application).getServletContext().getMimeType(
                            url.getFile());
View Full Code Here


            translationModel = new LoadableDetachableModel() {
                private static final long serialVersionUID = 1L;

                @Override
                protected Object load() {
                    final Application application = getApplication();
                    TranslateBean translateState = (TranslateBean) application
                            .getMetaData(TRANSLATION_BEAN);
                    return translateState;
                }
            };
        }
View Full Code Here

   * Covariant override for easy getting the current {@link WebApplication} without having to cast
   * it.
   */
  public static WebApplication get()
  {
    Application application = Application.get();

    if (application instanceof WebApplication == false)
    {
      throw new WicketRuntimeException(
        "The application attached to the current thread is not a " +
View Full Code Here

    IKey key = getRegistryKey();
    IWebSocketConnection connection = connectionRegistry.getConnection(application, sessionId, key);

    if (connection != null && connection.isOpen())
    {
      Application oldApplication = ThreadContext.getApplication();
      Session oldSession = ThreadContext.getSession();
      RequestCycle oldRequestCycle = ThreadContext.getRequestCycle();

      WebSocketResponse webResponse = new WebSocketResponse(connection);
      try
View Full Code Here

    IKey key = getRegistryKey();
    IWebSocketConnection connection = connectionRegistry.getConnection(application, sessionId, key);

    if (connection != null && connection.isOpen())
    {
      Application oldApplication = ThreadContext.getApplication();
      Session oldSession = ThreadContext.getSession();
      RequestCycle oldRequestCycle = ThreadContext.getRequestCycle();

      WebSocketResponse webResponse = new WebSocketResponse(connection);
      try
View Full Code Here

    for (ITargetRespondListener listener : respondListeners)
    {
      listener.onTargetRespond(this);
    }

    final Application app = Application.get();

    page.send(app, Broadcast.BREADTH, this);

    // Determine encoding
    final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding();

    // Set content type based on markup type for page
    response.setContentType("text/xml; charset=" + encoding);

    // Make sure it is not cached by a client
View Full Code Here

    super.onBeforeRender();

    // Set default for before/after link text
    if (beforeDisabledLink == null)
    {
      final Application app = getApplication();
      beforeDisabledLink = app.getMarkupSettings().getDefaultBeforeDisabledLink();
      afterDisabledLink = app.getMarkupSettings().getDefaultAfterDisabledLink();
    }
  }
View Full Code Here

      {
        ois = newObjectInputStream(in);
        String applicationName = (String)ois.readObject();
        if (applicationName != null && !Application.exists())
        {
          Application app = Application.get(applicationName);
          if (app != null)
          {
            ThreadContext.setApplication(app);
          }
        }
View Full Code Here

      try
      {
        // Can the application always be taken??
        // Should be if serialization happened in thread with application set
        // (WICKET-2195)
        Application application = Application.get();
        IApplicationSettings applicationSettings = application.getApplicationSettings();
        IClassResolver classResolver = applicationSettings.getClassResolver();

        candidate = classResolver.resolveClass(className);
        if (candidate == null)
        {
View Full Code Here

   * Covariant override for easy getting the current {@link WebApplication} without having to cast
   * it.
   */
  public static WebApplication get()
  {
    Application application = Application.get();

    if (application instanceof WebApplication == false)
    {
      throw new WicketRuntimeException(
        "The application attached to the current thread is not a " +
View Full Code Here

TOP

Related Classes of org.apache.wicket.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.