You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by bu...@apache.org on 2004/03/12 09:15:19 UTC
DO NOT REPLY [Bug 27621] New: -
Reusing pooled engines may lead to wrong generated URLs
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27621>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=27621
Reusing pooled engines may lead to wrong generated URLs
Summary: Reusing pooled engines may lead to wrong generated URLs
Product: Tapestry
Version: 3.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Framework
AssignedTo: tapestry-dev@jakarta.apache.org
ReportedBy: Michael.Frericks@sparkassen-informatik.de
1. Error description:
Reusing pooled engines may lead to wrong generated URLs.
The following servlet-mapping
<servlet-mapping>
<servlet-name>MyApplicationServlet</servlet-name>
<url-pattern>*.place</url-pattern>
</servlet-mapping>
can be used to provide different information in the servlet-path
of different users.
The AbstractEngine stores this servlet-path in _servletPath
and the engine ends up in the ApplicationServlet._enginePool
for reuse under certain conditions.
ApplicationServlet#doService:
...
// No session; the engine contains no state particular to
// the client (except for locale). Don't throw it away,
// instead save it in a pool for later reuse (by this, or another
// client in the same locale).
if (LOG.isDebugEnabled())
LOG.debug("Returning " + engine + " to pool.");
_enginePool.store(engine.getLocale(), engine);
If this engine is reused by another client, the _servletPath
will not be updated to the one of the new client, since
AbstractEngine#setupForRequest:
...
if (_servletPath == null)
{
...
}
This my lead to wrong URLs since in e.g EngineServiceLink
the servletPath of the engine is used.
EngineServiceLink#constructURL:
buffer.append(_cycle.getEngine().getServletPath());
Conclusion
a) Reset the _servletPath, when sending thee engine to the pool
b) Do not pool engines anyway
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org