0

I'm trying to do this tutorial http://www.mkyong.com/spring-mvc/spring-mvc-export-data-to-excel-file-via-abstractjexcelview/ using Spring 3 and annotations.

So I have a WebAppConfig class

@Configuration
@ComponentScan("com.mkyong.common")
@EnableWebMvc
public class WebAppConfig {
  @Bean
  public InternalResourceViewResolver setupViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/pages/");
    resolver.setSuffix(".jsp");
    return resolver;
  }
}

and a WebAppInitializer class

class public class WebAppInitializer implements WebApplicationInitializer {

    public void onStartup(ServletContext servletContext) throws ServletException {
        XmlWebApplicationContext appContext = new XmlWebApplicationContext();
        String[] locations = { "classpath*:applicationContext.xml" };
        appContext.setConfigLocations(locations);
        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(appContext));
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping("/");
        servletContext.addListener(new ContextLoaderListener(appContext));
        servletContext.getServletRegistration ("default").addMapping ("*.js", "*.css", "*.jpg", "*.gif", "*.png");
    }
}

I don't have any problem with the classic page (without excel) but with excel, the app looks for ExcelRevenueSummary.jsp.

Do someone know how could I "translate" this :

<bean id="ExcelRevenueSummary"
    class="com.mkyong.common.view.ExcelRevenueReportView">
</bean>

in a correct format used by Spring 3 ?

Thank you.

BkSouX
  • 739
  • 5
  • 13
  • 29

0 Answers0