Results 1 to 3 of 3
  1. #1
    wiz6 is offline Member
    Join Date
    Jan 2012
    Posts
    12
    Rep Power
    0

    Default Get data from different controllers

    I want to build page where are menu and content areas. I have different controllers: PageController, ProductController and maybe some third controller.
    I have read about spring frontcontroller which takes all request. This should be PageController, marked as @RequestMapping(value="/") annotation. This controller manages menu and other page details. ProductController manages all product data and its marked as @RequestMapping(value="product") annotation.
    If i go to url: localhost/webapp/ PageController sends menu to view and everything is Ok. Here is the problem, if i go to url localhost/webapp/product
    the menu is dissapear because no PageController is used. Is it possible that all request uses my PageController and this decide which other controller to use?
    My web.xml
    Java Code:
    	<servlet>
    		<servlet-name>dispatcher</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    
    	<servlet-mapping>
    		<servlet-name>dispatcher</servlet-name>
    		<url-pattern>/</url-pattern>
    	</servlet-mapping>

  2. #2
    Join Date
    Apr 2014
    Posts
    46
    Rep Power
    0

    Default Re: Get data from different controllers

    can you post full example what you are doing

  3. #3
    Join Date
    Feb 2009
    Posts
    28
    Rep Power
    0

    Default Re: Get data from different controllers

    Can you show me dispatcher-servlet.xml file

Similar Threads

  1. Replies: 5
    Last Post: 05-23-2014, 10:07 AM
  2. Replies: 1
    Last Post: 04-11-2014, 02:39 AM
  3. Replies: 11
    Last Post: 09-21-2012, 09:33 AM
  4. Getting problem inserting data in data base
    By anupama in forum New To Java
    Replies: 4
    Last Post: 12-15-2010, 10:03 PM
  5. Replies: 0
    Last Post: 10-31-2008, 02:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •