WebLogic 12c getRealPath

I am porting obsolete code in weblogic 12c. The code uses getServletContext().getRealPath("/") , which returns null because the specification says:

This method returns null if the servlet container cannot convert the virtual path to the real path for any reason (for example, when the content becomes available from the .war archive).

Here is a workaround that I tried, but that didn't work. I checked the Accept Context Path In Get Real Path , restarted the cluster and redistributed the application, but the real path is still null .

Is there any way to handle this?

I need a real way because the application gets the images directory and puts it in the jasper report file to load a specific image. Unfortunately, rewriting code is not an option.

+4
source share
1 answer

The weblogic.xml update did the trick:

 <container-descriptor> <show-archived-real-path-enabled>true</show-archived-real-path-enabled> </container-descriptor> 
+6
source

Source: https://habr.com/ru/post/1494950/


All Articles