struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emi Lu <em...@encs.concordia.ca>
Subject Tiles2.2.1, Struts2.1.8.1, Spring2.5.6 ===> "UnresolvingLocaleDefinitionsFactory.java:102" ???
Date Thu, 28 Jan 2010 19:15:08 GMT
Good afternoon,

Tiles2.2.1, Struts 2.1.8.1, Spring 2.5.6, tried simple example, but 
always got the following error:
===================================
java.lang.NullPointerException
	org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:102)
org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:364)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:618)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
... ...

Could someone tell me why I get this error?

Thanks a lot!
--
Lu Ying

(1) web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Struts2 Testing</display-name>

    <!-- Uncomment/comment this if you need/don't need Spring support -->
    <context-param>
       <param-name>contextConfigLocation</param-name>
       <param-value>/WEB-INF/applicationContext*.xml</param-value>
    </context-param>


    <!-- tiles begin -->
    <context-param>
       <param-name> 
org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG </param-name>
       <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>

    <!-- tiles end -->



    <filter>
       <filter-name>struts2</filter-name>
 
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
       <init-param>
          <param-name>actionPackages</param-name>
          <param-value>user.actions</param-value>
       </init-param>
    </filter>


    <filter-mapping>
       <filter-name>struts2</filter-name>
       <url-pattern>/*</url-pattern>
    </filter-mapping>


    <listener>
 
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>


    </listener>
    <listener>
       <listener-class>org.apache.struts2.tiles.StrutsTilesListener 
</listener-class>
    </listener>


    <welcome-file-list>
       <welcome-file>begin.jsp</welcome-file>
    </welcome-file-list>


</web-app>





(2) struts.xml
... ...
<struts>
  <constant name="struts.enable.DynamicMethodInvocation" value="false" />
  <constant name="struts.devMode" value="false" />

<package name="default" extends="struts-default">
<result-types>
<result-type name="tiles" 
class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>

<action name="*Link" method="{1}" 
class="example.action.tiles.ProcessTile1">
   <result name="welcome" type="tiles">welcome</result>
   </action>
</package>

</struts>



(3) tiles.xml
<tiles-definitions>
    <definition name="baseLayout" template="/baseLayout.jsp">
    </definition>
    <definition name="welcome" extends="baseLayout">
    </definition>
</tiles-definitions>



(4) jsp file
<a href="<s:url action="welcomeLink"/>"> Tile example1   </a>

(5) baseLayout.jsp
hello world

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message