Examples of RedirectException


Examples of anvil.server.RedirectException

      if (searchResult != null && searchResult.length > 0) {
        context.setCitizen(searchResult[0]);
        context.log().info("web: ipauthentication ok");
       
        if (context.getOriginalPathinfo().equals(loginPath)) {
          throw new RedirectException(context.getSession().getId(), forwardPath);
        }
        return true;
      }

      String username = request.getParameter("webauth.username");
      String password = request.getParameter("webauth.password");
     
      context.getSession().removeAttribute("webauth.failedUser");
     
      if (username != null && password != null && username.length() > 0) {
        citizen = realm.getCitizen(username);
        context.log().info("username: '"+username+"' citizen: "+citizen);
        if (citizen != null && citizen.verifyCredentials(password)) {
          context.setCitizen(citizen);
          context.log().info("web: authentication ok");
         
          if (context.getOriginalPathinfo().equals(loginPath)) {
            throw new RedirectException(context.getSession().getId(), forwardPath);
          }
          return true;
        } else {
          context.log().info("web: no user found or wrong pass");
          context.getSession().setAttribute("webauth.failedUser", username);
View Full Code Here

Examples of ca.simplegames.micro.RedirectException

            }
            // return bsfManager.lookupBean(Globals.SCRIPT_CONTROLLER_RESPONSE);
        } catch (BSFException e) {
            // check is stupid BSF is eating all the exceptions again >:/
            if (e.getMessage() != null && e.getMessage().contains(RedirectException.class.getName())) {
                throw new RedirectException(); // stupid ...
            } else {
                throw new ControllerException(
                        String.format("error while executing: %s; details: %s", controllerName, e.getMessage()));
            }
        }
View Full Code Here

Examples of com.adito.core.RedirectException

     */
    protected AbstractWizardSequence createWizardSequence(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ActionMessages msgs = new ActionMessages();
        msgs.add(Constants.REQ_ATTR_WARNINGS, new ActionMessage("installation.selectCertificateSource.warning.noWizardSequence"));
        addWarnings(request, msgs);
        throw new RedirectException(mapping.findForward("restartInstallWizard"), "Cannot create sequence on this page.");
    }
View Full Code Here

Examples of com.adito.core.RedirectException

     * @throws Exception if object cannot be create or this page is not the
     *         first in a sequence
     */
    protected AbstractWizardSequence createWizardSequence(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                                          HttpServletResponse response) throws Exception {
        throw new RedirectException(cancel(mapping, form, request, response), "Cannot create sequence on this page.");
    }
View Full Code Here

Examples of com.ecyrd.jspwiki.filters.RedirectException

        String progressId = req.getParameter( "progressid" );

        // Check that we have a file upload request
        if( !ServletFileUpload.isMultipartContent(req) )
        {
            throw new RedirectException( "Not a file upload", errorPage );
        }
       
        try
        {
            FileItemFactory factory = new DiskFileItemFactory();
           
            // Create the context _before_ Multipart operations, otherwise
            // strict servlet containers may fail when setting encoding.
            WikiContext context = m_engine.createContext( req, WikiContext.ATTACH );

            UploadListener pl = new UploadListener();

            m_engine.getProgressManager().startProgress( pl, progressId );

            ServletFileUpload upload = new ServletFileUpload(factory);
            upload.setHeaderEncoding("UTF-8");
            if( !context.hasAdminPermissions() )
            {
                upload.setFileSizeMax( m_maxSize );
            }
            upload.setProgressListener( pl );
            List<FileItem> items = upload.parseRequest( req );
           
            String   wikipage   = null;
            String   changeNote = null;
            FileItem actualFile = null;
           
            for( FileItem item : items )
            {
                if( item.isFormField() )
                {
                    if( item.getFieldName().equals("page") )
                    {
                        //
                        // FIXME: Kludge alert.  We must end up with the parent page name,
                        //        if this is an upload of a new revision
                        //

                        wikipage = item.getString("UTF-8");
                        int x = wikipage.indexOf("/");

                        if( x != -1 ) wikipage = wikipage.substring(0,x);
                    }
                    else if( item.getFieldName().equals("changenote") )
                    {
                        changeNote = item.getString("UTF-8");
                        if (changeNote != null)
                        {
                            changeNote = TextUtil.replaceEntities(changeNote);
                        }
                    }
                    else if( item.getFieldName().equals( "nextpage" ) )
                    {
                        nextPage = validateNextPage( item.getString("UTF-8"), errorPage );
                    }
                }
                else
                {
                    actualFile = item;
                }
            }

            if( actualFile == null )
                throw new RedirectException( "Broken file upload", errorPage );
           
            //
            // FIXME: Unfortunately, with Apache fileupload we will get the form fields in
            //        order.  This means that we have to gather all the metadata from the
            //        request prior to actually touching the uploaded file itself.  This
View Full Code Here

Examples of com.ecyrd.jspwiki.filters.RedirectException

        }
        catch( WikiException e )
        {
            // this is a kludge, the exception that is caught here contains the i18n key
            // here we have the context available, so we can internationalize it properly :
            throw new RedirectException(context.getBundle( InternationalizationManager.CORE_BUNDLE ).getString( e.getMessage() ), errorPage );
        }
       
        //
        //  FIXME: This has the unfortunate side effect that it will receive the
        //  contents.  But we can't figure out the page to redirect to
        //  before we receive the file, due to the stupid constructor of MultipartRequest.
        //

        if( !context.hasAdminPermissions() )
        {
            if( contentLength > m_maxSize )
            {
                // FIXME: Does not delete the received files.
                throw new RedirectException( "File exceeds maximum size ("+m_maxSize+" bytes)",
                                             errorPage );
            }

            if( !isTypeAllowed(filename) )
            {
                throw new RedirectException( "Files of this type may not be uploaded to this wiki",
                                             errorPage );
            }
        }

        Principal user    = context.getCurrentUser();

        AttachmentManager mgr = m_engine.getAttachmentManager();

        log.debug("file="+filename);

        if( data == null )
        {
            log.error("File could not be opened.");

            throw new RedirectException("File could not be opened.",
                                        errorPage);
        }

        //
        //  Check whether we already have this kind of a page.
        //  If the "page" parameter already defines an attachment
        //  name for an update, then we just use that file.
        //  Otherwise we create a new attachment, and use the
        //  filename given.  Incidentally, this will also mean
        //  that if the user uploads a file with the exact
        //  same name than some other previous attachment,
        //  then that attachment gains a new version.
        //

        Attachment att = mgr.getAttachmentInfo( context.getPage().getName() );

        if( att == null )
        {
            att = new Attachment( m_engine, parentPage, filename );
            created = true;
        }
        att.setSize( contentLength );

        //
        //  Check if we're allowed to do this?
        //

        Permission permission = PermissionFactory.getPagePermission( att, "upload" );
        if( m_engine.getAuthorizationManager().checkPermission( context.getWikiSession(),
                                                                permission ) )
        {
            if( user != null )
            {
                att.setAuthor( user.getName() );
            }

            if( changenote != null && changenote.length() > 0 )
            {
                att.setAttribute( WikiPage.CHANGENOTE, changenote );
            }
           
            try {
            m_engine.getAttachmentManager().storeAttachment( att, data );
            } catch (ProviderException pe) {
                // this is a kludge, the exception that is caught here contains the i18n key
                // here we have the context available, so we can internationalize it properly :
                throw new ProviderException( context.getBundle( InternationalizationManager.CORE_BUNDLE ).getString( pe.getMessage() ) );
            }

            log.info( "User " + user + " uploaded attachment to " + parentPage +
                      " called "+filename+", size " + att.getSize() );
        }
        else
        {
            throw new RedirectException("No permission to upload a file",
                                        errorPage);
        }

        return created;
    }
View Full Code Here

Examples of com.samskivert.servlet.RedirectException

            String eurl = RequestUtils.getLocationEncoded(req);
            String target = _loginURL.replace("%R", eurl);
            if (USERMGR_DEBUG) {
                log.info("No user found in require, redirecting", "to", target);
            }
            throw new RedirectException(target);
        }
        return user;
    }
View Full Code Here

Examples of com.sun.appserv.management.client.RedirectException

        // 1. Validity of new redirect URL itself
        // 2. if redirection is not downgrading security unintentionally
        // If it is invalid rethrow the RedirectException to CLI
        // for further processing - logging and user communciation
        if (isRedirectionInvalid(redirect, connection)) {
            throw new RedirectException(ex.getRedirectURLStr(),
                "Invalid Redirect. " +
                "Security cannot be downgraded. Please try with --secure=false");
        }
        connection = getConnectionWithRedirectedURL(connection, redirect);
    }
View Full Code Here

Examples of com.sun.appserv.management.client.RedirectException

            if (isRedirectionEnabled) {
                int respCode = ((HttpURLConnection)mConnection).getResponseCode();
                if (respCode == HttpURLConnection.HTTP_MOVED_TEMP) {
                    String redirectUrl =
                        mConnection.getHeaderFields().get("Location").get(0);
                    throw new RedirectException(redirectUrl,
                        "HTTP connection failed: 302 Moved Temporarily");
                }
            }
            InputStream in = mConnection.getInputStream();
            mObjectInStream = new ObjectInputStream(in);
View Full Code Here

Examples of freenet.clients.http.RedirectException

      if(!mFreetalk.wotConnected())
        return new WoTIsMissingPage(webInterface, req, mFreetalk.wotOutdated(), l10n());
      // TODO: Secure log out against malicious links (by using POST with form password instead of GET)
      // At the moment it is just a link and unsecured i.e. no form password check etc.
      mSessionManager.deleteSession(context);
      throw new RedirectException(logIn);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.