How to get real path in JSF

1

To get the real path we first need the servlet context


ServletContext ctx = (ServletContext) FacesContext.getCurrentInstance()
.getExternalContext().getContext();

After getting the servlet  context now we are able to get the real path


String deploymentDirectoryPath = ctx.getRealPath("/");

One Response

  1. Thanks for this information. I think someone need some help like this.

Leave a Reply

© 2010 Developer Articles. All rights reserved.
Powered by: Aaban Technologies