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


Java RedirectResolution类代码示例

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


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

示例1: save

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
public Resolution save() {
    ComponentManager cm = new ComponentManager();

    // Save any changes to existing components (and create new ones)
    for (Component component : components) {
        cm.saveOrUpdate(component);
    }

    // Then, if the user checked anyone off to be deleted, delete them
    if (deleteIds != null) {
        for (int id : deleteIds) {
            cm.deleteComponent(id);
        }
    }

    return new RedirectResolution(getClass());
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:18,代码来源:AdministerComponentsActionBean.java

示例2: saveChanges

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@HandlesEvent("Save")
public Resolution saveChanges() {
    PersonManager pm = new PersonManager();

    // Save any changes to existing people (and create new ones)
    for (Person person : people) {
        pm.saveOrUpdate(person);
    }

    // Then, if the user checked anyone off to be deleted, delete them
    if (deleteIds != null) {
        for (int id : deleteIds) {
            pm.deletePerson(id);
        }
    }

    return new RedirectResolution(getClass());
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:19,代码来源:AdministerPeopleActionBean.java

示例3: save

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
/** Saves (or updates) a bug, and then returns the user to the bug list. */
public Resolution save() throws IOException {
    BugManager bm = new BugManager();

    Bug bug = getBug();
    if (this.newAttachment != null) {
        Attachment attachment = new Attachment();
        attachment.setName(this.newAttachment.getFileName());
        attachment.setSize(this.newAttachment.getSize());
        attachment.setContentType(this.newAttachment.getContentType());

        byte[] data = new byte[(int) this.newAttachment.getSize()];
        InputStream in = this.newAttachment.getInputStream();
        in.read(data);
        attachment.setData(data);
        bug.addAttachment(attachment);
    }

    // Set the open date for new bugs
    if (bug.getOpenDate() == null)
        bug.setOpenDate(new Date());

    bm.saveOrUpdate(bug);

    return new RedirectResolution(BugListActionBean.class);
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:27,代码来源:SingleBugActionBean.java

示例4: intercept

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
public Resolution intercept(ExecutionContext context) throws Exception {
    HttpServletRequest request = context.getActionBeanContext().getRequest();
    String url = HttpUtil.getRequestedPath(request);
    if (request.getQueryString() != null)
        url = url + '?' + request.getQueryString();
    log.debug("Intercepting request: ", url);

    Resolution resolution = context.proceed();

    // A null resolution here indicates a normal flow to the next stage
    boolean authed = ((BugzookyActionBeanContext) context.getActionBeanContext()).getUser() != null;
    if (!authed && resolution == null) {
        ActionBean bean = context.getActionBean();
        if (bean != null && !bean.getClass().isAnnotationPresent(Public.class)) {
            log.warn("Thwarted attempted to access ", bean.getClass().getSimpleName());
            return new RedirectResolution(LoginActionBean.class).addParameter("targetUrl", url);
        }
    }

    log.debug("Allowing public access to ", context.getActionBean().getClass().getSimpleName());
    return resolution;
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:23,代码来源:SecurityInterceptor.java

示例5: signon

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
public Resolution signon() {

    account = accountService.getAccount(getUsername(), getPassword());
   
    if (account == null) {
      String value = "Invalid username or password.  Signon failed.";
      setMessage(value);
      clear();
      return new ForwardResolution(SIGNON);
    } else {
      account.setPassword(null);
      myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
      authenticated = true;
      HttpSession s = context.getRequest().getSession();
      // this bean is already registered as /actions/Account.action
      s.setAttribute("accountBean", this);
      return new RedirectResolution(CatalogActionBean.class);
    }
  }
 
开发者ID:coderliux,项目名称:Jpetstore,代码行数:20,代码来源:AccountActionBean.java

示例6: addRoot

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@HandlesEvent("addRoot")
public Resolution addRoot() throws FedoraClientException, Exception {
    Gui userGui = this.getContext().getGui();
    User user = this.getContext().getUser();

    if (root != null) {
        logger.info("Adding root = " + root);
        Osa.fedoraManager.createRootObject(root, userGui, user);

    } else if (currentOrganization != null) {
        logger.info("Adding root for organization " + root);
        Osa.fedoraManager.createRootObject(currentOrganization, userGui, user);
    }

    return new RedirectResolution(ADMIN);
}
 
开发者ID:mikkeliamk,项目名称:osa,代码行数:17,代码来源:IngestAction.java

示例7: deleteRoot

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@HandlesEvent("deleteRoot")
public Resolution deleteRoot() throws FedoraClientException, Exception {
    String organization = "";
    if (root != null) {
        organization = root.toUpperCase();

    } else if (currentOrganization != null) {
        organization = currentOrganization.toUpperCase();
    }

    if (organization != "") {
        logger.info("Deleting root object from organization: " + organization);
        Osa.fedoraManager.deleteRootObject(organization);
    }
    return new RedirectResolution(ADMIN);
}
 
开发者ID:mikkeliamk,项目名称:osa,代码行数:17,代码来源:IngestAction.java

示例8: deleteAllObjects

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@HandlesEvent("delAllFromOrg")
public Resolution deleteAllObjects() throws FedoraClientException, Exception {
    String organization = "";
    if (root != null) {
        organization = root.toUpperCase();

    } else if (currentOrganization != null) {
        organization = currentOrganization.toUpperCase();
    }

    if (organization != "") {
        logger.info("Deleting objects from organization: " + organization);
        Osa.fedoraManager.deleteAllobjects(organization);
    }
    return new RedirectResolution(ADMIN);
}
 
开发者ID:mikkeliamk,项目名称:osa,代码行数:17,代码来源:IngestAction.java

示例9: deleteActionObjects

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@HandlesEvent("deleteActionObjects")
public Resolution deleteActionObjects() throws FedoraClientException, Exception {
    String organization = "";

    if (root != null) {
        organization = root.toUpperCase();

    } else if (currentOrganization != null) {
        organization = currentOrganization.toUpperCase();
    }

    if (organization != "") {
        logger.info("Deleting TOL 2008 and Liikearkisto action objects from organization: " + organization);
        Osa.fedoraManager.deleteActionObjects(organization, ":F-tol2008action*");
        Osa.fedoraManager.deleteActionObjects(organization, ":F-lyaction*");
    }
    return new RedirectResolution(ADMIN);
}
 
开发者ID:mikkeliamk,项目名称:osa,代码行数:19,代码来源:IngestAction.java

示例10: addMetaDataFiles

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@HandlesEvent("addMetaDataFiles")
public Resolution addMetaDataFiles() {
    
    allCaptureElements = fedoraBeans.get(0).getDataStream(FedoraBean.DATASTREAM_CAPTURE).getMetaDataElements();
    watchedFiles = (Vector<String>) this.getContext().getRequest().getSession().getAttribute("watchedFiles");
    boolean massEdit = watchedFiles.size() > 1 ? true:false;
    
    for (int i = 0; i < watchedFiles.size(); i++) {
        LinkedHashMap<String, MetaDataElement> map = new LinkedHashMap<String, MetaDataElement>();
        for (Entry<String, MetaDataElement> entry : allCaptureElements.entrySet()) {
            // Do not store empty fields
            if (!entry.getValue().isEmpty()) {
                map.put(entry.getKey(), entry.getValue());
            }
        }
        
        Osa.dbManager.get("mongo").addMetadataFile(this.getContext().getUser(), watchedFiles.get(i), map, massEdit);
    }

    this.getContext().getRequest().getSession().removeAttribute("watchedFiles");
    return new RedirectResolution("/workspace.jsp").addParameter("tab", "ingest-auto");
}
 
开发者ID:mikkeliamk,项目名称:osa,代码行数:23,代码来源:IngestAction.java

示例11: intercept

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@Override
public Resolution intercept(ExecutionContext context) throws Exception {
    HttpServletRequest request = context.getActionBeanContext().getRequest();
    String url = HttpUtil.getRequestedPath(request);
    if (request.getQueryString() != null) {
        url = url + '?' + request.getQueryString();
    }
    log.debug("Intercepting request: ", url);

    Resolution resolution = context.proceed();

    // A null resolution here indicates a normal flow to the next stage
    boolean authed = ((MobileActionBeanContext) context.getActionBeanContext()).getCustomer() != null;
    if (!authed && resolution == null) {
        ActionBean bean = context.getActionBean();
        if (bean != null && !bean.getClass().isAnnotationPresent(Public.class)) {
            log.warn("Thwarted attempted to access ", bean.getClass().getSimpleName());
            return new RedirectResolution(CustomerAuthorizationActionBean.class).addParameter("targetUrl", url);
        }
    }

    log.debug("Allowing public access to ", context.getActionBean().getClass().getSimpleName());
    return resolution;
}
 
开发者ID:nordpos-mobi,项目名称:online-retail,代码行数:25,代码来源:SecurityInterceptor.java

示例12: intercept

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@Override
public Resolution intercept(ExecutionContext context) throws Exception {
    HttpServletRequest request = context.getActionBeanContext().getRequest();
    String url = HttpUtil.getRequestedPath(request);
    if (request.getQueryString() != null) {
        url = url + '?' + request.getQueryString();
    }
    log.debug("Intercepting request: ", url);

    Resolution resolution = context.proceed();

    // A null resolution here indicates a normal flow to the next stage
    boolean authed = ((MobileActionBeanContext) context.getActionBeanContext()).getUser() != null;
    if (!authed && resolution == null) {
        ActionBean bean = context.getActionBean();
        if (bean != null && !bean.getClass().isAnnotationPresent(Public.class)) {
            log.warn("Thwarted attempted to access ", bean.getClass().getSimpleName());
            return new RedirectResolution(UserAuthorizationActionBean.class).addParameter("targetUrl", url);
        }
    }

    log.debug("Allowing public access to ", context.getActionBean().getClass().getSimpleName());
    return resolution;
}
 
开发者ID:nordpos-mobi,项目名称:restaurant-service,代码行数:25,代码来源:SecurityInterceptor.java

示例13: signon

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
public Resolution signon() {

        account = accountService.getAccount(getUsername(), getPassword());

        if (account == null) {
            final String value = "Invalid username or password.  Signon failed.";
            setMessage(value);
            clear();
            return new ForwardResolution(SIGNON);
        } else {
            account.setPassword(null);
            myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
            authenticated = true;
            final HttpSession s = context.getRequest().getSession();
            // this bean is already registered as /actions/Account.action
            s.setAttribute("accountBean", this);
            return new RedirectResolution(CatalogActionBean.class);
        }
    }
 
开发者ID:tomitribe,项目名称:tomcat_to_tomee,代码行数:20,代码来源:AccountActionBean.java

示例14: mergeReport

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@Button(list = "crud-search", key = "mergeReport", order = 3, icon = Button.ICON_EDIT + Button.ICON_WRENCH, group = "crud")
@RequiresPermissions(permissions = PERMISSION_EDIT)
public Resolution mergeReport() {
	// TODO 取选择的ids 创建一张新的报表,名称TODO,跳转到 编辑页面
	if (selection == null || selection.length == 0) {
		SessionMessages.addWarningMessage(ElementsThreadLocals.getText("no.object.was.selected"));
		return new RedirectResolution(returnUrl, false);
	}

	if (selection.length == 1) {
		pk = selection[0].split("/");
		String url = context.getActionPath() + "/" + getPkForUrl(pk);
		url = appendSearchStringParamIfNecessary(url);
		return new RedirectResolution(url).addParameter("returnUrl", returnUrl).addParameter("edit");
	}

	setupForm(Mode.BULK_EDIT);

	return new ForwardResolution("/m/crud/bulk-edit.jsp");

}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:22,代码来源:CrudAction4ReportDef.java

示例15: exportSearchExcel

import net.sourceforge.stripes.action.RedirectResolution; //导入依赖的package包/类
@Button(list = "crud-search", key = "commons.exportExcel", order = 9, group = "crud", icon = " icon-th ")
public Resolution exportSearchExcel() {
	try {
		TempFileService fileService = TempFileService.getInstance();
		TempFile tempFile = fileService.newTempFile("application/vnd.ms-excel", crudConfiguration.getSearchTitle()
				+ ".xls");
		OutputStream outputStream = tempFile.getOutputStream();
		exportSearchExcel(outputStream);
		outputStream.flush();
		outputStream.close();
		return fileService.stream(tempFile);
	} catch (Exception e) {
		logger.error("Excel export failed", e);
		SessionMessages.addErrorMessage(getMessage("commons.export.failed"));
		// return new RedirectResolution(getDispatch().getOriginalPath());
		return new RedirectResolution(getReturnUrl());
	}
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:19,代码来源:CrudAction4ItsProject.java


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