www.dextsolution.com
DEXTUPLOAD
NJ
menu toggleReference > devpia > dextuploadnj > support > spring > DEXTUploadNJServletContextAwareBean

devpia.dextuploadnj.support.spring
Class DEXTUploadNJServletContextAwareBean

Minimum version supported
1.0.0
Minimum support environment
JRE 1.6, Spring Framework
Description

This is a utility class used to retrieve the javax.servlet.ServletContext object in the xml file of the servlet context.

<bean id="servletContextAware" class="devpia.dextuploadnj.support.spring.DEXTUploadNJServletContextAwareBean"/>
<bean id="multipartResolver" class="devpia.dextuploadnj.support.spring.DEXTUploadNJMultipartResolver">
  <property name="environment">
    <bean class="devpia.dextuploadnj.Environment">
      <property name="tempRepository" value="${java.io.tmpdir}"/>
      <property name="defaultRepository">
        <!-- Sets the sub directory(/files) relative to web application root to the default save directory. -->      
        <bean factory-bean="servletContextAware" factory-method="getRealPath">
          <constructor-arg value="files"/>
        </bean>
      </property>
    </bean>
  </property>
</bean>
Methods

getRealPath

  • Returns the physical absolute path that makes the specified path relative to the location of the Web application's root location.

  • Signatures

    public String getRealPath(String relative)
  • Parameters

    Name Type Description
    relative java.lang.String sub path
  • Returns

    a physical absolute path is relative to the location of the root of the Web application