sean divine

Greenhorn
+ Follow
since Oct 27, 2005
Merit badge: grant badges
For More
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 sean divine

Thanks for your suggestions, Ben. Yes, the site uses Resin. Unfortunately, the site is hosted with a shared jvm. I don't have much control. And as far as I can tell, I don't have the ability to modify a httpd.conf file. Where is the file usually located?

And I'm not sure what you mean by "hitting resin directly". How does one do this? You mean without a browser?

I'm not especially familiar with mime typing and don't fully understand your explanation.

I appreciate your suggestions, though. Let me know if there is something else you think I should test and/or how to implement the test (as my knowledge oif mime typing and such is minimal).

I'd really like to know how to fix this problem (other than changing the page to html).

Thanks,

sean
18 years ago
JSP
Thanks very much Bear for checking again.

Actually, I just saw the problem again earlier tonight on a completely different mac in a different home, this one running OS 10.4.3 and safari version 2.0.2.

Maybe I wasn't clear describing how to obtain the problem. The first time you hit the chooseDelivery.jsp page, it should display correctly. Then, when you hit the "back" button from the page named chooseDestination.jsp, be sure to hit the "back" button link on the page, instead of the "back" button on the browser. Otherwise, the broser will just show the cached page.

Follow these steps:

Go to this page...
http://insatiablestudios.com/shopcart.jsp?i=192
then click "checkout".
then click the "ship it over land" link (this will take you to chooseDestination.jsp)
then click the "back" button (use the link on the page)

code should now appear (on chooseDelivery.jsp).

Do you not get this problem? I'm now 2 for 2 with this problem on both macs I've tested.

Are youy aware of any reason why it would be a problem to have a jsp page with html only (no jsp tags)?

i strongly suspect that renaming the problem page as an html page (since it doesn't need to be a jsp) will solve the problem. But I'd really like to learn why this is happening first.

I really appreciate any insight you may have.

sean
18 years ago
JSP
Content type is set to "text/html". So I guess this isn't the problem.

I finally got the safari version that brought up code on this one page only as explained above, The safari version is 2.0.3, running on mac OS 10.4.4.

Thanks,

sean
18 years ago
JSP
I'm still waiting to find out what versions of safari yielded this problem. I expect to know this soon.

Do you recall the specifics of the incorrect contextType that caused the display problem (in ie) that you noted, and what change fixed it? I'm suspicious that this may be part of my problem as well.
18 years ago
JSP
Hi,

Thanks for your reply. I'll need to check the safari version tomorrow. I don't have the mac here (as I mentioned above).

Have you ever seen safari display html code instead of rendering the page?

sean
18 years ago
JSP
Is there anything wrong with creating a ".jsp" page that is pure html with no scripts? I have a page like this in a site I built that lies in a chain of other jsp pages that do have scripts. I made the page a jsp page because I wasn't initially sure if I would use dynamic elements on that page or not. And I didn't think this mattered.

All the jsp pages display fine on firefox/netscape/ie when viewed on a windows machine (I wouldn't expect the browser to matter since the html is generated server-side). However, when I view the site using a safari browser on a mac machine a problem occurs: the first time I hit the html-only jsp page, it displays fine. However, every time I hit this page subsequently, safari displays the page's source code. Then if I hit the "refresh" button, it displays the page properly. But if I move to another page and then go back to the problem page, safari displays code again unless I refresh. All of the other jsp pages (that actually contain jsp scripts) are fine.

I'm not sure why this would happen since the server is sending complete and valid html code to the browser. I even copied the code that safari was receiving and ran it through a markup validator. No errors.

Is there anything wrong with having a ".jsp" page with no jsp tags? Is there a certain "<%@ page ...%> declaration required? Incidentally, I tested for this problem both with and without this...

<%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="contact.htm" %>

at the top of the problem jsp. The problem occurs in both cases.

I guess the next thing I should try is to change the filetyp for the problem page to ".html" and see if this solves the problem. But I would really like to know why this is happening.

Of course a bit of my problem stems from the fact that I don't own a mac so troubleshooting is more cumbersome than it should be. I guess I need to get myself a mac mini on ebay.

If you'd like to witness this problem, get on a mac and browse (using safari) to

http://insatiablestudios.com/searchResults.jsp

Then pick a shade you like and click "add to cart". Then hit the "checkout" button. This (chooseDelivery.jsp) is the problem page (but it should display correctly the first time). Click "Ship it over land". This should call up chooseDestination.jsp. Next, hit the "back" button. You should now see html code instead of the correctly rendered page. Hit "refresh" and the page appears correctly. Now hit "back" and then "checkout" again. Displays code again.

Why? Am I missing something very simple here?

I very much appreciate any insight you may have into this problem.

Thanks,

sean
18 years ago
JSP
Thanks for these other suggstions, Ben. I looked into some of the features available on the server we are using. The administrators disable wget for "security reasons" but there is a cron manager available on their control panel. I'll take a closer look at how I might use this. Could be just the ticket. Thanks for all your great advice.
18 years ago
Thanks very much for these excellent recommendations. All are very useful and interesting. And thanks for the link to the article, Ben. Both the Quartz and the java.util.Timer approaches look like they could satisfy my scheduling requirements.

However, I'm a little uneasy about using persistant threads in a shared JVM where I can't control restarts and the administrators frown on any loose ends running in the background. Unfortunately, the artist for whom I'm building the site can't afford a private JVM at this point.

Although the article mentioned above detailed two very good solutions to my problem, I couldn't find anything in it that addressed my concerns about running either option on a shared JVM. But my grasp of the mechanism is limited and maybe this concern is unwarranted.

Does anyone have any insight into the risks of running these solutions on a shared JVM?

Unless I'm led to believe that this won't be a possible problem, I'm inclined to pursue my "hack" approach in which the housekeeping procedure only occurs when a user requests a certain page.
18 years ago
I did think of that option briefly. Doesn't this involve having the server count in increments of 1/1000 of a second? Wouldn't this require continous counting in the background forever? And would this drag down the server in any way? The site is hosted on a shared jsp server (Resin).
18 years ago
Can a servlet only act as a passive responder? Or is it possible for a servlet to undertake a periodic housekeeping procedure on it's own initiative? My understanding is that a servlet is only passive.

Here is my situation...

I'm attempting to interface a shopping cart with paypal mechanism for an artist who makes rice paper lamp shades. Because every shade is unique, I want to be careful to avoid taking money from two or more buyers for the same shade.

And for this reason, I don't want to wait until Paypal sends back an order confirmation before making a shade unavailable to other buyers. i have no control over how long the process may take on their end and could feasibly be sending another order to paypal for the same shade before the confirmation comes thru.

So instead, I will make a shade unavailable to other buyers at the exact moment that the order gets sent to paypal. The problem with this approach of course is that if the buyer get's cold feet while on the paypal website and never completes the order, the shade will still be unavailable to other buyers.

To overcome this, I plan to record every order that is sent to paypal in a database. Every recorded order will be date stamped and will be initially marked as unconfirmed. If paypal responds indicating the transaction was completed, the order will be marked as confirmed.

However, if the transaction is not processed by paypal within 3 days, I want the items in the order to be made available again. To do this, I will set up hidden housekeeping procedures on two pages in the site. If someone requests either of these two pages, a servlet will check the orders database to see if there are any orders that were placed at least 3 days ago that are still unconfirmed. The order would then be marked as canceled and the items would again be made available in the inventory database.

This will probably work but it seems like a bit of a hack solution. It relies on someeone hitting one of the two pages on the site. Is there a way to arrange for the housekeeping to be done periodically whether or not anyone visits the trigger pages?

Thanks for any suggestions
18 years ago
Thanks for the tip. I'll give it a try.
18 years ago
Making my first attempt at a web shopping cart. I've got the cart working and now need to pass the cart values to paypal. The order info and cart items are passed to paypal using a form with method "post".

The problem is that I want to capture these request values between the customer's cart page and paypal. I could do this by sending the customer to an intermediary page and having them click "next" to take them to paypal. But I don't want the customer to have to see one more unecessary page and make one more unecessary click.

What I'd like would be to have the form send the request values to a servlet that would capture and act upon the values before automatically redirecting everything to paypal. The customer should be unaware that this intermediary servlet exists.

This shouldn't be too difficult but I can't think of how to do it with my limited knowledge of servlets.

Any suggestions would be greatly appreciated.
18 years ago
Thanks a ton for your reply. That is an interesting method. And I like the way you can choose which files to import (without having to import all of the images, etc. that you will not be manipulating in eclipse.)

However, the files that get imported are physically copied into the workspace. This seems like an inefficient use of hard drive space since the same files then exist in two locations. (Although, this is not really such a big deal since you are able to reject importing unecessary files like images and because memory is so cheap and plentiful these days.)

But a more significant problem with this method you suggested is that the copies that are created in the workspace are not linked to the originals. So editing the files in eclipse will not change the files in the original location where they are uploaded to the server. So this method is tantamount to simply copying certain files and folders into the workspace. I would then need to copy edited files back into their orignal location, overwriting the earlier versions, in order to upload to the server. This seems unecessarily inefficient.

In my research, I found several different methods of importing or linking. Some phiscally copy the files to the worksace while others do not. I found one method that phiscally copied the files while keeping them linked, so that editing a file in the workspace caused the original file in the original location to change also. I can't recall how I did this at the moment but I remember being pleasantly surprised that two files were simultaneously updated when either one was edited and saved.

I also found two methods that imported files or file structures into an eclipse project without actually creating new files in the workspace. This seems most sensible because no unnecessary duplicate files are created on the hard drive. But one of these methods (right click a newly created package and then choose new->folder->advanced->link to folder in the file system) didn't do the trick so well because it requres naming the new file and then expects every package in the project to be a child of this new file name, i.e. newFileName.WEB-INF.classes.myBeans.

The best method I have found so far turns out be be pretty simple: file->New->Project->Java Project. Then in the dialog, click next and after naming the project, under "Conetnts" select "Create project from existing source" and browse to the top level folder of the site (where indes.html resides). This seems to do the trick.

Thanks again for your reply.
I'm totally new to eclipse and am trying to become familiar with how to implement eclipse's workspace/project approach with an existing site. (Formerly, I used JPad Pro but since I lost my version with an old machine, I decided now was a good time to make the switch.)

So I presume (and hope) that this is a very simple question but so far I've failed to locate an answer.

I wish to edit, compile and create new java files for a website that is already live. I use dreamweaver to both edit the html in the site and upload files to the remote server.

I understand that I can import existing packages into the eclipse workspace by simply moving them into a newly created project folder in the workspace.

But this is not desireable to me because I want to maintain an exact replica on my local machine of what resides on the remote web serving host. The project in question currently resides within a folder on my hard drive that contains a directory tree identical to that on the live remote server that hosts the website. Also, the site is defined in dreamweaver as existing at this specific location on my hard drive.

If I were to move the package files into a new project folder in the eclipse workspace, I would lose the integrity of my mirror copy and the ability to upload the files to the remote server thru dreamweaver.

Another option I considered was to define the eclipse workspace location as the WEB-INF folder in my local site. Then would I name the project "classes" since that is where the servlets and packages reside? This would not be a very descriptive project name.

Again, I suspect this is a simple problem yet I'm scratching my head nonetheless. How is this usually done?

Thanks for any insight into this.