cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaw, Chris" <Chris.S...@ecb.int>
Subject how to getRealPath from action
Date Fri, 22 Nov 2002 10:37:40 GMT
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message