tags:

views:

296

answers:

1

Hi all,
I have few questions regarding java portlets ( JSR 286). My requirement is to integrate a php web site to main site of client using java portlets ( one of the options given by client).

Do we have to implement portlets for each page in target web site?
Do we have to implement separate portlets for images,css and javascript files for each web page request?
Is there any restrictions for using portlets when using AJAX in the target site?
Is there any problem with managing session in php site?
Can we access session in php server from servlet?
If you know answer for at least one of above questions please reply ASAP. I need it before tomorrow :(.

Thank you very much for taking time to read this.
Thanks & Regards,
Manjula

+2  A: 

Portlets are "mini pages" that you can combine togother in order to create a portal application (like my yahoo). They are written in Java, which means you cannot incorporate PHP page as a portlet. It also means you cannot access the PHP session (assuming that you use apache) from the portlet code.

You can look here regarding AJAX and portlets.

From your question I think you'd probably write a portlet that contains an iframe pointing at your php app.

Added Info

You can also implement your portlet to open http connection to a php page, fetch its content (like curl) and send it as the URL. In this case, I suggest to have a look at Web Services for Remote Portlets which seems more suited if you want to have portlets whose data comes from a remoe source.

David Rabinowitz
Why can't I return a php page ( which come to the portlet as an HTML) for the view of the portlet? I thought what portlet is doing is get the HTML response from external page (php or jsp) and return it to the portal with relevant customizations? Is that wrong?
Manjula
AFAIK portlets usually forward the request to a jsp, very similar to servlets. As they run inside a servlet container, you are limited in your view technologies to Java. I've also added some info to the answer based on your comment.
David Rabinowitz