Announcement Announcement Module
Collapse
No announcement yet.
How to provide webAppRootKey for a dispatcher context? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to provide webAppRootKey for a dispatcher context?

    Greetings.

    I need to know inside the web application where exactly it is placed in the file system.

    As a variant I want to load the context parameter into the dispatcher configuration, but I'm not sure how to do it and if I need to do it.
    May be there are ore ways or methods to do the same task. Please suggest if any?

    Please help with this issue. Thanks in advance.

    Here are some context excerpts:
    web.xml
    Code:
    	<context-param>
    		<param-name>webAppRootKey</param-name>
    		<param-value>site.root</param-value>
    	</context-param>
    
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			WEB-INF/site-data.xml
    			WEB-INF/site-email.xml
    			WEB-INF/site-services.xml
    			WEB-INF/site-security.xml
    			WEB-INF/site-servlet.xml
    			WEB-INF/site-transactions.xml
    			WEB-INF/site-webflow.xml
    		</param-value>
    	</context-param>
    	
    	<servlet>
    		<servlet-name>site</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    site-servlet.xml
    Code:
    <!-- Suppose that this one already exists and prints out the dir value-->
    	<bean id="controller" class="com.Controller">
    		<property name="dir">site.root</property>
    	</bean>

  • #2
    Try with ServletContextParameterFactoryBean for context-init params, see ServletContextFactoryBean and ServletContextAttributeFactoryBean for access to ServletContext
    cheers
    Last edited by chelu; Oct 20th, 2009, 02:46 PM.

    Comment


    • #3
      It helped. Thanks!!!

      Comment

      Working...
      X