Hi Paul,<br><br>Part of the stacktrace is here ..<font size="4"><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"></font><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex; font-family: courier new,monospace;" class="gmail_quote">
<pre><pre><font size="4"><font size="4">javax.servlet.ServletException: javax.servlet.jsp.JspException: Error reading resource from path "/opencms/opencms/TAIG/personal/MyTip1.html".<br> at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)<br>
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)<br> at org.apache.jsp.WEB_002dINF.jsp.offline.system.modules.com_viral_taig_TemplatesV2.templates.Rural_005fV2_jsp._jspService(Rural_005fV2_jsp.java:265)<br>
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)</font><br></font></pre></pre></blockquote><br>I made a xmlpage type file and put some content in it. Applied my template to it by selecting the template dropdown. Then I defined a property by name <b>tip_file</b> by clicking the Advanced button. The property is set to a xmlpage type of file created in the same VFS directory, e.g, mytip.html.<br>
<br>Both the file and the tip file are located in the same site directory <br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><font size="2">/opencms/opencms/TAIG/personal/</font><br>
</blockquote><pre><pre><font><font size="4"><br></font></font></pre></pre>
The template has the following line...<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><cms:include file="../elements/commons_v2.jsp" element="insider_tip"/><br>
</blockquote><div><br>The included elements file has the code....<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><cms:template element="insider_tip"> <br>
<div class="rightnav_content_head"><img<br> src="<cms:link>../resources/images/right_nav.gif</cms:link>" width="8"<br> height="8" /> Insider Tip</div><br>
<div class="rightnav_div1"><!-- --></div><br> <div class="rightnav_content"><br> <%<br> CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);<br>
String filename = cms.getRequestContext().getUri();<br> String foldername = org.opencms.file.CmsResource.getFolderPath(filename);<br> String tfilename = cms.property("tip_file", filename);<br>
cms.include(cms.link(foldername + tfilename));<br> %><br> <br /><br> <input type="image"<br> src="<cms:link>../resources/images/find_out_more.gif</cms:link>"<br>
width="107" height="28"></div><br></cms:template><br></blockquote><div><br> </div><br> <br></div><br>-- Yogesh<br><br>Believe with all your heart that how you live your life makes a difference. --Colin Beavan <br>
<br><br><div class="gmail_quote">On Fri, Feb 12, 2010 at 3:02 PM, Paul-Inge Flakstad <span dir="ltr"><<a href="mailto:flakstad@npolar.no">flakstad@npolar.no</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Hi Yogesh</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Unless you want to use hard coded file names, using
properties such a job sounds about right.</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Can you paste the complete error message? Also, please
inform what you set the property value to, and where the tip file is
located.</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">I suspect that you will need to use a JSP file
- typically the tip_file's template (which is usually found
as the property template-elements) - to render the content of
your tip file. You would then include this JSP file inside your template
code, not the tip file itself. </font></span><span><font face="Arial" size="2" color="#0000ff">Note that I am
not totally sure of this, as I rarely use the xmlpage
myself.</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Best regards,</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2" color="#0000ff">Paul</font></span></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div dir="ltr" lang="en-us" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a>
[mailto:<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a>] <b>On Behalf Of </b>Yogesh
Mujumdar<br><b>Sent:</b> 12. februar 2010 09:34<br><b>To:</b>
<a href="mailto:opencms-dev@opencms.org" target="_blank">opencms-dev@opencms.org</a><br><b>Subject:</b> [opencms-dev] include xmlpage
content from template<br></font><br></div><div><div></div><div class="h5">
<div></div>Dear All,<br><br>I have a simple template which is supposed to show
the page content. The template has a Tips section where I need to display
tips. These requirement is that the tips have to be editable at page level.
Tips will be HTML content(<b>xmlpage</b>). <br><br>The solution that I came
across(<b>which does not work</b>) was to define a property called as
<b>tip_file</b> for every page and specify a file name which needs to be shown
as a tip. In the template I get the property(<b>tip_file</b>) of the page and
make a URI to the file using the context uri and foldername and the tip
filename. I then include this file in the template with include method of
CmsJspActionElement object. When I view the file with <b>tip_file</b> property
set to some <b>xmlpage</b>, I get and error which says
<b>"/opencms/opencms/test/mytip.html"</b> is not accessible, though it is
available in the folder and is accessible if viewed independently.<br><br>Any
other quick and smart way of doing it?<br><br clear="all">--
Yogesh<br><br>Believe with all your heart that how you live your life makes a
difference. --Colin Beavan <br></div></div></blockquote></div>
<br><br>
_______________________________________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br></blockquote></div><br>