[opencms-dev] jsp and html page

Nguyen La Yen Dung dny at sdcgrp.com
Wed Aug 13 11:11:01 CEST 2003


 Wow, that's great.
 
 Today is a happy day to me. :-)

 Thanks,

 Yendung

 

-----Original Message-----
From: Jens Rickhoff [mailto:jens at visualteam.de]
Sent: 13 August 2003 15:08
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] jsp and html page


RE: [opencms-dev] jsp and html pageHi Yendung,

you can use JavaDoc to create documentation from OpenCMS' sourcecode.
As for the "file exists" method, there already was a thread a couple of
weeks ago:

http://mail.opencms.org/pipermail/opencms-dev/2003q3/006363.html

To get faster help, you should check the mailing list archive on opencms.org
first, many of "newbie" issues have been discussed previously.

Glad I could help :)

Jens

----- Original Message -----
From: Nguyen La Yen Dung
To: opencms-dev at opencms.org
Sent: Wednesday, August 13, 2003 10:03 AM
Subject: RE: [opencms-dev] jsp and html page




 Hi Jens,
 You couldn't imagine that how much you help me.
 That's really interesting - cmso.readFile().getContents();
 Is there anyway to check if the file exists?
 You see, Opencms gives us its source code and no guide document. I look
like a blind.
 Regards,
 Yendung

-----Original Message-----
From: Jens Rickhoff [mailto:jens at visualteam.de]
Sent: 13 August 2003 14:12
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] jsp and html page


RE: [opencms-dev] jsp and html pageHi Yendung,
You don't need to out.print() the whole thing. And you can't. Just writing:
cms.include(filename);
will include the content of filename at that position. If you want to work
with the content of filename, you can use the following structure:
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
CmsObject cmso = cms.getCmsObject();
byte[] bContent = cmso.readFile(filename).getContents();
String sContent = new String(bContent,
cmso.getRequestContext().getEncoding());
The variable sContent now contains the content of filename as string which
you
then can further process.
Jens
----- Original Message -----
From: Nguyen La Yen Dung
To: opencms-dev at opencms.org
Sent: Wednesday, August 13, 2003 5:23 AM
Subject: RE: [opencms-dev] jsp and html page




Hi Jens,
Thank you for your reply.
A little hope for my problem:-)
The include() method gets a String parameter-That is what I'm looking for
but now I'm facing another error:
"Incompatible type for method. Can't convert void to java.lang.Object.
out.print(cms.include(filename)); ^ 1 error, 1 warning "
Have you ever met this error message?
Could you please help me once more time?
Thank you,
Yendung


-----Original Message-----
From: Jens Rickhoff [mailto:jens at visualteam.de]
Sent: 12 August 2003 18:25
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] jsp and html page


jsp and html pageHi Yendung,
try using
<%=cms.include(filename) %>
instead. cms is a CmsJspActionElement object.
Hope that helps. I think the cms tags are evaluated before the JSP code is
executed.
Correct me if I'm wrong.
Cheers,
Jens
----- Original Message -----
From: Nguyen La Yen Dung
To: opencms-dev at opencms.org
Sent: Tuesday, August 12, 2003 1:07 PM
Subject: RE: [opencms-dev] jsp and html page


Hi,
I don't know if it is correct or not, but it only works with
<cms:include file="mypage.html" />
If any one knows the reason, please explain me. Thanks.
Another problem I've met is: I don't want to hardcode the file name, I want
to use a String variable here,
but <cms:include file="<%= filename %>" /> will raise an exception File not
found.
I see the value of <%= filename %> doesnot parse.
Why?
Please help me.
Yendung





 -----Original Message-----
From: Nguyen La Yen Dung
Sent: 12 August 2003 11:36
To: opencms-dev at opencms.org
Subject: [opencms-dev] jsp and html page




 Hi,
 I meet a problem with <jsp:include> tag. Please help.
 I create a simple html page in Opencms (mypage.html):
 <![CDATA[
  Hello
 ]]>


 In jsp file, I use
<jsp:include page="mypage.html" flush="true"/>
 Run this jsp, an empty page is shown.
 What's wrong?
Thank you,
 Yendung
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev

_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20030813/8c1fa57b/attachment.htm>


More information about the opencms-dev mailing list