This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!

tarunbhatia bhatia

Greenhorn
+ Follow
since Mar 09, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by tarunbhatia bhatia

Hi guys,

I'm totally new to caching. Can you please help me with following requirement:

1. I need to display static html pages lying on ftp location whenever a user logs into the system.
2. These static html do not change for a month or two.

Thus I want to implement is, keep a cache of html pages on my web-app and check if it is 2 month old then download the latest copy from ftp otherwise display the file kept in cache to the logged in user.

Thanks,
Tarun
10 years ago
Hi Stefan,

Thanks for your help. My pages are coming up properly, each hyperlink working fine. But I'm left with one problem.

My pages have image tags too and these images are also lying on ftp server. And clue that i have got is you cannot return content type as HTML and Image in one response from servlet. So my assumption is I need to write another servlet that is invoked when html page is rendered on browser.

I'd do the following:

1. Return the html page from servlet1.
2. Content returned by servlet1 will have image tags like <img src="xdoimgFv.png">
3. When html page is being rendered on encountering img tag, servlet 2 will be invoked.
4. Servlet 2 will download the image from ftp and return the response object as image.


Is this thought correct?

Any pointers or source code will be really helpful. I'm new to servlet programming thus any sort of information will help.

Thanks,
Tarun
10 years ago
JSP
Thanks Stefan. I'll build the application based on the pointers provided. Thanks for your help.
10 years ago
JSP
Thanks Stefan. I got your point. I would be able to write a servlet to connect to ftp and download the html from there.

However if you could help me with modifying the response received from ftp and show it on my jsp so that hyperlinks are fashioned in a way that it invokes the servlet again.

Your help will be really appriciable and i'm thankful to you.

Following are the links on my home page, these html are also placed in the same folder of my home page html.

[tr class="c3"][td valign="middle" class="c10"] [a href=".\RDD_2300_D02_P01.html"] Inspector Feedback[/a][/td][/tr]
[tr class="c3"][td valign="middle" class="c10"][a href=".\RDD\RDD_2300_D03_P01.html"] Latest Outcome[/a][/td][/tr]
10 years ago
JSP
[M Mehta]
Basically problem is Home HTML has internal links to other htmls. These html are lying on the ftp location (not on the web application) server. And the Home HTML has relative path given to these htmls.

Thus when you click on any hyperlink of Home HTML, it tries to locate the html on the ROOT node of web application.

Expectation:
-------------------------------------------------------------
- How to ensure it tries to pull the next html from ftp location.
10 years ago
JSP