AW: [opencms-dev] jsp and html page
Mario Wallnöfer
mario.wallnoefer at msk-informatik.at
Thu Aug 21 18:15:01 CEST 2003
Dear Jens,
i tried to implement the code you described below.
it works without a problem, but i only can see a XML Structure like
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <PAGE>
<class>com.opencms.template.CmsXmlTemplate</class>
<masterTemplate>/system/modules/at.msk.opencms/templates/msk</masterTemplate
>
- <ELEMENTDEF name="body">
<CLASS>com.opencms.template.CmsXmlTemplate</CLASS>
<TEMPLATE>/system/bodies/msk/de/index.html</TEMPLATE>
</ELEMENTDEF>
</PAGE>
that is not, what i want to read, i want to get the HTML-Content,
the user filled in.
thanks for your help
Mario
-----Ursprüngliche Nachricht-----
Von: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org]Im Auftrag von Jens Rickhoff
Gesendet: Mittwoch, 13. August 2003 09:12
An: opencms-dev at opencms.org
Betreff: 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
More information about the opencms-dev
mailing list