You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by eg...@optonline.net on 2006/01/18 14:58:23 UTC

Tapestry Configuration for Portal Server?

Can someone tell me how the configuration for ognl resolution differs between a servlet environment and a portlet environment?

I am trying to come up to speed with using Tapestry for Websphere Portal 5.1
I am developing using RAD 6.
I have successfully deployed the Hello World tutorial as a portlet, but I am having trouble with the Direct Link tutorial.  Apparently, I don't have things wired up correctly, as I am getting a BindingException.  My class that extends BasePage is not being found.

Here is the relevant excerpt of the exception:

org.apache.tapestry.BindingException
Unable to read OGNL expression '<parsed OGNL expression>' of $BasePage_3@48500da0[DirectLink]: $BasePage_3.counter
binding ExpressionBinding[DirectLink counter]  
location context:/DirectLink.html, line 3
1 <p> 
2 The current value is:  
3 <span style="font-size:xx-large"><span jwcid="@Insert" value="ognl:counter">37</span></span> 
4 </p>  
5  
6 <p> 
7 <a href="#" jwcid="@DirectLink" listener="listener:doClick">increment counter</a> 
8 </p> 
 

org.apache.hivemind.ApplicationRuntimeException
Unable to read OGNL expression '<parsed OGNL expression>' of $BasePage_3@48500da0[DirectLink]: $BasePage_3.counter
component $BasePage_3@48500da0[DirectLink]  
location context:/DirectLink.html 

ognl.NoSuchPropertyException
$BasePage_3.counter
name counter  
target $BasePage_3@48500da0[DirectLink]  

ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123) 


My assumption is that my template, DirectLink.html, requires a corresponding class of the same name.  This is the source of DirectLink.java (Note: I've commented out annotations, as they are unsupported in jdk 1.4, and hard-coded a counter attribute just for initial testing.  I also created copies named Home.java and View.java with the same code, but to no effect):

package tutorial.forms.pages;

// import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.html.BasePage;

public abstract class DirectLink extends BasePage
{
    // @Persist
    private int counter = 17;
    public abstract int getCounter();
    public abstract void setCounter(int counter);
    
    public void doClick()
    {
        int counter = getCounter();
        
        counter++;
        
        setCounter(counter);
    }
}


Lastly, I have app.application in my WEB-INF folder with the following contents:

<?xml version="1.0"?>

<!DOCTYPE application PUBLIC 
  "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
  
<application>  
  <meta key="org.apache.tapestry.page-class-packages" value="tutorial.forms.pages"/>

</application>


Have I overlooked something, or does portal require something different?

Regards,
Ed




 
 


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


Re: Tapestry Configuration for Portal Server?

Posted by Ed Trembicki-Guy <eg...@optonline.net>.
Ed Trembicki-Guy <eguy66 <at> optonline.net> writes:

> Only one thing is left to have this test run as intended.  I have confirmed 
> that the doClick method is being invoked, but the displayed counter value 
does 
> not change from 0.  I need to determine the equivalent 1.4 construct for the 
>  <at> persist annotation.
> 

The answer was in the tapestry-portlet documentation under "coding issues".
I needed to add persist="session" to my property tag.



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


Re: Tapestry Configuration for Portal Server?

Posted by Ed Trembicki-Guy <eg...@optonline.net>.
Andrei Chiritescu <andrei.chiritescu <at> gmail.com> writes:

> 
> Hi Ed,
> 
> Do you have you compiled classes in the "\WEB-INF\classes" ?  I seem to
> remember that this location was necessary.
> If so have you tried to specify the class attribute to the
> <page-specification> ?
> 
> Regards,
> Andrei Chiritescu
> 
Thanks Andrei.  I am making some progress.  I did some cutting and pasting 
from other examples.  I defined a DLTest.page file in the web context root as 
follows:

{begin file DLTest.page}
<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<page-specification class="tutorial.forms.pages.DLTest">
	<component id="counter" type="Insert">
		<binding name="value" value="ognl:counter"/>
	</component>
</page-specification>
{end file DLTest.page}

I also defined a hivemodule.xml file in \WEB-INF\ as follows:

{begin file hivemodule.xml}
<?xml version="1.0"?>
<module id="taplet" version="4.0.0" package="tutorial.forms.pages">
  
  Application module for the Test Tapestry Portal Application.
    
  <implementation service-id="tapestry.portlet.resolver.PortletPageResolver">
    <interceptor service-id="hivemind.LoggingInterceptor"/>
  </implementation>  
  
  <service-point id="ClickCounter">
    <invoke-factory>
      <construct class="DLTest">
        <set-object property="doClick" value="service:DLTest"/>
      </construct>
    </invoke-factory>
  </service-point>
</module>
{end file hivemodule.xml}

The addition of these files has eliminated the runtime exceptions.  I'm not 
sure whether or not both files are necessary, or if I'm mixing and matching, 
and could have accomplished the same using one or the other type of file.
Only one thing is left to have this test run as intended.  I have confirmed 
that the doClick method is being invoked, but the displayed counter value does 
not change from 0.  I need to determine the equivalent 1.4 construct for the 
@persist annotation.

Regards,
Ed



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


Re: Tapestry Configuration for Portal Server?

Posted by Andrei Chiritescu <an...@gmail.com>.
Hi Ed,

Do you have you compiled classes in the "\WEB-INF\classes" ?  I seem to
remember that this location was necessary.
If so have you tried to specify the class attribute to the
<page-specification> ?

Regards,
Andrei Chiritescu

On 1/19/06, Ed Trembicki-Guy <eg...@optonline.net> wrote:
>
> Raul Raja Martinez <dobleerre <at> estudiowebs.com> writes:
>
> >
> > A long time ago in this list (in 2003) Howard said that:
> >
> > "If you servlet is named myservlet then Tapestry looks for
> > WEB-INF/myservlet.application"
> >
> > I don't know if this still applies but you might want to check on that.
> >
> Yes, I stumbled on that documentation.  Here is my servlet definition in
> web.xml:
>
>         <servlet>
>                 <servlet-name>ApplicationServlet</servlet-name>
>                 <servlet-class>org.apache.tapestry.ApplicationServlet
> </servlet-
> class>
>                 <load-on-startup>1</load-on-startup>
>         </servlet>
>         <servlet-mapping>
>                 <servlet-name>ApplicationServlet</servlet-name>
>                 <url-pattern>/app</url-pattern>
>         </servlet-mapping>
>
> I renamed /WEB-INF/app.application to
> /WEB-INF/ApplicationServlet.application
> Still no change.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Tapestry Configuration for Portal Server?

Posted by Ed Trembicki-Guy <eg...@optonline.net>.
Raul Raja Martinez <dobleerre <at> estudiowebs.com> writes:

> 
> A long time ago in this list (in 2003) Howard said that:
> 
> "If you servlet is named myservlet then Tapestry looks for 
> WEB-INF/myservlet.application"
> 
> I don't know if this still applies but you might want to check on that.
> 
Yes, I stumbled on that documentation.  Here is my servlet definition in 
web.xml:

	<servlet>
		<servlet-name>ApplicationServlet</servlet-name>
		<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-
class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>ApplicationServlet</servlet-name>
		<url-pattern>/app</url-pattern>
	</servlet-mapping>

I renamed /WEB-INF/app.application to /WEB-INF/ApplicationServlet.application
Still no change.



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


Re: Tapestry Configuration for Portal Server?

Posted by Raul Raja Martinez <do...@estudiowebs.com>.
A long time ago in this list (in 2003) Howard said that:

"If you servlet is named myservlet then Tapestry looks for 
WEB-INF/myservlet.application"

I don't know if this still applies but you might want to check on that.

Ed Trembicki-Guy wrote:
>> Raul Raja Martinez <dobleerre <at> estudiowebs.com> writes:
> 
>> I don't think Tapestry cares, but why are you calling your .page 
>> DirectLink? again I don't think it does matter but is kind of awkward to 
>> call a .page "DirectLink" which is also a core tapestry component.
>> I wonder if the order in which tapestry looks for things it's causing 
>> this behavior,
>> just some thoughts.
>>
> 
> I renamed the page template to DLTest.html and the class file to DLTest.java.  
> This had no effect.  Is there any way to confirm that the file, 
> app.application is being read on startup? That file is located in the /WEB-INF 
> folder of the web context root.  I also tried creating an /app folder under 
> the web context root and copying app.application there, but that also had no 
> effect.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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


Re: Tapestry Configuration for Portal Server?

Posted by Ed Trembicki-Guy <eg...@optonline.net>.
> Raul Raja Martinez <dobleerre <at> estudiowebs.com> writes:

> 
> I don't think Tapestry cares, but why are you calling your .page 
> DirectLink? again I don't think it does matter but is kind of awkward to 
> call a .page "DirectLink" which is also a core tapestry component.
> I wonder if the order in which tapestry looks for things it's causing 
> this behavior,
> just some thoughts.
> 

I renamed the page template to DLTest.html and the class file to DLTest.java.  
This had no effect.  Is there any way to confirm that the file, 
app.application is being read on startup? That file is located in the /WEB-INF 
folder of the web context root.  I also tried creating an /app folder under 
the web context root and copying app.application there, but that also had no 
effect.




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


Re: Tapestry Configuration for Portal Server?

Posted by Raul Raja Martinez <do...@estudiowebs.com>.
I don't think Tapestry cares, but why are you calling your .page 
DirectLink? again I don't think it does matter but is kind of awkward to 
call a .page "DirectLink" which is also a core tapestry component.
I wonder if the order in which tapestry looks for things it's causing 
this behavior,
just some thoughts.



eguy66@optonline.net wrote:
> Can someone tell me how the configuration for ognl resolution differs between a servlet environment and a portlet environment?
> 
> I am trying to come up to speed with using Tapestry for Websphere Portal 5.1
> I am developing using RAD 6.
> I have successfully deployed the Hello World tutorial as a portlet, but I am having trouble with the Direct Link tutorial.  Apparently, I don't have things wired up correctly, as I am getting a BindingException.  My class that extends BasePage is not being found.
> 
> Here is the relevant excerpt of the exception:
> 
> org.apache.tapestry.BindingException
> Unable to read OGNL expression '<parsed OGNL expression>' of $BasePage_3@48500da0[DirectLink]: $BasePage_3.counter
> binding ExpressionBinding[DirectLink counter]  
> location context:/DirectLink.html, line 3
> 1 <p> 
> 2 The current value is:  
> 3 <span style="font-size:xx-large"><span jwcid="@Insert" value="ognl:counter">37</span></span> 
> 4 </p>  
> 5  
> 6 <p> 
> 7 <a href="#" jwcid="@DirectLink" listener="listener:doClick">increment counter</a> 
> 8 </p> 
>  
> 
> org.apache.hivemind.ApplicationRuntimeException
> Unable to read OGNL expression '<parsed OGNL expression>' of $BasePage_3@48500da0[DirectLink]: $BasePage_3.counter
> component $BasePage_3@48500da0[DirectLink]  
> location context:/DirectLink.html 
> 
> ognl.NoSuchPropertyException
> $BasePage_3.counter
> name counter  
> target $BasePage_3@48500da0[DirectLink]  
> 
> ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123) 
> 
> 
> My assumption is that my template, DirectLink.html, requires a corresponding class of the same name.  This is the source of DirectLink.java (Note: I've commented out annotations, as they are unsupported in jdk 1.4, and hard-coded a counter attribute just for initial testing.  I also created copies named Home.java and View.java with the same code, but to no effect):
> 
> package tutorial.forms.pages;
> 
> // import org.apache.tapestry.annotations.Persist;
> import org.apache.tapestry.html.BasePage;
> 
> public abstract class DirectLink extends BasePage
> {
>     // @Persist
>     private int counter = 17;
>     public abstract int getCounter();
>     public abstract void setCounter(int counter);
>     
>     public void doClick()
>     {
>         int counter = getCounter();
>         
>         counter++;
>         
>         setCounter(counter);
>     }
> }
> 
> 
> Lastly, I have app.application in my WEB-INF folder with the following contents:
> 
> <?xml version="1.0"?>
> 
> <!DOCTYPE application PUBLIC 
>   "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
>   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
>   
> <application>  
>   <meta key="org.apache.tapestry.page-class-packages" value="tutorial.forms.pages"/>
> 
> </application>
> 
> 
> Have I overlooked something, or does portal require something different?
> 
> Regards,
> Ed
> 
> 
> 
> 
>  
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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