Deploying Liferay Spring MVC Offline

Spring MVC Portlet will be requiring Internet for checking and creating beans from xsd's. In case we need to deploy and use Spring MVC Portlet without internet then we can achieve it by saving the xsd file in Liferay Tomcat server  and using this xsd  in application-context.xml.


 1. Download the Following  XSDs based on your version required

  • spring-beans-4.0.xsd
  • spring-context-4.0.xsd
  • spring-tool-4.0.xsd
  • spring-util-4.0.xsd

 2. open spring-context-4.0.xsd and edit it as follow (replace existing content with highlighted)

 <xsd:import namespace=""  schemaLocation=" ../spring-xsd/spring-beans-4.0.xsd"/>
 <xsd:import namespace=""  schemaLocation=" ../spring-xsd/spring-tool-4.0.xsd"/>
 Note - Change according to your server port
 3. Copy all four file (spring-beans-4.0.xsd,spring-context-4.0.xsd,spring-tool-4.0.xsd,spring-util-  4.0.xsd) to an  folder and name the folder as spring-xsd.
WIndows : Copy the spring-xsd. folder into the Drive where your Liferay tomcat is present 
Ex. If Liferay Tomcat is in d:\workspace\tomcat then paste spring-xsd folder in d: drive
Linux : Copy spring-xsd. folder into your liferay tomcat folder 
/liferay-portal-6.2-ce-ga6/tomcat-7.0.62 - here
 5.Inside your Spring MVC portle edit application-context.xml file as follow(replace existing  content with highlighted)
 <beans xmlns=""
 xmlns:xsi=""  xmlns:p=""
 xsi:schemaLocation="   ../spring-xsd/spring-beans-4.0.xsd   ../spring-xsd/spring-  context-4.0.xsd .. /spring-  xsd/spring-util-4.0.xsd">
 Note - 1.Change according to your server port
             2.If you have multiple application-context.xml files then do this for all of them
             3. If you have more schema in your application  context then change the path as above for all
 6. Build war and Deploy the Spring MVC Portlet without internet it will check and build beans  from local server path