Announcement Announcement Module
Collapse
No announcement yet.
Problem adding second view resolver Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem adding second view resolver

    I am porting an app and have a bunch of JSP/JSTL views I want to move over. The previous app used an InternalResourceViewResolver, but I've read that's incompatible with the UrlBasedViewResolver already configured for Tiles. So I added a ResourceBundleViewResolver and used the order property:

    Code:
    <bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver"
    	p:basename="jspviews"
    	p:order="0" />
    
    <bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" id="tilesViewResolver">
       	<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
       	<property name="order" value="1"/>  	
    </bean>
    In my controller:

    Code:
    return new ModelAndView("registrationForm", "model", model);
    I've added a jspviews.properties file in webapp/WEB-INF/classes:

    Code:
    registrationForm(.class)=org.springframework.web.servlet.view.JstlView
    registrationForm.url=/WEB-INF/jsp/registrationForm.jsp
    However, I keep getting this exception:

    java.lang.IllegalStateException: No bean class specified on bean definition
    ...
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'registrationForm': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition

    I'd be grateful if anyone could tell me what I'm doing wrong.

  • #2
    Seems like a parsing error in the framework, I've logged a bug report here:

    https://jira.springsource.org/browse/SPR-8277

    Anyone know of another way to add a second view resolver since ResourceBundleViewResolver is broken?

    Comment

    Working...
    X