devxlogo

October 22, 1999

Servlets vs JSP

Question: What is the difference between servlets and Java Server Pages? Which is preferred? Answer: Servlets and Java Server Pages are complementary APIs, both providinga means for generating dynamic Web

Function for Adding Sales Tax

Question: What function would I use to take a given amount of money and add 6% sales tax? Answer: In JavaScript you could use: function addSalesTax(SubTotal){ return SubTotal * 1.06}

Cannot Use JavaScript to Get Server Date

Question: How do I get the server date using JavaScript that is embedded in an HTML file? Answer: You can use server-side code (like Perl, ASP, and so forth) to

Resolving IP Addresses

Question: I require Visual Basic code to resolve IP addresses stored in firewall logs generated by Checkpoint Firewall1. The aim is to report company access by user (assigned dedicated IP

Reference an External JavaScript File

Question: How do you reference an external JavaScript file from an HTML page? Answer: You can reference an external JavaScript file from your HTML page similar to the way you’d

Cannot Align Prompts and Alerts

Question: I have alerts and prompts intermingled on a page that collects information from the user. Is there a way to align them all so that they do not appear

Closing the User’s Browser Window

Question: I want to close the window that opened a new window using window.opener.close().The problem is when this code is executed, some confirmation message pops up. Is there any way

Convert a Number to a String

Question: How do I convert an integer/float type into a string? Answer: Converting numbers to strings is much easier than you think. Because JavaScript is an untyped language, the interpreter

Virtual Includes

Question: I’ve been told that you cannot have dynamic virtual includes inJSP. Is this true? For example, is something like this going tocause problems? Answer: JSP is still relatively new,