Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is the servlet method getRealPath() supported?

method servlet supported
0
Posted

Is the servlet method getRealPath() supported?

0

If you want to use the JNDI path you fetched from getRealPath() directly as a valid file system path, then you’ll need to create a CIFS mount so that when Java goes to look for your file, that “file system” will actually be there. If you try do use the JNDI path you get from getRealPath() as if it were a valid native file system path without having created a CIFS mount in the location indicted by $VIRTUAL_TOMCAT_HOME/conf/alfresco-virtserver.properties, you’ll get null pointer exceptions. While using a CIFS mount is a nice way of working around a webapp that relies on a file system, it has a few disadvantages. For one thing, you don’t have access to the full AVMRemote API, and for another, it creates another out-of-band config to get right. However, you could avoid all reliance on CIFS mounts if you translate the JNDI path you’ve gotten back from getRealPath() into an AVM path. If you do this, you can then use AVMRemote to fetch whatever you want (and have the full power of the remote

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123