Announcement Announcement Module
Collapse
No announcement yet.
Can any one help me out in integrating spring MVC & Web Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can any one help me out in integrating spring MVC & Web

    Hi,

    Can any one help me out in integrating spring MVC & Webflow? Is there any info regarding this? We are using spring framework in our current project. I am new to this spring framework.

    I created Spring MVC, Spring webflow separately and able to run successfully. Now I want to merge both.

    Initially, I have two xml files as follows:

    SampleWebFlow-servlet.xml for Spring MVC

    Servlet.xml for Spring webflow

    While I am integrating MVC and WEBFLOW, I configured SampleWebFlow-servlet.xml & Servlet.xml in web.xml.

    In this case Iím able to access only one application (I guess itís overriding servlet.xml). So I merged two files into a single servlet.xml file and then I am trying to access the application.

    For my MVC URL path is /SampleWebFlow/index.toc

    And for WEBFLOW /SampleWEBFlow/journal.toc

    I am able to access only /SampleWebFlow/index.toc not journal.toc

    Am I missing any thing?

  • #2
    I'm guessing you only have 1 dispatcher servlet in your web.xml file that is reading the merged context XML file.
    First thing to check is that dispatcher servlet is correctly passed the requests you're sending. If not, check the mapping in web.xml.
    If the dispatcher servlet correctly receives the requests, check the ViewResolver defined in the application context XML to see if the dispatcher servlet can correctly locate the controller handling "journal.toc".

    For more info on all of this, check the Spring MVC reference docs: http://static.springframework.org/sp...rence/mvc.html.

    Erwin

    Comment


    • #3
      Hi Erwin,

      I am really thankful to you for the quick response.


      I have 1 dispatcher servlet in my web.xml.


      <servlet>
      <servlet-name>SampleWebFlow</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
      <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>
      classpath:org/springframework/webflow/samples/journal/deploy/journal-layer.xml
      classpath:org/springframework/webflow/samples/journal/deploy/volume-layer.xml

      /WEB-INF/SampleWebFlow-servlet.xml

      </param-value>
      </init-param>

      <load-on-startup>1</load-on-startup>

      </servlet>

      <servlet-mapping>
      <servlet-name>SampleWebFlow</servlet-name>
      <url-pattern>*.toc</url-pattern>
      </servlet-mapping>


      My SampleWebFlow-servlet.xml contains the following configuration details:


      <beans>
      <bean name="/journal.toc" class="org.springframework.webflow.mvc.FlowControl ler">
      <!--
      Set cacheSeconds to a small, non 0, value so you can do ctrl-N to open an new
      window and experiment with the continuations stuff.
      -->
      <property name="cacheSeconds" value="5"/>
      <property name="flowExecutionManager" ref="flowExecutionManager"/>

      </bean>

      <!--
      Custom configuration of the HTTP request flow execution manager.
      Note how you can just change the flow execution storage strategy without any impact
      on the views!
      -->
      <bean id="flowExecutionManager" class="org.springframework.webflow.execution.servl et.ServletFlowExecutionManager">
      <property name="listener">
      <bean class="org.springframework.webflow.samples.journal .web.JournalFlowExecutionListener"/>
      </property>
      <property name="storage">
      <bean class="org.springframework.webflow.execution.servl et.HttpSessionContinuationFlowExecutionStorage"/>
      </property>
      <!--
      <property name="storage">
      <bean class="org.springframework.webflow.execution.servl et.HttpSessionFlowExecutionStorage"/>
      </property>
      -->
      <!--
      <property name="storage">
      <bean class="org.springframework.webflow.execution.Clien tContinuationFlowExecutionStorage">
      <property name="compress" value="true"/>
      </bean>
      </property>
      -->
      </bean>

      <bean id="statisticsService" class="org.springframework.webflow.execution.jmx.S tatisticsService">
      <constructor-arg ref="flowExecutionManager"/>
      <property name="enabled" value="true"/>
      </bean>

      <bean id="demoController" class="DemoController"/>

      <bean id="flowURLMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
      <property name="mappings">
      <props>
      <prop key="/index.toc">paramMultiController</prop>
      </props>
      </property>
      </bean>

      <bean id="propsResolver" class="org.springframework.web.servlet.mvc.multiac tion.PropertiesMethodNameResolver">
      <property name="mappings">
      <props>
      <prop key="/index.toc">initialRequest</prop>
      </props>
      </property>
      </bean>
      <bean id="paramMultiController" class="org.springframework.web.servlet.mvc.multiac tion.MultiActionController">
      <property name="methodNameResolver"><ref bean="propsResolver"/></property>
      <property name="delegate"><ref bean="demoController"/></property>
      </bean>

      <bean id="urlFileNameController" class="org.springframework.web.servlet.mvc.UrlFile nameViewController"/>
      <bean id="jspViewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
      <property name="viewClass" value="org.springframework.web.servlet.view.JstlVi ew"/>
      <property name="prefix" value="/WEB-INF/jsp/"/>
      <property name="suffix" value=".jsp"/>
      </bean>

      </beans>



      Is the above configuration file correct? Am I doing anything wrong?

      Journal.toc is for webflow.

      Comment


      • #4
        Hi Erwin,

        I am sorry, I made mistake in web.xml. I solve the problem.

        Comment

        Working...
        X