简体   繁体   中英

Weblogic download file from server and read in JSP

I have a java application deployed in weblogic where in I have a requirement for which I need to download a JS file in java class and save it in some location. Later when a particular JSP file is loaded the previously downloaded JS file should be accessible to this JSP. How can i achieve this?

I am not sure how to or which location I should save the file so that it would be accessible both in the JSP and java files.

My application uses JSON and due to other constraints I am not able to pass the JS file as byte array.

Thanks Paddy

It's not so difficult. For example you may create folder in the root of file system (or prefer other location) and fix it in your code or application environment, change access mode of this folder to resolve write\\read access for user under which weblogic is running. Then you can work with this folder from application deployed in weblogic as well as from normal standalone application.

Finally I solved this by fetchingthe result and storing it in a byte array which the JSP could process. Dont have the exact code as I dont have access to it anymore. But will try to write it up and post here.

For now, my problem is resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM