<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [opencms-dev] jsp and html page</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=2> Wow, that's great.</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> Today is a happy day to me. :-)</FONT>
</P>
<P><FONT SIZE=2> Thanks,</FONT>
</P>
<P><FONT SIZE=2> Yendung</FONT>
</P>
<P><FONT SIZE=2> </FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Jens Rickhoff [<A HREF="mailto:jens@visualteam.de">mailto:jens@visualteam.de</A>]</FONT>
<BR><FONT SIZE=2>Sent: 13 August 2003 15:08</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Subject: Re: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<P><FONT SIZE=2>RE: [opencms-dev] jsp and html pageHi Yendung,</FONT>
</P>
<P><FONT SIZE=2>you can use JavaDoc to create documentation from OpenCMS' sourcecode.</FONT>
<BR><FONT SIZE=2>As for the "file exists" method, there already was a thread a couple of</FONT>
<BR><FONT SIZE=2>weeks ago:</FONT>
</P>
<P><FONT SIZE=2><A HREF="http://mail.opencms.org/pipermail/opencms-dev/2003q3/006363.html" TARGET="_blank">http://mail.opencms.org/pipermail/opencms-dev/2003q3/006363.html</A></FONT>
</P>
<P><FONT SIZE=2>To get faster help, you should check the mailing list archive on opencms.org</FONT>
<BR><FONT SIZE=2>first, many of "newbie" issues have been discussed previously.</FONT>
</P>
<P><FONT SIZE=2>Glad I could help :)</FONT>
</P>
<P><FONT SIZE=2>Jens</FONT>
</P>
<P><FONT SIZE=2>----- Original Message -----</FONT>
<BR><FONT SIZE=2>From: Nguyen La Yen Dung</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Sent: Wednesday, August 13, 2003 10:03 AM</FONT>
<BR><FONT SIZE=2>Subject: RE: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<BR>
<BR>
<P><FONT SIZE=2> Hi Jens,</FONT>
<BR><FONT SIZE=2> You couldn't imagine that how much you help me.</FONT>
<BR><FONT SIZE=2> That's really interesting - cmso.readFile().getContents();</FONT>
<BR><FONT SIZE=2> Is there anyway to check if the file exists?</FONT>
<BR><FONT SIZE=2> You see, Opencms gives us its source code and no guide document. I look</FONT>
<BR><FONT SIZE=2>like a blind.</FONT>
<BR><FONT SIZE=2> Regards,</FONT>
<BR><FONT SIZE=2> Yendung</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Jens Rickhoff [<A HREF="mailto:jens@visualteam.de">mailto:jens@visualteam.de</A>]</FONT>
<BR><FONT SIZE=2>Sent: 13 August 2003 14:12</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Subject: Re: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<P><FONT SIZE=2>RE: [opencms-dev] jsp and html pageHi Yendung,</FONT>
<BR><FONT SIZE=2>You don't need to out.print() the whole thing. And you can't. Just writing:</FONT>
<BR><FONT SIZE=2>cms.include(filename);</FONT>
<BR><FONT SIZE=2>will include the content of filename at that position. If you want to work</FONT>
<BR><FONT SIZE=2>with the content of filename, you can use the following structure:</FONT>
<BR><FONT SIZE=2>CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,</FONT>
<BR><FONT SIZE=2>response);</FONT>
<BR><FONT SIZE=2>CmsObject cmso = cms.getCmsObject();</FONT>
<BR><FONT SIZE=2>byte[] bContent = cmso.readFile(filename).getContents();</FONT>
<BR><FONT SIZE=2>String sContent = new String(bContent,</FONT>
<BR><FONT SIZE=2>cmso.getRequestContext().getEncoding());</FONT>
<BR><FONT SIZE=2>The variable sContent now contains the content of filename as string which</FONT>
<BR><FONT SIZE=2>you</FONT>
<BR><FONT SIZE=2>then can further process.</FONT>
<BR><FONT SIZE=2>Jens</FONT>
<BR><FONT SIZE=2>----- Original Message -----</FONT>
<BR><FONT SIZE=2>From: Nguyen La Yen Dung</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Sent: Wednesday, August 13, 2003 5:23 AM</FONT>
<BR><FONT SIZE=2>Subject: RE: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<BR>
<BR>
<P><FONT SIZE=2>Hi Jens,</FONT>
<BR><FONT SIZE=2>Thank you for your reply.</FONT>
<BR><FONT SIZE=2>A little hope for my problem:-)</FONT>
<BR><FONT SIZE=2>The include() method gets a String parameter-That is what I'm looking for</FONT>
<BR><FONT SIZE=2>but now I'm facing another error:</FONT>
<BR><FONT SIZE=2>"Incompatible type for method. Can't convert void to java.lang.Object.</FONT>
<BR><FONT SIZE=2>out.print(cms.include(filename)); ^ 1 error, 1 warning "</FONT>
<BR><FONT SIZE=2>Have you ever met this error message?</FONT>
<BR><FONT SIZE=2>Could you please help me once more time?</FONT>
<BR><FONT SIZE=2>Thank you,</FONT>
<BR><FONT SIZE=2>Yendung</FONT>
</P>
<BR>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Jens Rickhoff [<A HREF="mailto:jens@visualteam.de">mailto:jens@visualteam.de</A>]</FONT>
<BR><FONT SIZE=2>Sent: 12 August 2003 18:25</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Subject: Re: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<P><FONT SIZE=2>jsp and html pageHi Yendung,</FONT>
<BR><FONT SIZE=2>try using</FONT>
<BR><FONT SIZE=2><%=cms.include(filename) %></FONT>
<BR><FONT SIZE=2>instead. cms is a CmsJspActionElement object.</FONT>
<BR><FONT SIZE=2>Hope that helps. I think the cms tags are evaluated before the JSP code is</FONT>
<BR><FONT SIZE=2>executed.</FONT>
<BR><FONT SIZE=2>Correct me if I'm wrong.</FONT>
<BR><FONT SIZE=2>Cheers,</FONT>
<BR><FONT SIZE=2>Jens</FONT>
<BR><FONT SIZE=2>----- Original Message -----</FONT>
<BR><FONT SIZE=2>From: Nguyen La Yen Dung</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, August 12, 2003 1:07 PM</FONT>
<BR><FONT SIZE=2>Subject: RE: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<P><FONT SIZE=2>Hi,</FONT>
<BR><FONT SIZE=2>I don't know if it is correct or not, but it only works with</FONT>
<BR><FONT SIZE=2><cms:include file="mypage.html" /></FONT>
<BR><FONT SIZE=2>If any one knows the reason, please explain me. Thanks.</FONT>
<BR><FONT SIZE=2>Another problem I've met is: I don't want to hardcode the file name, I want</FONT>
<BR><FONT SIZE=2>to use a String variable here,</FONT>
<BR><FONT SIZE=2>but <cms:include file="<%= filename %>" /> will raise an exception File not</FONT>
<BR><FONT SIZE=2>found.</FONT>
<BR><FONT SIZE=2>I see the value of <%= filename %> doesnot parse.</FONT>
<BR><FONT SIZE=2>Why?</FONT>
<BR><FONT SIZE=2>Please help me.</FONT>
<BR><FONT SIZE=2>Yendung</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><FONT SIZE=2> -----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Nguyen La Yen Dung</FONT>
<BR><FONT SIZE=2>Sent: 12 August 2003 11:36</FONT>
<BR><FONT SIZE=2>To: opencms-dev@opencms.org</FONT>
<BR><FONT SIZE=2>Subject: [opencms-dev] jsp and html page</FONT>
</P>
<BR>
<BR>
<BR>
<P><FONT SIZE=2> Hi,</FONT>
<BR><FONT SIZE=2> I meet a problem with <jsp:include> tag. Please help.</FONT>
<BR><FONT SIZE=2> I create a simple html page in Opencms (mypage.html):</FONT>
<BR><FONT SIZE=2> <![CDATA[</FONT>
<BR><FONT SIZE=2> Hello</FONT>
<BR><FONT SIZE=2> ]]></FONT>
</P>
<BR>
<P><FONT SIZE=2> In jsp file, I use</FONT>
<BR><FONT SIZE=2><jsp:include page="mypage.html" flush="true"/></FONT>
<BR><FONT SIZE=2> Run this jsp, an empty page is shown.</FONT>
<BR><FONT SIZE=2> What's wrong?</FONT>
<BR><FONT SIZE=2>Thank you,</FONT>
<BR><FONT SIZE=2> Yendung</FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>This mail is send to you from the opencms-dev mailing list</FONT>
<BR><FONT SIZE=2>To change your list options, or to unsubscribe from the list, please visit</FONT>
<BR><FONT SIZE=2><A HREF="http://mail.opencms.org/mailman/listinfo/opencms-dev" TARGET="_blank">http://mail.opencms.org/mailman/listinfo/opencms-dev</A></FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>This mail is send to you from the opencms-dev mailing list</FONT>
<BR><FONT SIZE=2>To change your list options, or to unsubscribe from the list, please visit</FONT>
<BR><FONT SIZE=2><A HREF="http://mail.opencms.org/mailman/listinfo/opencms-dev" TARGET="_blank">http://mail.opencms.org/mailman/listinfo/opencms-dev</A></FONT>
</P>
<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>This mail is send to you from the opencms-dev mailing list</FONT>
<BR><FONT SIZE=2>To change your list options, or to unsubscribe from the list, please visit</FONT>
<BR><FONT SIZE=2><A HREF="http://mail.opencms.org/mailman/listinfo/opencms-dev" TARGET="_blank">http://mail.opencms.org/mailman/listinfo/opencms-dev</A></FONT>
</P>
</BODY>
</HTML>