Thursday, October 21, 2004

Looping through ASP Server Variables

Place this code in the body of your asp file and run it. It will then display all the server variables.

<%

dim obj

for each obj in Request.ServerVariables

response.write "Object Name: " & obj & "<BR>"
& "Object Value: " & Request.ServerVariables(obj) &
"<BR><BR>"

next


%>


Tuesday, October 19, 2004

Configuring generated code and comments - class version in Eclipse

I looked high and low for this and then contacted a guru friend who sent me the code for the version control which is then added to the top of each new class by default.

Add in Window/Preferences/Java/Code Style/Code Templates/Code/New Java files

/*
* ${file_name}
* Created on ${date}
*
* Copyright McTavish Solutions
* Project: Project Name
*/
${package_declaration}

${typecomment}
${type_declaration}

Add in Window/Preferences/Java/Code Style/Code Templates/Comments/Types

/**
* @author ${user}
* @version $$Revision: 1.0 $$
*
*/

Add this in and then CVS will change it with each update made

Wednesday, October 13, 2004

Javascript - Reading variables in another js file

I was asked about this so here is the answwer. You have to include this in your original js

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"
SRC="yourOtherFileName.js"></SCRIPT>

All the variables defined in the other file will now be available to the script. All files and partial scripts are loaded in the page, so that it becomes like an include file. It can however cause problems, such as when 2 global variables have the same name.