You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Shaw, Chris" <Ch...@ecb.int> on 2002/11/22 11:37:40 UTC

how to getRealPath from action

Hi,

How would I get the real path of a file from within an action?

I have the following:

  public Map act(Redirector redirector, SourceResolver resolver,
            Map objectModel, String source, Parameters params) 
            throws Exception {
        Request request = (Request)
objectModel.get(Constants.REQUEST_OBJECT);  // this is deprecated???

And from in here I need to open the URL http://localhost:8080/myfile.xsd as
a file using java.io.File - so I need some way to get the conetxt and the
real path of the file.
                String fileName =
??????.getServletContext().getRealPath("/myfile.xsd");

I trawled the API but without success.

TIA for any ideas.

Chris
-=-=-=

Any e-mail message from the European Central Bank (ECB) is sent in good faith but shall neither be binding nor construed as constituting a commitment by the ECB except where provided for in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any unauthorised disclosure, use or dissemination, either in whole or in part, is prohibited.
If you have received this e-mail in error, please notify the sender immediately via e-mail and delete this e-mail from your system.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>