You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ezra Epstein <ee...@prajnait.com> on 2004/02/07 06:41:09 UTC
At what point does a request become single threaded?
I remember reading that by the time a page instance is asked to render the
tapestry application will guarantee that the page instance is being accessed
by a single thread.
What I'm wondering is at what point in the request/response loop does this
single-threaded guarantee kick-in. In particular, does it hold at the time
of the Engine's service() method?
If you are curious about why this question is being asked... We're using
Hibernate for back-end access. We haven't yet geared up with Spring
Framework (a likely next step for us). We want to guarantee that a session
(a) exists and (b) is properly closed at the end of the response. We've put
this logic in the Engine's service method and realize that, given our
one-hibernate-session-per-thread approach, our code depends on the
application servlet guaranteeing single-threadedness.
THanks,
== Ezra e.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
problem when doing callback
Posted by Krthekeyan Suryanarayanan <kr...@verchaska.com>.
Hi all,
can u guys help me in working out the following scenerio.
exception
***************
ApplicationRunTime Exception
**************************************
unable to invoke the listener method when it is performing callback ..
.page entries
*****************
<property-specification name="callback"
type="org.apache.tapestry.callback.PageCallback" persistent="yes"/>
I have a MyPage which extend BasePage
public abstract PageCallback getCallback();
public abstract void setCallback(PageCallback value);
formSubmit(IRequestCycle cycle)
{
PageCallback pagecallback = getCallback();
try
{
// somecondition
}catch(Exception e)
{
pagecallback.performCallback(cycle);
}
}
what could be the solution.
thanks,
krthekeyan.s
Actual error pasted
*********************
org.apache.tapestry.ApplicationRuntimeException
***********************************************************
Unable to invoke method selectToppings on
com.vtech.research.tapestry.components.demo.checkbox.delegator.SelectedCheckBox$Enhance_35@1909385[SelectedCheckBox]:
null
java.lang.NullPointerException
***********************************
Stack Trace:
com.vtech.research.tapestry.components.demo.checkbox.delegator.SelectedCheckBox.selectToppings(SelectedCheckBox.java:85)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.tapestry.listener.ListenerMap.invokeTargetMethod(ListenerMap.java:301)
org.apache.tapestry.listener.ListenerMap.access$100(ListenerMap.java:87)
org.apache.tapestry.listener.ListenerMap$SyntheticListener.invoke(ListenerMap.java:141)
org.apache.tapestry.listener.ListenerMap$SyntheticListener.actionTriggered(ListenerMap.java:146)
org.apache.tapestry.form.Form.renderComponent(Form.java:457)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:880)
org.apache.tapestry.form.Form.rewind(Form.java:602)
org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:475)
org.apache.tapestry.form.Form.trigger(Form.java:616)
org.apache.tapestry.engine.DirectService.service(DirectService.java:210)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:912)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:238)
org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:367)
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
java.lang.Thread.run(Thread.java:534)
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: static-binding ... should it be used?
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 7, 2004, at 1:21 AM, Ezra Epstein wrote:
> In a somewhat recent post, Howard mentioned that if he could re-write
> Tapestry today, one change would be to remove static-binding(s). I'm
> wondering, given that, how would one express the following without
> using
> one?
>
> <component id="documentName" type="ValidField">
> <binding name="value" expression="visit.docName"/>
> <static-binding name="displayName" value="Document Name"/>
> </component>
<binding name="displayName" expression="'Document Name'"/>
Although static bindings are fine with me - keeps things clearer, it
seems.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: static-binding ... should it be used?
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
What I meant was to use the same syntax in the page specification as is used in the HTML template.
But its unimportant, since we aren't going to do that!
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components
http://howardlewisship.com
> -----Original Message-----
> From: Ezra Epstein [mailto:eepstein@prajnait.com]
> Sent: Saturday, February 07, 2004 1:21 AM
> To: Tapestry users
> Subject: static-binding ... should it be used?
>
>
> In a somewhat recent post, Howard mentioned that if he could re-write
> Tapestry today, one change would be to remove static-binding(s). I'm
> wondering, given that, how would one express the following
> without using
> one?
>
> <component id="documentName" type="ValidField">
> <binding name="value" expression="visit.docName"/>
> <static-binding name="displayName" value="Document Name"/>
> </component>
>
> = Ezra E.
>
>
> ---------------------------------------------------------------------
> 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
static-binding ... should it be used?
Posted by Ezra Epstein <ee...@prajnait.com>.
In a somewhat recent post, Howard mentioned that if he could re-write
Tapestry today, one change would be to remove static-binding(s). I'm
wondering, given that, how would one express the following without using
one?
<component id="documentName" type="ValidField">
<binding name="value" expression="visit.docName"/>
<static-binding name="displayName" value="Document Name"/>
</component>
= Ezra E.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org