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 pr...@polaris.co.in on 2005/09/14 10:09:47 UTC

RE: [J2] Issues/Findings with JSF Portlets - Portlet body missing onlytitle appears


Hi,

I have been trying to hammer this problem for around a week now but
invain.

Today I just made a replica of jsf-demo available in the J2 samples.
Just modified the Portlet app id and portlet id name for GuessNumber
portlet in the "portlet.xml" and a corresponding change in the "web.xml"
for
<init-param>
      <param-name>contextName</param-name>
      <param-value>tempjsfdemoApp</param-value>
</init-param>

under "JetspeedContainer" container declaration. Now when I tried
including portlet on a portal page through edit - select portlet option,
I again get a portlet with just the title getting displayed NO BODY.

This is strange to me as no other modification was done apart from the
ones mentioned above.

Can any one let me know if some other configuration setting or security
related entitlement stuff is to be done? Btw I had used "admin" user to
logon to J2.

Please advice.

Thanks

- Priya -
-----Original Message-----
From: priya.aiyer [mailto:priya.aiyer@polaris.co.in]
Sent: Friday, September 09, 2005 4:35 PM
To: 'Jetspeed Users List'; 'jetspeed-user@jakarta.apache.org'
Subject: RE: [J2] Issues/Findings with JSF Portlets

Hi Aaron -

Yes as you had pointed out I had been both sun jars and myfaces jar in
my lib. However, in lines with your suggestion I changed my portlet to
include myfaces implementation i.e.
org.apache.myfaces.portlet.MyFacesGenericPortlet

My app lib now matches "lib" structured mentioned by you and the
portlet.xml is

<portlet-app id="myfacesTxnStatApp"
    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
    version="1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.x
sd

http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
 <portlet id="mfTxnPerfStat">
<portlet-name>mfTxnPerfStat</portlet-name>
<display-name>MyFaces JSF(bridge) Transaction Stats</display-name>

<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet
-class>
<init-param>
	<name>default-view</name>
	<value>/txnCriteria.jsp</value>
</init-param>
<init-param>
	<name>ViewPage</name>
	<value>/txnCriteria.jsp</value>
</init-param>
<init-param>
	<name>EditPage</name>
	<value>/edit.jsp</value>
</init-param>
<init-param>
	<name>HelpPage</name>
	<value>/help.jsp</value>
</init-param>
<supports>
	<mime-type>text/html</mime-type>
	<portlet-mode>VIEW</portlet-mode>
	<portlet-mode>EDIT</portlet-mode>
	<portlet-mode>HELP</portlet-mode>
</supports>
<resource-bundle>com.polaris.pgportals.poc.bundles.Resources</resource-b
undle>
<portlet-info>
	<title>MyFaces Jsf(bridge) Transaction Stats</title>
	<short-title>MF Txn Stat</short-title>
	<keywords>MFCriteria, MFStatistics</keywords>
</portlet-info>
 </portlet>  
 </portlet-app>

I am able to run the app outside jetspeed with the url
http://localhost:8080/<appfolder>/txnCriteria.jsf

However, when included within JetSpeed, I continue to get the problem of
only title appearing and body missing.

As indicated by you on the other thread that probable cause of such
behavior is either misconfigured View Page or the resource it  referred
to caused a 500 error.  But I don't see any evidence of it in the logs
when run from Jetspeed2 and further, if that was the case I shouldn't be
able to run the app outside JetSpeed 2 as well.

Net, net I'm totally lost. Kindly suggest.

- Priya -


 <priya.aiyer <at> polaris.co.in> writes:

>
>
> Aaron -
>
> Have you tried using "jsf-portlet.jar", a bridge provided by Sun Java?
>
> Please refer to the article -
>
http://developers.sun.com/prodtech/portalserver/reference/techart/jsf-po
> rtlets.html
>
> I tried using them but face the issue of only the "Title" of the
portlet
> getting displayed and body missing in J2.
>
> - Priya -
>

No I haven't, I have generally steered clear of the sun implementations
because of a few reasons.  One is the license issues, I prefere myfaces
because of the GPL.  The other is that for jetspeed, all of the examples

use the myfaces implementation, not the sun implementation.

As I mentioned in my last post on our other thread, this may be why you
are
running into some of your problems by mixing the jar files of the two
implementations.

Since there is a portlet specification and the J2EE standards, it is of
course it the long-term goal that we should be able to swap
implementations
(ie. the jar files) in our applications and they should function
identically.
However because portlet technology is so new, it may be a little while
before this dream comes true.  Sun's implementation will no doubt work
on
their portal implementation,  but that of course does not help us for
jetspeed.

If you do not want to use the jsf bridge implementation, I suggest using

the myfaces portlet implementation:

org.apache.myfaces.portlet.MyFacesGenericPortlet

I can run my app under both jetspeed and outside of jetspeed in this
mode.
In fact, I will probably switch back to this.  Refer to the
jsf-demo-myfaces
example app (not jsf-demo).

In this case, my lib contains:

commons-beanutils-1.6.1.jar
commons-codec-1.2.jar
commons-collections-2.1.jar
commons-digester-1.5.jar
commons-el-1.0.jar
commons-logging-1.0.3.jar
log4j-1.2.8.jar
myfaces-1.0.9.jar
myfaces-jsf-api-1.0.9.jar

*NOTE* the portals-bridges-jsf-0.4-SNAPSHOT.jar is ABSENT.

And I change my portlet.xml config to be (the main change being the
portlet-class element):

<portlet-app id="jsfapp" version="1.0">
  <portlet id="manageProfile">
    <init-param>
      <name>default-view</name>
      <value>/home.jsp</value>
    </init-param>
	<init-param>
      <name>ViewPage</name>
      <value>/home.jsp</value>
    </init-param>
	<init-param>
      <name>HelpPage</name>
      <value>/help.jsp</value>
    </init-param>
    <description>My JSF App</description>
    <portlet-name>manageProfile</portlet-name>
    <display-name>My JSF App</display-name>
<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet
-class>
    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>HELP</portlet-mode>
    </supports>
    <portlet-info>
      <title>My JSF App</title>
      <short-title>My JSF App</short-title>
    </portlet-info>
  </portlet>
</portlet-app>



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


This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only.
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

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