Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

We have a Java class that is supposed to fetch an HTML file and then read some content in it based on the id of certain divs and then return the content to a frontend which will then render it.

Now we have a set of HTML files on a common file system somewhere on the network. Multiple applications will access it. It is like a homegrown GUI help guide for our customer facing screens with a centralized storage.

We have managed to load the html file in 2 ways

  1. Start an Apache web server and put all html files in htdocs. The calling Java class then makes an http call http://someIP:80/helpguide/userguide.html #firstname. This will fetch the help guide related to FirstName field on the screen. The Apache service has to be managed as it is accessed in Live but only accessible within our network.

  2. Create a Shared directory and grant access to it to the Windows logon used to run the Windows service that runs Tomcat where the client facing web application is deployed. Then the Java client class uses new File("<file location>") to load the file and read its content. This works as well.

Basically we have 2 ways to load the html file. Now we are confused whether to use route 1 or 2?

The html files won't be that massive and will be of reasonable size. It may have inline css or youtube video links embedded in them.

Downside of (2) is if we want to include images later it won't work while it should work with (1).

However in terms of performance and efficiency how are teh 2 approaches different? (1) will open a Http socket connection over port 80 and get the html stream back. WIth (2) It will possibly use a File Inputstream to get the file on the server.

share|improve this question
1  
"Downside of (2) is if we want to include images later it won't work" <-- how so? It is not the client accessing the files directly, right? – fge Jul 11 at 11:26
Even if it does not look like: in approach 2 you have also to open a socket connection as a CIFS share is involved. – Uwe Plonus Jul 11 at 11:37
well it will be fge. basically we plan to get the html which will have images embedded. images are stored where the html is. But while using file system loader we are only getting the images and not related images which are available relative to the html. I know this is more elegant on a webapp but we wanted something dead simple and people who will be creating this html and image screenshots wont be that tech savvy - hence scoping simplest solutions. We are kind of tilting towards Apache web server more as all one needs to take care is firewall access over the http port – Soumya Jul 11 at 15:36

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.