Announcement Announcement Module
Collapse
No announcement yet.
DispatcherServlet: No adapter for handler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DispatcherServlet: No adapter for handler

    Hi,

    First of all, I'm kind of new at Spring Webflow and have started with a simple webflow which I can then extend later on. However, I continuously get an error from DispatcherServlet, which tells me there is no adapter for handler. Anyone know what's causing this?

    Error:
    Code:
    javax.servlet.ServletException: No adapter for handler [[Flow@dc9065 id = 'objects', startState = [ViewState@19fdbcb id = 'startGetObjectList', flow = 'objects', etc.... ]: Does your handler implement a supported interface like Controller?
    object-servlet.xml
    Code:
    	<bean id="objectsFlowController" class="org.springframework.webflow.mvc.FlowController">
    		<property name="synchronizeOnSession" value="true" /> 
    		<property name="flow" ref="objectsFlow"/>
    	</bean>
    
    	<bean id="objectsFlow" class="org.springframework.webflow.config.XmlFlowFactoryBean">
    	   <property name="location" value="/WEB-INF/flows/objects-flow.xml"/>
    	</bean>
    
    	<bean id="getObjectsAction"
    		class="com.org.web.admin.objectsflow.GetObjectsAction">
    		<property name="queryService"><ref bean="services.QueryService"/></property>
    	</bean>
    objects-flow.xml:
    Code:
    <webflow id="objects" start-state="startGetObjectList">
    
    	<view-state id="startGetObjectList" view="definition.StartGetObjectList">
            <transition on="submit" to="getObjectList">
                <action bean="getObjectsAction" method="bindAndValidate"/>
            </transition>
    	</view-state>
    
    	<action-state id="getObjectList">
    		<action bean="getObjectsAction"/>
    		<transition on="success" to="listObjects" />
    	</action-state>
    
    	<view-state id="listObjects" view="definition.ListObjects">
    		<transition on="back" to="getObjectList" />
    	</view-state>
    </webflow>
    Java:
    Code:
    public class GetObjectssAction extends FormAction &#123;
    
    	private QueryService queryService;
    
    	public void setQueryService&#40;QueryService queryService&#41; &#123;
    		this.queryService = queryService;
    	&#125;
    
    	protected Event processSubmit&#40;RequestContext context&#41; throws Exception &#123;
    		List objects = queryService.getObjects&#40;&#41;;
    		context.getRequestScope&#40;&#41;.setAttribute&#40;"objects", objects&#41;;
    		return success&#40;&#41;;
    	&#125;
    &#125;

  • #2
    I'll just reply to my own problem. Apparently, you can't rely on the SimpleUrlHandlerMapping with a urlMap for this. You really need to use the names in your beans for this to work.

    Comment


    • #3
      No, I bet I know what you did.

      Looks like you mapped a URL in your URL map to your FLOW, and not to the FLOW CONTROLLER. You definitely can't do that.

      In general you shouldn't tie your flows to specific request URLs. We recommend a single flow controller mapped to a single URL that manages executions of all flows.

      Keith

      Comment

      Working...
      X