struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From josh <j...@ink.org>
Subject Tiles: converting jsp definitions to xml defs.
Date Tue, 06 Jul 2004 16:54:32 GMT
I am getting the following error after converting my app from using jsp based tiles definitions
to xml based tiles definitions.

"org.apache.jasper.JasperException: Can't get definitions factory from context"
Then a big stack trace.

The app was functional before I made the following changes...

*** I changed my config to add the tiles plugin as follows
<plug-in className="org.apache.struts.tiles.TilesPlugin">
	<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
	<set-property property="moduleAware" value="true" />
	<set-property property="definitions-parser-validate" value="true" />
</plug-in>

*** I added the tiles-defs.xml file. It looks like this.
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE tiles-definitions PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration
1.1//EN"
         
"jar:file:/web/tomcat/work/Standalone/localhost/khp-crashlogs/WEB-INF/lib/struts.jar!/org/apache/struts/resources/tiles-config_1_1.dtd">
         
<!--"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">-->

<tiles-definitions>
  <definition name="TTLayoutDef" path="/WEB-INF/jsps/TTLayout.jsp">
    <put name="header" value="/WEB-INF/jsps/header.jsp"/>
    <put name="footer" value="/WEB-INF/jsps/footer.jsp"/>
  </definition>
</tiles-definitions>

*** I changed all my jsps to declare an xml definition and not a jsp
definition. like this.
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<tiles:insert definition="TTLayoutDef">
	<tiles:put name="title" type="string" value="TagTrack Menu" />
	<tiles:put name="content" value="/WEB-INF/jsps/menuContent.jsp"/>
</tiles:insert>


I have the following libraries in my lib directory
commons-beanutils.jar    commons-lang.jar       struts.jar
commons-collections.jar  commons-logging.jar    struts-legacy.jar
commons-digester.jar     commons-validator.jar
commons-fileupload.jar   jakarta-oro.jar

Below is an old thread about a similar problem, but the solution doesn't
really tell me much.  Perhaps someone could clarify what pady meant by
"I had defined the "definitions" wrongly"

Thanks in advance!

-----Original Message-----
From: David Friedman [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 25, 2003 3:28 PM
To: Struts Users Mailing List
Subject: RE: using tiles...

Pady,

I didn't see you set your controller line set to use a Tiles
RequestProcessor such as:

<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

I had a problem a little like that over the weekend with my tiles. I put
that in but forgot my TilesPlugIn.

Regards,
David

-----Original Message-----
From: Pady Srinivasan [mailto:[EMAIL PROTECTED]
Sent: Monday, August 25, 2003 3:11 PM
To: [EMAIL PROTECTED]
Subject: using tiles...




Since I couldn't find a separate mailing list for Tiles, I am posting here.



I started using Tiles recently ( bundled with Struts 1.1 ). I am having
problem using "definitions". I get this error:



javax.servlet.ServletException: Can't get definitions factory from context.

            at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:530)

            at
org.apache.jsp.testTemplate_jsp._jspService(testTemplate_jsp.java:59)

...





I am following exactly as the tiles-examples are defined. M struts-config
file is:



....

  <plug-in className="org.apache.struts.tiles.TilesPlugin" >

    <set-property property="definitions-config"

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

    <set-property property="moduleAware" value="true" />

  </plug-in>

....



The tiles-test-defs.xml file is:



....

<definition name="mainPage" path="classicLayout.jsp">

   <tiles:put name="title" value="Hello Tiles"/>

   <tiles:put name="header" value="/jsp/header.jsp"/>

   <tiles:put name="footer" value="/jsp/footer.jsp"/>

   <tiles:put name="body" value="/jsp/main.jsp"/>

</definition>

....



And my sample jsp file:



<tiles:insert definition="mainPage" flush="true" />





Any help is appreciated.





Thanks



-- pady

-----Original Message-----
From: David Friedman [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 25, 2003 3:28 PM
To: Struts Users Mailing List
Subject: RE: using tiles...

Pady,

I didn't see you set your controller line set to use a Tiles
RequestProcessor such as:

<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

I had a problem a little like that over the weekend with my tiles. I put
that in but forgot my TilesPlugIn.

Regards,
David


-----Original Message-----
From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 26, 2003 8:15 AM
To: Struts Users Mailing List
Subject: RE: using tiles...


But in the tiles-documentation web app also, the controller is commented
out. I tried uncommenting and still get the same error.


Thanks
 
-----Original Message-----
From: Pady Srinivasan [mailto:[EMAIL PROTECTED] 

I figured it out. I had defined the "definitions" wrongly and was getting an
error during webapp loading itself.


Thanks
 
-- pady


-- 
Joshua Cronemeyer
Developer
accessKansas - a service of the Information Network of Kansas, Inc.
www.accesskansas.org <http://www.accesskansas.org/>
785-296-2816 (phone)
785-296-5563 (fax)
josh@ink.org <mailto:josh@ink.org>

***********************
CONFIDENTIALITY NOTICE:
This E-mail and any attachments are confidential.  If you are not the
intended recipient, you do not have permission to disclose, copy,
distribute, or open any attachments.  If you have received this E-mail
in
error, please notify us immediately by returning it to the sender and
delete
this copy from your system.

Thank you.
accessKansas
***********************

Mime
View raw message