Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Mark Howard

Ranch Hand
+ Follow
since Feb 14, 2001
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Howard

The servlet container is Resin. Whether I'm testing it locally on my home workstation or whether I download the site from my host server, the result is the same. Nothing appears to cache other than the html pages themselves.

Each image, js file, css file, etc that is downloaded has an expiry date stamped on it in my 'temporary-internet-files' folder of the same time it was downloaded, which I suspect is used for comparison purposes when I next download the same image, js, css, etc file. When I download other sites, this expiry date is null, which makes me suspect its something to do with the way I'm referencing these external files from within my JSP.

I'm at a loss. I've seen many queries on this site where people are trying hard to prevent the browser from caching objects, but I would dearly love it to do just that. Just one image at least
[ December 11, 2004: Message edited by: Mark Howard ]
13 years ago
JSP
What is the best way to configure your web app directory structure? I currently have a simple setup as follows:



When the JSP requires an image file, it references the 'image' directory as '../images.ddd.gif'. This works, but I find that the image is never cached, and downloaded from the server each time. I thought this may have something to do with the way in which my webapp directory is structured ('coz I've tried everything else )

Should the images directory perhaps be below the jsp directory, so that it does not require the '../' to reference an image? Or should the full URL path be supplied in the JSP to the desired image (as I've noticed is done by the Javaranch site)?

Any help would be appreciated
[ December 11, 2004: Message edited by: Mark Howard ]
13 years ago
JSP
I've recently deployed a web application (using Java/JSP) but find that each time I re-visit the same page all the images I have on that are re-downloaded from the server?

My browser is set up so that newer versions are not checked every time the page is visited, and the only manipulation I perform with the images is a very simple image-swap piece of javascript (to highlight the image on mouseover)

The one thing I've noticed in the Temporary Internet Files folder is that all the images that have been downloaded when I access my site are stored with an expiry date of right-now. I'm guessing that this expiry date is used to determine whether to re-use the same image or re-download it from the server. When accessing most other sites, the expiry date is set to 'none', which suggests that it has something to do with my site rather than any external internet settings.

Any ideas on this?

Thanks
After reading Kyle Brown's review in the Javaranch Journal about submitting and responding to asynchronous requests for long-running database queries using JMS, I was wondering how well Resin supports message servicing using JMS? The Caucho site has something on message listeners, but I couldn't find anything that indicates how resource-heavy JMS is on Resin, or whether its a good idea to use it at all.
I'm hosting a site with Lunarpages - who use Resin as their web server - and was wondering how much overhead is involved in using JMS, particularly with a hosting plan that operates in a shared environment?
Is it a silly idea, or worth the effort implementing JMS in these circumstances?
14 years ago
Further to the above...
If it is not imperative that the user waits for a response from the asynchronous process they triggered with their request, is there any way in which the asynchronous process could carry on crunching away while the user is freed to continue with other requests.
For example, user submits request A, servlet uses request A to trigger asynchronous process B, servlet returns control to the user who can then continue with other requests. When complete, process B could, say, update a database flag to indicate that the users data has been processed. When the user next issues a request that hits that particular data, the servlet servicing that request could query the flag and inform the user whether their data is still being processed or not.
Or is this the bit about having to spawn another thread to do Process B, which I believe is not considered good practice?
Kyle's solution in the Javaranch Journal looks quite sophisticated (and impressive), but I don't know enough about the full J2EE picture to make that kind of change. I guess I'm just looking for the quickest and simplest solution for now. Also, using Lunarpages as a host (and a good one at that), I don't know whether their Resin server does all the good things required by the J2EE spec?
14 years ago
Thanks for this information, Kyle.
Very useful indeed.
14 years ago
Hi all you Servlet gurus!
I am hosting a website which runs purely on Servlet, JSP and JDBC technology, but I've little experience with Servlets accepting and processing input files from the user. Ok. I have no experience of it
I would appreciate any suggestions.
Essentially, I need to accept a simple text file from the client and use it to update their database records. The questions I have are as follows:
1) How best to accept the input file by the simplest means. Can I open an open-file type popup that allows the user to browse and select a text file?
2) How does the Servlet read the file? ie. which API should I use, etc
3) The file simply has two columns per record which require validation. Is a delimiter the best (or at least simplest) way for me to distinguish between the 2 columns?
4) This is my most important question. I'm expecting about 100 to 2000 records per input file, and I can receive many simultaneously from various clients. What is the best way to process this? Each file will hit different records in the database, but I'm still concerned about the performance issue. It is not imperative for the client to wait for a completed-processing response, but how do I get the Servlet to process the file in the background and allow the client to carry on with other tasks. (I can always update a process-completed flag which will notify the user that their file has been processed the next time they poll their records)
5) Should I be concerned with any synchronization issues?

Thanks a mil for taking the time to read this missive. Any suggestions are much appreciated
14 years ago
(Hope this is the correct forum)
This might be a dumb question, but how do web designers create all those good-looking logos that generally appear on the home pages of most websites? I have the artistic skills of a brick, and am wondering how to at least create a half-decent looking logo that represents the concept I am trying to sell.
Are there tools/software out there that help you to turn your idea into a real picture? (Even something as simple as the Sun Microsystems logo)
Any help much appreciated.
Thanks Greg and Frank
Most helpful
Mark
14 years ago
Hmmm, I'm still lost
If I use a hosting service (ok, it's LunarPages) who supports a Resin application server and MySQL database, how do I configure the config file to suit my own specific application and database?
My assumption was that the resin.conf file applies to all applications on the server? I know I'm missing something simple here, but all my perusals of the Resin and MySQL doco hasn't brought me much closer to a solution. Is their some kind of config tag I place in my own application's web.xml file to declare the jndi and database name?
Also (on the side), I downloaded the latest stable MySQL driver to use with Resin, but where does it go in Resin? I put it in my web app's lib direstory and declared the driver in the driver tag of the resin.conf file, but when I fire up the Resin server it says it can't load the driver class?
I'm feeling a bit of a loser at the moment. Please help
Thanks,
Mark.
14 years ago
Can anyone suggest any inexpensive software to create your own images (.gif primarily) for a website.
Nothing fancy, just trying to create an eye-catching logo or two.
Thanks
Indeed, thanks Frank.
Don't know why I didn't think of looking there
14 years ago
I'm pretty new to Resin, but have started using after the good reports I'd heard about it on this forum.
Does anyone have a sample resin.conf file that they could publish here?
I'd been using Tomcat previously and never tinkered with it's configuration file other than to switch that gizmo on that enables you to re-deploy servlets without stopping and re-starting the Tomcat server.
Specifically a resin.conf file that configures anything to do with database connection pooling. The Resin website is loaded with info on all the tags, but I couldn't find any production-level examples that pulled them all together.
Any help greatly appreciated
14 years ago
Thanks for the replies
Even with no real business knowledge, I agree that a good business plan is essential to some kind of future success.
What I was more specifically after, however, is how to register your business, does tax on income gained apply in the country you currently reside in (I move around a bit), how to copyright your site, etc...
Any other info out there?
14 years ago
Just wondering...
Does anyone here run a web-based business?
I'm thinking of giving it a crack. Pretty confident on the techie side (using JSP, Servlets, etc), but don't have much idea about all the legalities involved.
Things like registering a web business, copyrights, under what conditions can I accept payment over the web, etc, etc.
Damn I wish I'd paid more attention to my accountancy teacher all those years ago...
Any help much appreciated
14 years ago