Announcement Announcement Module
Collapse
No announcement yet.
Could not open ServletContext resource in excel view Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Could not open ServletContext resource in excel view

    Hi,

    I'm using Spring 2.5

    and I have this error when I try to have excel view

    java.io.FileNotFoundException: Could not open ServletContext resource [/test.xls]
    here's my test-servlet.xml snippet

    Code:
    	<bean class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
            <property name="basename" value="views"/>
            <property name="order" value="0" />
        </bean>   
          	
        <bean 	id="excelController" class="com.TestExcelController">
    	</bean>
       
         <bean 	id="excelView" class="com.DataExcelView">
        </bean>
    
    	<bean id="viewResolver"
    	class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="prefix" value="/WEB-INF/jsp/"/>
    		<property name="suffix" value=".jsp"/>
    		<property name="order" value="1" />
    	</bean>
    
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" 
        p:basename="messages" />
    	
    	
    	<bean id="searchData" class="com.SearchFormController">
        	<property name="formView" value="search"/>
        	<property name="commandName" value="test_search_info"/>
        	<property name="successView" value="searchResult"/>
        	<property name="commandClass" value="com.SearchInfo"/>
          	<property name="validator"><ref bean="searchFormValidator"/></property>
      	</bean>
      	
      	
      	<bean id="searchFormValidator" class="com.TestSearchValidator">
      	</bean>
    
    
    	<bean id="simpleUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<props>
    				<prop key="/search.htm">searchData</prop>
    				<prop key="/test.xls">excelController</prop>
    			</props>
    		</property>
    	</bean>
    Code:
    excel-view.class=com.DataExcelView
    excel-view.url=test
    my test-servlet.xml sits under /WEB-INF folder

    Does anyone know what did I did wrong?
    Last edited by geek.shrek; Sep 11th, 2008, 01:33 PM. Reason: add details

  • #2
    Fixed it

    Comment

    Working...
    X