Tiles not being initialized w/ Struts.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Nishizawa
Posted On:   Thursday, April 21, 2005 08:36 AM

I am trying to configure my webapp to use tiles definitions and I get some strange issues. 1, if I use Struts 1.1, I can define the tiles in a jsp page, but I can't seem to do it by configuring in tiles-defs.xml. When I try it gives me an error that I didn't have a "/" in front of the parameter in the ForwardAction. So I upgraded to the newest version of struts 1.2.4 and then I can't even define the tiles in the jsp. Whether I try to use the tiles-defs.xml or defining in jsp, I get the following stack trace: java.lang.NullPointerException org.apache.struts.tiles.xmlDefinition.FactorySet.getDefinition(FactorySet.java:116) org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.getDefinition(C   More>>

I am trying to configure my webapp to use tiles definitions and I get some strange issues. 1, if I use Struts 1.1, I can define the tiles in a jsp page, but I can't seem to do it by configuring in tiles-defs.xml. When I try it gives me an error that I didn't have a "/" in front of the parameter in the ForwardAction. So I upgraded to the newest version of struts 1.2.4 and then I can't even define the tiles in the jsp. Whether I try to use the tiles-defs.xml or defining in jsp, I get the following stack trace:


			
java.lang.NullPointerException
org.apache.struts.tiles.xmlDefinition.FactorySet.getDefinition(FactorySet.java:116)
org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.getDefinition(ComponentDefinitionsFactoryWrapper.java:86)
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:153)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:300)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)



Here's the log:
			
[DEBUG,ModuleUtils] Get module name for path /home.do
[DEBUG,ModuleUtils] Module name found: default
[INFO,TilesRequestProcessor] Tiles definition factory found for request processo
r ''.
[DEBUG,RequestProcessor] Processing a 'GET' for path '/home'
[DEBUG,RequestProcessor] Setting user locale 'en_US'
[DEBUG,RequestProcessor] Looking for Action instance for class org.apache.strut
s.actions.ForwardAction
[DEBUG,RequestProcessor] Creating new Action instance
[DEBUG,PropertyMessageResources] Initializing, config='org.apache.struts.actions
.LocalStrings', returnNull=true
[DEBUG,TilesRequestProcessor] processForwardConfig(progMgmt, true)
[DEBUG,I18nFactorySet] Can't open file '/WEB-INF/instanceDefinitions_en_US.xml'
[DEBUG,I18nFactorySet] Can't open file '/WEB-INF/instanceDefinitions_en.xml'



Here's my tiles definition in the Struts config:
			



value="/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-examples-defs.xml"/>





This is the call to the tile definition I want to use:
			



And the definition in tiles-defs.xml:
			














   <<Less

Re: Tiles not being initialized w/ Struts.

Posted By:   Michael_Nishizawa  
Posted On:   Friday, April 22, 2005 12:30 PM

I didn't post back right away, but I did fix the issue. The problem was that my commons-digester.jar was out of date. I ended up looking at the dates and sizes of each jar file and found the discrepancy.

Thanks for the suggestion.

Re: Tiles not being initialized w/ Struts.

Posted By:   alan_do  
Posted On:   Thursday, April 21, 2005 11:19 AM

these may not be the reasons...but, your action does not have a 'forward', instead you have a 'parameter' attribute defined. parameter is used for DispatchedActions. the forward should point to your tiles def (forward='progMgmt').


also, you have the 'tiles-examples-defs.xml' in your plugin. i am not sure it that definition is referring to anything else that may cause the issue. you also have moduleAware set to true, do you have other tiles plugins to require this? if not, don't even add it in there. -/a

About | Sitemap | Contact