You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by mu baosen <mu...@gmail.com> on 2006/01/11 09:43:46 UTC

jsp and html

Hello, everyone.

I implement doView() method of portlet as following:

public void doView(RenderRequest request, RenderResponse response)
   throws PortletException, IOException {

   PortletContext context = getPortletContext();
   PortletRequestDispatcher rd = context.getRequestDispatcher
("/WEB-INF/view/test.html");
   rd.include(request, response);
 }

The content displayed in IE 6.0 is blank. But I rename test.html to
test.jsp(only
change the file extension), it displays right. Why?

Thanks.

Re: jsp and html

Posted by Stefano Bianchi <st...@softeco.it>.
INSTRUCTIONS VALID FOR J1.5 and previous versions... please confirm for J2!

Sorry, this uses FileServerPortlet and not HTMLPortlet, it depends on 
versions... anyway there are examples in portlet demo in Jetspeed!

If you have many html files to show and you want to have one portlet for 
each file, you simply have to :

- define a ***.xreg file (name it as you want!) in [Jetspeed]\WEB-INF\conf 
containing a portlet definition for each html file (you can change the 
location of html files, just edit the <url> tag):

<?xml version="1.0" encoding="UTF-8"?>
<registry>
    <portlet-entry name="Home" hidden="false" type="ref" parent="HTML" 
application="false">
        <meta-info>
            <title>Home</title>
        </meta-info>
        <classname>org.apache.jetspeed.portal.portlets.FileServerPortlet</classname>
        <url cachedOnURL="false">/my_html_pages_directory/home.html</url>
        <category>my_category</category>
    </portlet-entry>
...
</registry>

- copy all html files in [JETSPEED]/my_html_pages_directory (or change the 
directory accordingly to <url> tag)

- from admin tools, simply add the portlets you defined in the panels you 
create for your users.

NOTE:
- each portlet should have a different <portlet-entry name="">!!!
- <title>Home</title> is what is shown as title of the portlet
- <category> helps you in finding your portlets when using filter in admin 
tools!

I hope it helps ;-)
Stefano


----- Original Message ----- 
From: "mu baosen" <mu...@gmail.com>
To: "Jetspeed Users List" <je...@portals.apache.org>
Sent: Wednesday, January 11, 2006 10:18 AM
Subject: Re: jsp and html


>
> Stefano,
> Thanks.


   I want to show difference html page in difference portlet window. A large
number of them,   so I don't want to rename all of them. I think a html page
would work well.But I encounted this problem. How to resolve?

   Thanks.




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: jsp and html

Posted by mu baosen <mu...@gmail.com>.
>
> Stefano,
> Thanks.


   I want to show difference html page in difference portlet window. A large
number of them,   so I don't want to rename all of them. I think a html page
would work well.But I encounted this problem. How to resolve?

   Thanks.

Re: jsp and html

Posted by Stefano Bianchi <st...@softeco.it>.
Hello,
maybe a silly observation...
Why are you implementing a portlet to show a html file?
Could you not use a htmlportlet?
Cheers
Stefano

----- Original Message ----- 
From: "mu baosen" <mu...@gmail.com>
To: "jetspeed-user" <je...@portals.apache.org>
Sent: Wednesday, January 11, 2006 9:43 AM
Subject: jsp and html


Hello, everyone.

I implement doView() method of portlet as following:

public void doView(RenderRequest request, RenderResponse response)
   throws PortletException, IOException {

   PortletContext context = getPortletContext();
   PortletRequestDispatcher rd = context.getRequestDispatcher
("/WEB-INF/view/test.html");
   rd.include(request, response);
 }

The content displayed in IE 6.0 is blank. But I rename test.html to
test.jsp(only
change the file extension), it displays right. Why?

Thanks.




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org