Java 类org.springframework.web.servlet.view.AbstractUrlBasedView 实例源码

项目:tmply    文件:WebMvcConfig.java   
private ViewResolver getViewResolver()
{
    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver()
    {
        @Override
        protected AbstractUrlBasedView buildView(String viewName) throws Exception
        {
            String suffix = getSuffix();
            if (suffix != null && suffix.length() > 0 && viewName.endsWith(suffix))
            {
                viewName = viewName.substring(0, viewName.length() - suffix.length());
            }

            return super.buildView(viewName);
        }
    };
    viewResolver.setPrefix("/");
    viewResolver.setSuffix("");
    return viewResolver;
}
项目:leopard    文件:DownloadView.java   
public DownloadView(final InputStream input, final String name) {
    AbstractUrlBasedView view = new AbstractUrlBasedView() {
        @Override
        protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
            String name2 = URLEncoder.encode(name, "UTF-8");
            response.setContentType("application/force-download");
            response.addHeader("Content-Disposition", "attachment;filename=" + name2);
            byte[] bytes = new byte[1024];
            ServletOutputStream out = response.getOutputStream();
            int readLength = 0;
            while ((readLength = input.read(bytes)) != -1) {
                out.write(bytes, 0, readLength);
            }
            // TODO ahai 释放资源
            input.close();
            out.flush();
            out.close();
        }
    };
    super.setView(view);
}
项目:java-template-simple    文件:VelocityLayoutViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityLayoutView view = (VelocityLayoutView)super.buildView(viewName);
    if(this.layoutUrl != null){
        view.setLayoutUrl(this.layoutUrl);
    }
    if(this.layoutKey != null){
        view.setLayoutKey(this.layoutKey);
    }
    if(this.screenContentKey != null){
        view.setScreenContentKey(this.screenContentKey);
    }
    if(this.toolboxConfigResource != null){
        ((VelocityToolboxView)view).setToolboxConfigResource(this.toolboxConfigResource);
    }
    return view;
}
项目:jresplus    文件:FixedVelocityLayoutViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    FixedVelocityLayoutView view = (FixedVelocityLayoutView) super
            .buildView(viewName);
    view.setContentType(this.getContentType());
    view.setEncoding(this.templateEncoding);
    if (this.velocityEngine != null) {
        view.setVelocityEngine(this.velocityEngine);
    }
    if (this.layoutUrl != null) {
        view.setLayoutUrl(this.layoutUrl);
    }
    if (this.layoutKey != null) {
        view.setLayoutKey(this.layoutKey);
    }
    if (this.screenContentKey != null) {
        view.setScreenContentKey(this.screenContentKey);
    }
    view.setScreenPrefix(this.getPrefix());
    view.setLayoutTemplateCache(this.layoutTemplateCache);
    return view;
}
项目:sharding    文件:VelocityViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityView view = VelocityView.class.cast(super.buildView(viewName));
    view.setViewName(viewName);

    view.setContentType(getContentType());
    view.setEncoding(charset);

    view.setTemplates(templates);
    view.setScreen(screen);
    view.setLayout(layout);
    view.setSuffix(getSuffix());
    view.setScreenTemplateKey(screenTemplateKey);
    view.setDefaultLayoutTemplate(defaultLayoutTemplate);

    return view;
}
项目:fenixedu-academic    文件:StudentGroupController.java   
@RequestMapping(value = "/editStudentGroupAttends/{studentGroup}", method = RequestMethod.POST)
public AbstractUrlBasedView editStudentGroupAttends(Model model, @PathVariable Grouping grouping,
        @ModelAttribute("attends") @Validated AttendsBean attendsBean, @PathVariable StudentGroup studentGroup,
        BindingResult bindingResult) {

    Map<String, Boolean> studentsToRemove = attendsBean.getRemoveStudent();
    Map<String, Boolean> studentsToAdd = attendsBean.getAddStudent();
    if (bindingResult.hasErrors()) {
        model.addAttribute("removeStudent", studentsToRemove);
        model.addAttribute("addStudent", studentsToAdd);
        model.addAttribute("errors", "binding error " + bindingResult.getAllErrors());
        return viewStudentGroup(model, grouping, studentGroup);
    }

    studentGroupService.updateStudentGroupMembers(studentGroup, studentsToRemove, studentsToAdd);
    return new RedirectView("/teacher/" + executionCourse.getExternalId() + "/student-groups/" + grouping.getExternalId()
            + "/viewStudentGroup/" + studentGroup.getExternalId(), true);
}
项目:trimou    文件:TrimouViewResolverTest.java   
/**
 * When the prefix did not set, then viewResolver throws the NullPointerException.
 */
@Test(expected = MustacheException.class)
public void resolvesViewWithoutPrefix() throws Exception {
    //given
    final String viewName = "top-level.mustache";

    //when
    when(engine.getMustache(viewName)).thenReturn(mustache);

    TrimouViewResolver sut = new TrimouViewResolver();
    sut.setServletContext(servletContext);
    sut.afterPropertiesSet();
    sut.setEngine(engine);

    //then
    AbstractUrlBasedView view = sut.buildView(viewName);
    assertThat(view, is(notNullValue()));
}
项目:trimou    文件:TrimouViewResolverTest.java   
/**
 * When not valid prefix did set, then viewResolver throws the MustacheException.
 */
@Test(expected = MustacheException.class)
public void resolvesViewWithNotValidPrefix() throws Exception {
    //given
    final String viewPath = "WEB-INF/views/";
    final String viewName = "top-level.mustache";

    //when
    when(engine.getMustache(viewName)).thenReturn(mustache);

    TrimouViewResolver sut = new TrimouViewResolver();
    sut.setServletContext(servletContext);
    sut.setPrefix(viewPath);
    sut.afterPropertiesSet();
    sut.setEngine(engine);

    //then
    AbstractUrlBasedView view = sut.buildView(viewName);
    assertThat(view, is(notNullValue()));
}
项目:trimou    文件:TrimouViewResolverTest.java   
/**
 * Ensure the prefix is passed on to the template loader
 * and that the template loader is called with a fully
 * resolved view path.
 */
@Test
public void resolvesViewWithPrefix() throws Exception {
    //given
    final String viewPath = "/WEB-INF/views/";
    final String viewName = "hello.mustache";

    //when
    when(engine.getMustache(viewPath + viewName)).thenReturn(mustache);

    TrimouViewResolver sut = new TrimouViewResolver();
    sut.setServletContext(servletContext);
    sut.setPrefix(viewPath);
    sut.afterPropertiesSet();
    sut.setEngine(engine);

    //then
    AbstractUrlBasedView view = sut.buildView(viewName);
    assertThat(view, is(notNullValue()));
}
项目:beetl2.0    文件:BeetlSpringViewResolver.java   
/**
 * 实例化GroupTemplate
 *
 * @param viewName
 * @return
 * @throws Exception
 */
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception
{

    BeetlSpringView beetlView = (BeetlSpringView) super.buildView(viewName);
    beetlView.setGroupTemplate(groupTemplate);
    String suffix = getSuffix();
    //如果配置有后缀,需要重新设定视图
    if(suffix!=null&&suffix.length()!=0){
        if (viewName.contains("#")) {
            String[] split = viewName.split("#");
            if (split.length > 2) {
            throw new Exception("视图名称有误:" + viewName);
            }
            beetlView.setUrl(getPrefix() + split[0] + getSuffix() + "#" + split[1]);
        }
    }
    return beetlView;

}
项目:springboot-shiro-cas-mybatis    文件:Cas30ResponseView.java   
/**
 * Instantiates a new Success.
 * @param view the view
 */
@Autowired
public Success(@Qualifier("cas3JstlSuccessView")
               final AbstractUrlBasedView view) {
    super(view);
    super.setSuccessResponse(true);
}
项目:springboot-shiro-cas-mybatis    文件:RegisteredServiceThemeBasedViewResolver.java   
/**
 * Uses the viewName and the theme associated with the service.
 * being requested and returns the appropriate view.
 * @param viewName the name of the view to be resolved
 * @return a theme-based UrlBasedView
 * @throws Exception an exception
 */
@Override
protected AbstractUrlBasedView buildView(final String viewName) throws Exception {
    final RequestContext requestContext = RequestContextHolder.getRequestContext();
    final WebApplicationService service = WebUtils.getService(requestContext);
    final RegisteredService registeredService = this.servicesManager.findServiceBy(service);

    final String themeId = service != null && registeredService != null
            && registeredService.getAccessStrategy().isServiceAccessAllowed()
            && StringUtils.hasText(registeredService.getTheme()) ? registeredService.getTheme() : defaultThemeId;

    final String themePrefix = String.format("%s/%s/ui/", pathPrefix, themeId);
    LOGGER.debug("Prefix {} set for service {} with theme {}", themePrefix, service, themeId);

    //Build up the view like the base classes do, but we need to forcefully set the prefix for each request.
    //From UrlBasedViewResolver.buildView
    final InternalResourceView view = (InternalResourceView) BeanUtils.instantiateClass(getViewClass());
    view.setUrl(themePrefix + viewName + getSuffix());
    final String contentType = getContentType();
    if (contentType != null) {
        view.setContentType(contentType);
    }
    view.setRequestContextAttribute(getRequestContextAttribute());
    view.setAttributesMap(getAttributesMap());

    //From InternalResourceViewResolver.buildView
    view.setAlwaysInclude(false);
    view.setExposeContextBeansAsAttributes(false);
    view.setPreventDispatchLoop(true);

    LOGGER.debug("View resolved: {}", view.getUrl());

    return view;
}
项目:cas-server-4.2.1    文件:Cas30ResponseView.java   
/**
 * Instantiates a new Success.
 * @param view the view
 */
@Autowired
public Success(@Qualifier("cas3JstlSuccessView")
               final AbstractUrlBasedView view) {
    super(view);
    super.setSuccessResponse(true);
}
项目:spring-velocity-adapter    文件:VelocityLayoutViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName);
    // Use not-null checks to preserve VelocityLayoutView's defaults.
    if (this.layoutUrl != null) {
        view.setLayoutUrl(this.layoutUrl);
    }
    if (this.layoutKey != null) {
        view.setLayoutKey(this.layoutKey);
    }
    if (this.screenContentKey != null) {
        view.setScreenContentKey(this.screenContentKey);
    }
    return view;
}
项目:spring-velocity-adapter    文件:VelocityViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityView view = (VelocityView) super.buildView(viewName);
    view.setDateToolAttribute(this.dateToolAttribute);
    view.setNumberToolAttribute(this.numberToolAttribute);
    if (this.toolboxConfigLocation != null) {
        ((VelocityToolboxView) view).setToolboxConfigLocation(this.toolboxConfigLocation);
    }
    return view;
}
项目:spring4-understanding    文件:XsltViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    XsltView view = (XsltView) super.buildView(viewName);
    view.setSourceKey(this.sourceKey);
    if (this.uriResolver != null) {
        view.setUriResolver(this.uriResolver);
    }
    if (this.errorListener != null) {
        view.setErrorListener(this.errorListener);
    }
    view.setIndent(this.indent);
    view.setOutputProperties(this.outputProperties);
    view.setCacheTemplates(this.cacheTemplates);
    return view;
}
项目:spring4-understanding    文件:JasperReportsViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractJasperReportsView view = (AbstractJasperReportsView) super.buildView(viewName);
    view.setReportDataKey(this.reportDataKey);
    view.setSubReportUrls(this.subReportUrls);
    view.setSubReportDataKeys(this.subReportDataKeys);
    view.setHeaders(this.headers);
    view.setExporterParameters(this.exporterParameters);
    view.setJdbcDataSource(this.jdbcDataSource);
    return view;
}
项目:spring4-understanding    文件:VelocityLayoutViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName);
    // Use not-null checks to preserve VelocityLayoutView's defaults.
    if (this.layoutUrl != null) {
        view.setLayoutUrl(this.layoutUrl);
    }
    if (this.layoutKey != null) {
        view.setLayoutKey(this.layoutKey);
    }
    if (this.screenContentKey != null) {
        view.setScreenContentKey(this.screenContentKey);
    }
    return view;
}
项目:spring4-understanding    文件:VelocityViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityView view = (VelocityView) super.buildView(viewName);
    view.setDateToolAttribute(this.dateToolAttribute);
    view.setNumberToolAttribute(this.numberToolAttribute);
    if (this.toolboxConfigLocation != null) {
        ((VelocityToolboxView) view).setToolboxConfigLocation(this.toolboxConfigLocation);
    }
    return view;
}
项目:spring4-understanding    文件:TilesViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    TilesView view = (TilesView) super.buildView(viewName);
    if (this.alwaysInclude != null) {
        view.setAlwaysInclude(this.alwaysInclude);
    }
    return view;
}
项目:leopard    文件:DownloadView.java   
public DownloadView(final String filename, final String name) {
    AbstractUrlBasedView view = new AbstractUrlBasedView() {
        @Override
        protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
            String name2 = URLEncoder.encode(name, "UTF-8");
            response.setContentType("application/force-download");
            response.addHeader("Content-Disposition", "attachment;filename=" + name2);

            File file = new File(filename);

            InputStream inputStream = new FileInputStream(file);
            BufferedInputStream bis = new BufferedInputStream(inputStream);
            byte[] bytes = new byte[1024];
            ServletOutputStream out = response.getOutputStream();
            int readLength = 0;
            while ((readLength = bis.read(bytes)) != -1) {
                out.write(bytes, 0, readLength);
            }
            // TODO ahai 释放资源
            inputStream.close();
            bis.close();
            out.flush();
            out.close();
        }
    };
    super.setView(view);
}
项目:pebble-spring4    文件:PebbleViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
  PebbleView view = (PebbleView) super.buildView(viewName);
  view.setTemplateName(viewName);
  view.setPebbleEngine(this.pebbleEngine);
  view.setCharacterEncoding(this.characterEncoding);

  return view;
}
项目:anyline    文件:TemplateResourceViewResolver.java   
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    TemplateView view = (TemplateView) BeanUtils.instantiateClass(getViewClass());
    if (!viewName.contains(getPrefix()) 
            && !viewName.startsWith("/")) {
        viewName = getPrefix() + viewName;
    }
    if (!viewName.endsWith(getSuffix())) {
        viewName = viewName + getSuffix();
    }
    view.setUrl(viewName);
    String contentType = getContentType();
    if (contentType != null)
        view.setContentType(contentType);

    view.setRequestContextAttribute(getRequestContextAttribute());
    view.setAttributesMap(getAttributesMap());
    if (this.alwaysInclude != null)
        view.setAlwaysInclude(this.alwaysInclude.booleanValue());

    if (this.exposeContextBeansAsAttributes != null)
        view.setExposeContextBeansAsAttributes(this.exposeContextBeansAsAttributes.booleanValue());

    if (this.exposedContextBeanNames != null)
        view.setExposedContextBeanNames(this.exposedContextBeanNames);

    view.setPreventDispatchLoop(true);
    return view;
}
项目:cas4.1.9    文件:RegisteredServiceThemeBasedViewResolver.java   
/**
 * Uses the viewName and the theme associated with the service.
 * being requested and returns the appropriate view.
 * @param viewName the name of the view to be resolved
 * @return a theme-based UrlBasedView
 * @throws Exception an exception
 */
@Override
protected AbstractUrlBasedView buildView(final String viewName) throws Exception {
    final RequestContext requestContext = RequestContextHolder.getRequestContext();
    final WebApplicationService service = WebUtils.getService(requestContext);
    final RegisteredService registeredService = this.servicesManager.findServiceBy(service);

    final String themeId = service != null && registeredService != null
            && registeredService.getAccessStrategy().isServiceAccessAllowed()
            && StringUtils.hasText(registeredService.getTheme()) ? registeredService.getTheme() : defaultThemeId;

    final String themePrefix = String.format("%s/%s/ui/", pathPrefix, themeId);
    LOGGER.debug("Prefix {} set for service {} with theme {}", themePrefix, service, themeId);

    //Build up the view like the base classes do, but we need to forcefully set the prefix for each request.
    //From UrlBasedViewResolver.buildView
    final InternalResourceView view = (InternalResourceView) BeanUtils.instantiateClass(getViewClass());
    view.setUrl(themePrefix + viewName + getSuffix());
    final String contentType = getContentType();
    if (contentType != null) {
        view.setContentType(contentType);
    }
    view.setRequestContextAttribute(getRequestContextAttribute());
    view.setAttributesMap(getAttributesMap());

    //From InternalResourceViewResolver.buildView
    view.setAlwaysInclude(false);
    view.setExposeContextBeansAsAttributes(false);
    view.setPreventDispatchLoop(true);

    LOGGER.debug("View resolved: {}", view.getUrl());

    return view;
}
项目:spring-boot-starter-jinja    文件:JinjaViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    JinjaView view = (JinjaView) super.buildView(viewName);
    view.setEngine(this.engine);
    view.setContentType(contentType);
    view.setRenderExceptions(renderExceptions);
    view.setEncoding(charset);
    return view;
}
项目:jeecms6    文件:RichFreeMarkerViewResolver.java   
/**
 * if viewName start with / , then ignore prefix.
 */
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractUrlBasedView view = super.buildView(viewName);
    // start with / ignore prefix
    if (viewName.startsWith("/")) {
        view.setUrl(viewName + getSuffix());
    }
    return view;
}
项目:jeecms6    文件:SimpleFreeMarkerViewResolver.java   
/**
 * if viewName start with / , then ignore prefix.
 */
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractUrlBasedView view = super.buildView(viewName);
    // start with / ignore prefix
    if (viewName.startsWith("/")) {
        view.setUrl(viewName + getSuffix());
    }
    return view;
}
项目:class-guard    文件:XsltViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    XsltView view = (XsltView) super.buildView(viewName);
    view.setSourceKey(this.sourceKey);
    if (this.uriResolver != null) {
        view.setUriResolver(this.uriResolver);
    }
    if (this.errorListener != null) {
        view.setErrorListener(this.errorListener);
    }
    view.setIndent(this.indent);
    view.setOutputProperties(this.outputProperties);
    view.setCacheTemplates(this.cacheTemplates);
    return view;
}
项目:class-guard    文件:JasperReportsViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractJasperReportsView view = (AbstractJasperReportsView) super.buildView(viewName);
    view.setReportDataKey(this.reportDataKey);
    view.setSubReportUrls(this.subReportUrls);
    view.setSubReportDataKeys(this.subReportDataKeys);
    view.setHeaders(this.headers);
    view.setExporterParameters(this.exporterParameters);
    view.setJdbcDataSource(this.jdbcDataSource);
    return view;
}
项目:class-guard    文件:VelocityLayoutViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName);
    // Use not-null checks to preserve VelocityLayoutView's defaults.
    if (this.layoutUrl != null) {
        view.setLayoutUrl(this.layoutUrl);
    }
    if (this.layoutKey != null) {
        view.setLayoutKey(this.layoutKey);
    }
    if (this.screenContentKey != null) {
        view.setScreenContentKey(this.screenContentKey);
    }
    return view;
}
项目:class-guard    文件:VelocityViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    VelocityView view = (VelocityView) super.buildView(viewName);
    view.setDateToolAttribute(this.dateToolAttribute);
    view.setNumberToolAttribute(this.numberToolAttribute);
    if (this.toolboxConfigLocation != null) {
        ((VelocityToolboxView) view).setToolboxConfigLocation(this.toolboxConfigLocation);
    }
    return view;
}
项目:Harvest-JP    文件:VelocityMultipleViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(final String viewName) throws Exception {
    if (logger.isDebugEnabled()) {
        logger.debug("Building view using multiple layout resolver. View name is {}", viewName);
    }

    VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName);
    if (layoutKey != null) {
        view.setLayoutKey(layoutKey);
    }

    if (screenContentKey != null) {
        view.setScreenContentKey(screenContentKey);
    }

    if (!this.mappings.isEmpty()) {
        for (Map.Entry<String, String> entry : this.mappings.entrySet()) {
            // Correct wildcards so that we can use the matches method in the String object
            String mappingRegexp = StringUtils.replace(entry.getKey(), "*", ".*");
            // If the view matches the regexp mapping
            if (viewName.matches(mappingRegexp)) {
                if (logger.isDebugEnabled()) {
                    logger.debug(" Found matching view. Setting layout url to {}", entry.getValue());
                }

                view.setLayoutUrl(entry.getValue());
                return view;
            }
        }
    }

    return view;
}
项目:GisGMP    文件:TilesExposingBeansViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractUrlBasedView superView = super.buildView(viewName);
    if (superView instanceof TilesExposingBeansView) {
        TilesExposingBeansView view = (TilesExposingBeansView) superView;
        if (this.exposeContextBeansAsAttributes != null) view.setExposeContextBeansAsAttributes(this.exposeContextBeansAsAttributes);
        if (this.exposedContextBeanNames != null) view.setExposedContextBeanNames(this.exposedContextBeanNames);
    }
    return superView;
}
项目:fenixedu-academic    文件:StudentGroupController.java   
@RequestMapping(value = "/shift/{shift}/createStudentGroup", method = RequestMethod.POST)
public AbstractUrlBasedView createStudentGroup(Model model, @PathVariable Grouping grouping, @PathVariable Shift shift,
        @ModelAttribute("addStudent") @Validated AttendsBean addStudents, BindingResult bindingResult) {
    if (bindingResult.hasErrors()) {
        return new RedirectView("/teacher/" + executionCourse.getExternalId() + "/student-groups/view/"
                + grouping.getExternalId(), true);
    }

    StudentGroup studentgroup = studentGroupService.createStudentGroup(grouping, shift);
    return new RedirectView("/teacher/" + executionCourse.getExternalId() + "/student-groups/" + grouping.getExternalId()
            + "/viewStudentGroup/" + studentgroup.getExternalId(), true);
}
项目:fenixedu-academic    文件:StudentGroupController.java   
@RequestMapping(value = "/editStudentGroupShift/{studentGroup}", method = RequestMethod.POST)
public AbstractUrlBasedView editStudentGroupShift(@PathVariable Grouping grouping, @PathVariable StudentGroup studentGroup,
        @ModelAttribute("newShift") @Validated Shift newShift, BindingResult bindingResult) {
    studentGroupService.updateStudentGroupShift(studentGroup, newShift);
    return new RedirectView("/teacher/" + executionCourse.getExternalId() + "/student-groups/" + grouping.getExternalId()
            + "/viewStudentGroup/" + studentGroup.getExternalId(), true);

}
项目:fenixedu-academic    文件:StudentGroupController.java   
@RequestMapping(value = "/deleteStudentGroup/{studentGroup}", method = RequestMethod.POST)
public AbstractUrlBasedView deleteStudentGroup(Model model, @PathVariable Grouping grouping,
        @PathVariable StudentGroup studentGroup) {
    if (!studentGroup.getAttendsSet().isEmpty()) {
        model.addAttribute("errors", "errors.invalid.delete.not.empty.studentGroup");
        return viewStudentGroup(model, grouping, studentGroup);
    }
    studentGroupService.deleteStudentGroup(studentGroup);
    return new RedirectView("/teacher/" + executionCourse.getExternalId() + "/student-groups/view/"
            + grouping.getExternalId(), true);
}
项目:Lottery    文件:RichFreeMarkerViewResolver.java   
/**
 * if viewName start with / , then ignore prefix.
 */
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractUrlBasedView view = super.buildView(viewName);
    // start with / ignore prefix
    if (viewName.startsWith("/")) {
        view.setUrl(viewName + getSuffix());
    }
    return view;
}
项目:Lottery    文件:SimpleFreeMarkerViewResolver.java   
/**
 * if viewName start with / , then ignore prefix.
 */
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractUrlBasedView view = super.buildView(viewName);
    // start with / ignore prefix
    if (viewName.startsWith("/")) {
        view.setUrl(viewName + getSuffix());
    }
    return view;
}
项目:crowly    文件:TilesExposingBeansViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    AbstractUrlBasedView superView = super.buildView(viewName);
    if (superView instanceof TilesExposingBeansView) {
        TilesExposingBeansView view = (TilesExposingBeansView) superView;
        if (this.exposeContextBeansAsAttributes != null)
            view.setExposeContextBeansAsAttributes(this.exposeContextBeansAsAttributes);
        if (this.exposedContextBeanNames != null) view.setExposedContextBeanNames(this.exposedContextBeanNames);
    }
    return superView;
}
项目:trimou    文件:TrimouViewResolver.java   
@Override
protected AbstractUrlBasedView buildView(String viewName) throws Exception {
    TrimouView view = (TrimouView) super.buildView(viewName);
    try {
        view.setViewName(viewName);
        view.setEngine(engine);
        return view;
    } catch (Exception e) {
        throw new MustacheException(view.getUrl() + " : " + e.getMessage());
    }
}