You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alan <al...@engrm.com> on 2004/05/27 23:22:40 UTC
ServletContext.getRealPath()
I'm attempting to use cocoon.context.getRealPath() in my
flowscript. Like so:
cocoon.context.getRealPath("/WEB-INF")
However, I'm getting this exception:
org.apache.avalon.framework.CascadingRuntimeException: getRealPath is not a function.
Does cocoon expose this method?
--
Alan / alan@engrm.com / http://engrm.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Joerg Heinicke <jo...@gmx.de>.
On 29.05.2004 15:14, Alan wrote:
>>> Can anyone expand on this? I'll use this work around rather than
>>> try and ask for a vote.
>>
>>Sylvain's arguments sound very reasonable, especially the comparison to
>>a possible Java flow version (what exists in the mean time). I would ask
>>him or on the dev list about the status: "I'll check what has been
>>hidden from the environment API and start a vote on this." I don't
>>remember a vote on this.
>
>
> Yes. But what is a work around? I need to develop an application
> first, as part of my job. I can't let this depend on the outcome
> of a vote.
>
> I'll pursue the vote, but how to I getRealPath until then?
Ah, I didn't get from your sentence that the work around is still
missing. What you need to do is to look up the SourceResolver, use it to
resolve your path and release it. You can find an example at
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/forms/samples/flow/bindings.js?annotate=1.5#130
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-05-29 00:39]:
> On 29.05.2004 02:08, Alan wrote:
>
> >>Not the thread about the decision, it only refers to that one, but
> >>includes also some of the ideas:
> >>http://marc.theaimsgroup.com/?t=107996583500001&r=1&w=4
> >
> > Actually, it references the method that I'm looking to expose.
>
> Even this!
>
> > Sylvan suggests a workaround. He says:
>
> ...
>
> > Can anyone expand on this? I'll use this work around rather than
> > try and ask for a vote.
>
> Sylvain's arguments sound very reasonable, especially the comparison to
> a possible Java flow version (what exists in the mean time). I would ask
> him or on the dev list about the status: "I'll check what has been
> hidden from the environment API and start a vote on this." I don't
> remember a vote on this.
Yes. But what is a work around? I need to develop an application
first, as part of my job. I can't let this depend on the outcome
of a vote.
I'll pursue the vote, but how to I getRealPath until then?
--
Alan / alan@engrm.com / http://engrm.com/
available for contract --> http://engrm.com/the-pitch.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Joerg Heinicke <jo...@gmx.de>.
On 29.05.2004 02:08, Alan wrote:
>>Not the thread about the decision, it only refers to that one, but
>>includes also some of the ideas:
>>http://marc.theaimsgroup.com/?t=107996583500001&r=1&w=4
>
> Actually, it references the method that I'm looking to expose.
Even this!
> Sylvan suggests a workaround. He says:
...
> Can anyone expand on this? I'll use this work around rather than
> try and ask for a vote.
Sylvain's arguments sound very reasonable, especially the comparison to
a possible Java flow version (what exists in the mean time). I would ask
him or on the dev list about the status: "I'll check what has been
hidden from the environment API and start a vote on this." I don't
remember a vote on this.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-05-28 21:47]:
> On 28.05.2004 18:09, Alan wrote:
>
> >>Oh, sorry, I looked a bit to fast on it. We decided for FOM to provide
> >>as less functionality as possible. If someone has a use case for a
> >>feature not implemented like the one above he can propose it to be
> >>included. Then it can be voted about it (on the dev list of course).
> >
> >
> > What is the reasoning behind this? The getRealPath method is
> > part of the ServletContext API. Why would it be harmful to
> > expose this basic utility method? Could you point me to a thread
> > where this is hashed out? I'd like to know the issues before I
> > make the proposal.
>
> Not the thread about the decision, it only refers to that one, but
> includes also some of the ideas:
> http://marc.theaimsgroup.com/?t=107996583500001&r=1&w=4
Actually, it references the method that I'm looking to expose.
Sylvan suggests a workaround. He says:
An example: last week, a customer of mine (I do mentoring for
them and they're not subscribed to users@) asked me "I get a "no
such property or method" error when calling
context.getRealPath() in my flowscript. Why?". I answered that
this method isn't available in flowscript and provided a
10-lines workaround involving looking up the sourceresolver
and resolving a "context://" URL.
Can anyone expand on this? I'll use this work around rather than
try and ask for a vote.
--
Alan / alan@engrm.com / http://engrm.com/
available for contract --> http://engrm.com/the-pitch.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Joerg Heinicke <jo...@gmx.de>.
On 28.05.2004 18:09, Alan wrote:
>>Oh, sorry, I looked a bit to fast on it. We decided for FOM to provide
>>as less functionality as possible. If someone has a use case for a
>>feature not implemented like the one above he can propose it to be
>>included. Then it can be voted about it (on the dev list of course).
>
>
> What is the reasoning behind this? The getRealPath method is
> part of the ServletContext API. Why would it be harmful to
> expose this basic utility method? Could you point me to a thread
> where this is hashed out? I'd like to know the issues before I
> make the proposal.
Not the thread about the decision, it only refers to that one, but
includes also some of the ideas:
http://marc.theaimsgroup.com/?t=107996583500001&r=1&w=4
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-05-28 16:06]:
> On 28.05.2004 17:38, Alan wrote:
> >* Joerg Heinicke <jo...@gmx.de> [2004-05-28 15:31]:
> >
> >>> Found the code for FOM_Cocoon.java and there's this:
> >>>
> >>> /* TODO: Vote on the inclusion of this method
> >>> public String jsFunction_getRealPath(String path) {
> >>> return context.getRealPath(path);
> >>> }
> >>> */
> >>>
> > What I meant by "the issues surrounding" is, why is this method
> > commented out? Why is a vote necessary? What are the issues that
> > need to be debated before a vote occurs.
> >
> > It seems odd that this method is not implemented.
> >
> > I've uncommented the method. It works fine.
>
> Oh, sorry, I looked a bit to fast on it. We decided for FOM to provide
> as less functionality as possible. If someone has a use case for a
> feature not implemented like the one above he can propose it to be
> included. Then it can be voted about it (on the dev list of course).
What is the reasoning behind this? The getRealPath method is
part of the ServletContext API. Why would it be harmful to
expose this basic utility method? Could you point me to a thread
where this is hashed out? I'd like to know the issues before I
make the proposal.
Thank you.
--
Alan / alan@engrm.com / http://engrm.com/
available for contract --> http://engrm.com/the-pitch.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Joerg Heinicke <jo...@gmx.de>.
On 28.05.2004 17:38, Alan wrote:
> * Joerg Heinicke <jo...@gmx.de> [2004-05-28 15:31]:
>
>>> Found the code for FOM_Cocoon.java and there's this:
>>>
>>> /* TODO: Vote on the inclusion of this method
>>> public String jsFunction_getRealPath(String path) {
>>> return context.getRealPath(path);
>>> }
>>> */
>>>
> What I meant by "the issues surrounding" is, why is this method
> commented out? Why is a vote necessary? What are the issues that
> need to be debated before a vote occurs.
>
> It seems odd that this method is not implemented.
>
> I've uncommented the method. It works fine.
Oh, sorry, I looked a bit to fast on it. We decided for FOM to provide
as less functionality as possible. If someone has a use case for a
feature not implemented like the one above he can propose it to be
included. Then it can be voted about it (on the dev list of course).
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-05-28 15:31]:
> On 28.05.2004 16:57, Alan wrote:
>
> >>> I'm attempting to use cocoon.context.getRealPath() in my
> >>> flowscript. Like so:
> >>>
> >>> cocoon.context.getRealPath("/WEB-INF")
> >>>
> >>> However, I'm getting this exception:
> >>>
> >>> org.apache.avalon.framework.CascadingRuntimeException: getRealPath is
> >>> not a function.
> >>>
> >>> Does cocoon expose this method?
> >>
> >>It seems not:
> >>http://cocoon.apache.org/2.1/userdocs/flow/api.html#Context+Object
> >
> >
> > Found the code for FOM_Cocoon.java and there's this:
> >
> > /* TODO: Vote on the inclusion of this method
> > public String jsFunction_getRealPath(String path) {
> > return context.getRealPath(path);
> > }
> > */
> >
> > What are the issues surrounding this method? I'd like to use it.
> > Can this vote happen soon?
>
> This method is "surrounded" to make it available to flow script. But
> from that code it should be cocoon.getRealPath(path).
What I meant by "the issues surrounding" is, why is this method
commented out? Why is a vote necessary? What are the issues that
need to be debated before a vote occurs.
It seems odd that this method is not implemented.
I've uncommented the method. It works fine.
--
Alan / alan@engrm.com / http://engrm.com/
available for contract --> http://engrm.com/the-pitch.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Joerg Heinicke <jo...@gmx.de>.
On 28.05.2004 16:57, Alan wrote:
>>> I'm attempting to use cocoon.context.getRealPath() in my
>>> flowscript. Like so:
>>>
>>> cocoon.context.getRealPath("/WEB-INF")
>>>
>>> However, I'm getting this exception:
>>>
>>> org.apache.avalon.framework.CascadingRuntimeException: getRealPath is
>>> not a function.
>>>
>>> Does cocoon expose this method?
>>
>>It seems not:
>>http://cocoon.apache.org/2.1/userdocs/flow/api.html#Context+Object
>
>
> Found the code for FOM_Cocoon.java and there's this:
>
> /* TODO: Vote on the inclusion of this method
> public String jsFunction_getRealPath(String path) {
> return context.getRealPath(path);
> }
> */
>
> What are the issues surrounding this method? I'd like to use it.
> Can this vote happen soon?
This method is "surrounded" to make it available to flow script. But
from that code it should be cocoon.getRealPath(path).
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-05-27 22:35]:
> On 27.05.2004 23:22, Alan wrote:
>
> > I'm attempting to use cocoon.context.getRealPath() in my
> > flowscript. Like so:
> >
> > cocoon.context.getRealPath("/WEB-INF")
> >
> > However, I'm getting this exception:
> >
> > org.apache.avalon.framework.CascadingRuntimeException: getRealPath is
> > not a function.
> >
> > Does cocoon expose this method?
>
> It seems not:
> http://cocoon.apache.org/2.1/userdocs/flow/api.html#Context+Object
Found the code for FOM_Cocoon.java and there's this:
/* TODO: Vote on the inclusion of this method
public String jsFunction_getRealPath(String path) {
return context.getRealPath(path);
}
*/
What are the issues surrounding this method? I'd like to use it.
Can this vote happen soon?
--
Alan / alan@engrm.com / http://engrm.com/
available for contract --> http://engrm.com/the-pitch.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: ServletContext.getRealPath()
Posted by Joerg Heinicke <jo...@gmx.de>.
On 27.05.2004 23:22, Alan wrote:
> I'm attempting to use cocoon.context.getRealPath() in my
> flowscript. Like so:
>
> cocoon.context.getRealPath("/WEB-INF")
>
> However, I'm getting this exception:
>
> org.apache.avalon.framework.CascadingRuntimeException: getRealPath is not a function.
>
> Does cocoon expose this method?
It seems not:
http://cocoon.apache.org/2.1/userdocs/flow/api.html#Context+Object
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org