You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Charlene Mitchell <ch...@yahoo.co.uk> on 2002/12/07 20:37:55 UTC

getRealPath is null

Hi,

I'm deploying a servlet in a war (within an ear) into
TomCat4.1.12 or TomCat 4.0.6 (integrated in JBoss).

But when I call the method getRealPath() I get a null
returned.

If I do the same thing in Jetty (with JBoss) then it
works fine.

Is this correct behaviour?

Thanks

Charlene

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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


Re: getRealPath is null

Posted by Charlene Mitchell <ch...@yahoo.co.uk>.
Hi,

Thanks for the info - I will certainly look into your
suggestion (though I'm also using Cocoon which I think
fails for the same reason in some areas and I don't
want to hack around inside that beast!).

Regards

Charlene

 --- Jacob Kjome <ho...@visi.com> wrote: > 
> Yep, because JBoss serves the app directly from a
> .war file rather than 
> expanding the directory as is the default behavior
> of the Tomcat standalone.
> 
> Remember one thing about webapps.  You can *never*
> assume that you have 
> access to the filesystem except to the servlet spec
> defined tmp directory 
> which *must* be provided by the appserver.  Load
> files as streams using the 
> classloader or the ServletConfig instead of using
> File IO.  This will make 
> your app 100% more portable.
> 
> Jake
> 
> At 07:37 PM 12/7/2002 +0000, you wrote:
> >Hi,
> >
> >I'm deploying a servlet in a war (within an ear)
> into
> >TomCat4.1.12 or TomCat 4.0.6 (integrated in JBoss).
> >
> >But when I call the method getRealPath() I get a
> null
> >returned.
> >
> >If I do the same thing in Jetty (with JBoss) then
> it
> >works fine.
> >
> >Is this correct behaviour?
> >
> >Thanks
> >
> >Charlene
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Everything you'll ever need on one web page
> >from News and Sport to Email and Music Charts
> >http://uk.my.yahoo.com
> >
> >--
> >To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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


Re: getRealPath is null

Posted by Jacob Kjome <ho...@visi.com>.
Yep, because JBoss serves the app directly from a .war file rather than 
expanding the directory as is the default behavior of the Tomcat standalone.

Remember one thing about webapps.  You can *never* assume that you have 
access to the filesystem except to the servlet spec defined tmp directory 
which *must* be provided by the appserver.  Load files as streams using the 
classloader or the ServletConfig instead of using File IO.  This will make 
your app 100% more portable.

Jake

At 07:37 PM 12/7/2002 +0000, you wrote:
>Hi,
>
>I'm deploying a servlet in a war (within an ear) into
>TomCat4.1.12 or TomCat 4.0.6 (integrated in JBoss).
>
>But when I call the method getRealPath() I get a null
>returned.
>
>If I do the same thing in Jetty (with JBoss) then it
>works fine.
>
>Is this correct behaviour?
>
>Thanks
>
>Charlene
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

Re: getRealPath is null

Posted by Paul Campbell <se...@halcyon.com>.
Pg 99. JavaServletProgramming(Hunter)
says it returns null if the translation cannot be performed.
I believe that case occurs because of the war similiar to
getPathTranslated discussed on pg 98.





At 07:37 PM 12/7/02 +0000, you wrote:
>Hi,
>
>I'm deploying a servlet in a war (within an ear) into
>TomCat4.1.12 or TomCat 4.0.6 (integrated in JBoss).
>
>But when I call the method getRealPath() I get a null
>returned.
>
>If I do the same thing in Jetty (with JBoss) then it
>works fine.
>
>Is this correct behaviour?
>
>Thanks
>
>Charlene
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


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