General Information for CGS 4825
I have used CSS to make
new links more
apparent. Scroll down... you won't miss them!
I have used CSS to make
exam links
more apparent. Scroll down... you won't miss them!
-
Exam Info
-
Exam dates are on the syllabus
-
Midterm Review Topics
-
Final Review Topics
-
Online Book
-
Chapter 1 Username:
cgs4825; password: chapter1
-
Chapter 2 Use
the uername and password that I sent you.
-
Chapter 3 Use
the uername and password that I sent you.
-
Chapter 4 Use the uername
and password that I sent you.
-
Chapter 5 Use the uername
and password that I sent you.
-
Chapter 6 Use the uername
and password that I sent you.
-
On-line resources
-
Syllabi
-
If you do not have a solix account, then get one:
School Accounts
-
Your webmail address has been added to the following
moderated mailing list. You can access an archive of messages from this URL.
Do not post messages to the list.
Section 01:
http://www.cs.fiu.edu/mailman/listinfo.cgi/aul-cgs4825u01
Section 02:
http://www.cs.fiu.edu/mailman/listinfo.cgi/aul-cgs4825u02
You may add more than one address to the list. When adding a new e-mail,
be sure to follow the instructions about placing 'confirm ######' in the
body o the text. If you only reply, it might not work. This is a moderated
list, so only messages that I approve will be sent to you. I will sell your
e-mail address to whomever wants to buy it (just kidding).
-
Modified/New Examples from class
-
Assignments will be posted here
-
Submitting Homework
Online. When you are asked for a username and password, use your webmail
username with the password that I sent to you.
-
Submitting Homework from Unix
-
HW 1
-
HW 2
-
HW 3
- In order to set up ocelot for compiling controllers that use Hibernate,
a lot of jar files must be added to the classpath. I have written a script
that will add all the files in your WEB-INF/lib directory to the classpath.
If you are working with the username web application, then run this command
~downeyt/public/bin/addJars.pl >> ~/.cshrc
If you are working with a different web app named myApp, then run the command
~downeyt/public/bin/addJars.pl myApp >> ~/.cshrc
Only run these commands once.
- I omitted one jar file from the
smaller.jar.zip
file. Please download it again.
- I have added links to the book site for the source code of my examples. I have also added
a link to a controller servlet that only inherits from HttpServlet. If you are having trouble
completing the assignment, I suggest you try to implement this controller.
-
You will not be able to upload your webapps folder, because it will be too large.
My upload program only allows for a file of up to 1 MB.
- Please use the following command to compress your web application. Do not compress 'webapps',
just compress your web application. Change to the webapps directory on ocelot and issue the
command
zip -r username username -x \*.jar \*.zip \*.war
Replacing username with the name of your web application.
- If you
have any other archived files in your directory, like .rar, or .ZIP, or
.WAR, please remove them before zipping.
- Check the size of the ZIP file, it should be less than 1 MB. If it is not, then you probably
have another ZIP file stored in the ZIP archive. Delete it and re-zip.
-
Use my uploading program from ocelot to upload the file.
~downeyt/cs/public/webftp/webftp.pl
- Upload the file as binary.
-
HW 4
-
Zip and upload your cgs4825 directory. Exclude all .jar, .zip and
.war files.
-
Please use the following command to compress your cgs4825 folder.
Change to your root directory on ocelot and issue the command
zip -r username cgs4825 -x \*.jar \*.zip \*.war
Replacing username with your user name.
-
If you have any other archived files in your directory, like .rar, or .ZIP,
or .WAR, please remove them before zipping.
-
Check the size of the ZIP file, it should be less than 1 MB. If it is not,
then you probably have another ZIP file stored in the ZIP archive. Delete
it and re-zip.
-
Use my uploading program from ocelot to upload the file.
~downeyt/cs/public/webftp/webftp.pl
-
Upload the file as binary.
-
HW 5
- Update
Since we have upgraded to Apache 2.0 from Apache 1.3, three
of the directives for the assignment cannot be used in a Location
tag, they must be used in a Directory tag.
-
Create a Directory tag for the language directory. Use the complete
path to the language directory. Place all AddIcon, ReadmeName,
and HeaderName directives here, instead of in the Locations for
individual aliases.
-
This will alter the assignment a little, as you will now see the header
and footer from the /plain URL. This is now acceptable for the
assignment.
-
Zip and upload your cgs4825 directory. Exclude all .jar, .zip and
.war files.
-
Please use the following command to compress your cgs4825 folder.
Change to your root directory on ocelot and issue the command
zip -r username cgs4825 -x \*.jar \*.zip \*.war
Replacing username with your user name.
-
If you have any other archived files in your directory, like .rar, or .ZIP,
or .WAR, please remove them before zipping.
-
Check the size of the ZIP file, it should be less than 1 MB. If it is not,
then you probably have another ZIP file stored in the ZIP archive. Delete
it and re-zip.
-
Use my uploading program from ocelot to upload the file.
~downeyt/cs/public/webftp/webftp.pl
-
Upload the file as binary.
-
UNIX information
Servlet and JSP Information
-
Chapter 1 Username:
cgs4825; password: chapter1
-
Chapter 2 Use
the uername and password that I sent you.
-
Chapter 3 Use
the uername and password that I sent you.
-
Chapter 4 Use the uername
and password that I sent you.
-
Chapter 5 Use the uername
and password that I sent you.
Examples of Server Options
Server Side Include (SSI) Information
-
Examples of SSI
commands. Notice how long it takles this file to load compared to the
next two links.
-
Same file with a .html
extension instead of .shtml. Notice that none of the commands were executed.
-
Same file with a .txt
extension. Notice how the server decides on what to send the browser
by looking at the extension.
-
A good tutorial on all the
SSI commands.
Information related to accessing school resources
General Web Information
-
To add an image to the
location bar in
a newer browser, add a <link> like the following. The
href should be to an icon, not a gif or jpeg. The 16x16
view of the icon will be displayed.
<link rel="shortcut icon"
href="http://www.cs.fiu.edu/~downeyt/images/tim.ico">
School Accounts
Getting a school account
As long as you are a registered student, you can have an account to use the
school's computers. This account is not needed to use the PCs in the computer
labs, but it is needed to long onto the computers with names: solix, serss1,
xlab1, servax, servms. The account that you get will give you access
to all of these computers.
To get the account, you must connect to the solix computer. When you
are prompted for a user name, type the single word (no spaces)
unixshell. You will then be asked some information like name and student
number. Then you will be given a user name and a password. Write them
down! Then you will be logged off the computer. You won't be able to
access the computers for another 24 hours, while your account is being activated.
In the future, you will use your user name and password to log onto any of
the named computers.
You may get more information about UnixShell from
http://www.fiu.edu/~aus/accounts/student.html
Changing Passwords
Once you have a school account, it is good for many computers here at FIU.
You should change your password to something other than your student number.
Changing your password on solix
From the command prompt on serss1 and solix, issue the command
passwd
in order to change your password. You will be asked for three things:
-
Your current password
-
Your new password
-
Your new password, again
Back to top of page
Many people are having difficulty getting the <P class="red"> working.
The problem is with the header tags that start the paragraphs: Do not include
the header tags inside the paragraph. Do it this way
<h1>Heading</h1>
<P class="red">
Paragraph
</P>
This will get it working.
Back to top of page
Submitting Homework Online from ocelot or solix
I have created a script that you can call from school computers to upload
files to my directory. Execute the following from your directory on weasel,
ocelot or solix:
~downeyt/cs/public/webftp/webftp.pl
and follow the instructions. Use the -h option to learn how to customize
the program.
Back to top of page
There are three types of permissions for a file or directory: read,
write, and execute.
File
-
Read: it is possible to see the contents of the file
-
Write: it is possible to change the contents of the file
-
Execute: the file contains machine code, or the file contains a script and
the name of a program to execute the script
Directory
-
Read: it is possible to see the list of names of the files that are in the
directory
-
Write: it is possible to change the list of names of the files that are in
the directory
-
Execute: it is possible to access the files that are in the directory. It
is possible to change (cd) to the directory.
Each file has three different access permissions
-
User: the owner of the file
-
Group: the group that the user belongs to. Usually, there is no such group.
-
Other: every other account that is not the user, nor the user's group
The output of the ls -al
command lists all the permissions.
There are ten characters
-
First character - type of file: d is directory, l is link, - is file
-
Next three - user permissions
-
Next three - group permissions
-
Next three - other permissions
Each permission is assigned a numeric value. The values are chosen so that
each number from 0 - 7 indicates a unique combination of permissions.
-
none: 0
-
e: 1
-
w: 2
-
we: 3
-
r: 4
-
re: 5
-
rw: 6
-
rwe: 7
To use the chmod command, determine the permissions that are required for
each category of account that can access the page: user, group, other. Calculate
the number for each category. There will be one number for each. Here are
some examples of chmod commands
-
chmod 755 public_html
-
chmod 644 index.html
-
chmod 711 ~
-
chmod 600 httpd.conf
To get more information on the chmod command, use the man pages.
-
On solix:
man -s 1 chmod
-
On ocelot:
man chmod
-
Here are the explanations of the other modes in the ls command
-
l - file locking. Only one process can access the file at one time.
-
t - sticky bit. If directory has write access, only owner of directory can
rename or remove files.
-
T - sticky bit but no access. Sticky bit is on, but directory does not have
execute permission.
-
s - set-user or set-group ID. A file or directory created will have the same
owner as the parent directory, it will not be owned by the ID of the process
creating the file or directory.
-
S - set-user or set-group ID but no access. Set-ID bit is on, but directory
does not have execute permission.
Back to top of page
DOCTYPE and Content Type for HTML validators
If you want to validate the code in an HTML page by using an HTML validator
such as the one located at
http://validator.w3.org, add the following
to your HTML file:
-
Add the DOCTYPE comment as the first comment in your file if you not
using the old style presentation attributes and elements
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-
Add the DOCTYPE comment as the first comment in your file if you are
using the old style presentation attributes and elements
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
-
Add the following META tag to the HEAD section of your file
<meta http-equiv="content-type" content="text/html;
charset=utf-8">
Here are some example pages and links to validators for each page.
-
valid.transitional.html
-
This is a valid HTML Transistional page that uses old style presentation
tags and attributes like <font> and <body bgcolor="red">
Validate the
Page.
-
valid.strict.internal.html
-
This is a valid HTML page that uses an internal style sheet to replace the
old style presentation tags and attributes. It is necessary to validate the
style sheet in a second validation.
-
Validate the
Page.
Validate the
Style
Sheet.
-
valid.strict.external.html
-
This is a valid HTML page that uses an external style sheet. It is necessary
to validate the style sheet in a second validation.
-
Validate the
Page.
Validate the
Style
Sheet. View the Style Sheet.
-
invalid.transitional.html
-
This is an invalid HTML Transitional page that has some incorrect tags and
attributes.
-
Validate the
Page.
-
invalid.strict.html
-
This is a valid HTML Transitional page, but an invalid strict page.
-
Validate the
Page.
-
invalid.strict.external.html
-
This is a valid strict page, but the style sheet has some errors.
-
Validate the
Page.
Validate the
Style
Sheet. View the Style Sheet.
Back to top of page
Path Info on Netbeans
In order for Path Info to work properly in Netbeans for a servlet, it will
be necessary to add an additional servlet-mapping for the servlet.
You do not need to do this when you run servlets from ocelot. It is only
necessary whey you run locally on Netbeans.
Edit the web.xml file for your web app. Look for the servlet mapping for
your servlet. It will look something like this
<servlet-mapping>
<servlet-name>QueryPath</servlet-name>
<url-pattern>tdowne99.QueryPath</url-pattern>
</servlet-mapping>
Copy and paste another one of these right after this one. Edit the
url-pattern by adding a /* at the end. When you are finished, you
should have two servlet-mapping that look something like this
<servlet-mapping>
<servlet-name>QueryPath</servlet-name>
<url-pattern>/tdowne99/QueryPath</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>QueryPath</servlet-name>
<url-pattern>/tdowne99/QueryPath/*</url-pattern>
</servlet-mapping>
Back to top of page
Root Context is not Available
For some unknown reason, sometimes the ROOT web app of your host on Tomcat
becomes unavailable, and it is impossible to Stop or Reload
it in the manager web app.
If this happens, try deploying ROOT.
-
Locate the Deploy section of the manager web app.
-
Type ROOT into the WAR or Directory URL: edit box
-
Click the Deploy button
You will most likely have two links to the / web app. One will work, the
other will not. Leave both of them. Your web app should now be working.
Back to top of page
Netbeans 4.1 Problems
Issue 1 Netbeans in the lab has some issues. If you make a change
to a JSP, then netbeans "should" recompile the JSP into a servlet. Netbeans
4.1 fails to do this. Sooooo, you have to delete the old .class file.
Be sure that all hidden files can be viewed when looking into directories
in Windows Explorer before you start looking for these files. It will be
located in
Documents and Settings
your yser name
netbeans
4.1
jakarta-tomcat-something
work
Catalina
localhost
your project name
org
apache
jsp
your subdirectory name
Open this directory and delete the .class files. Then you can run
your application again and it will rebuild the .class files.
Issue 2 If you ever get the error
Deployment error: TomcatManager.undeploy invalid TargetModuleID passed. See the server log file for details.
then you have to delete another file. Look in
Documents and Settings
user name
.netbeans
4.1
config
J2EE
TargetModules
tomcat_home__bun251815208 (or similar)
home__bundled_ho-1459906850 (or similar)
project name
Delete the "project name" file.
Issue 3 If you ever get the error
generics are not supported in -source 1.4 (try -source 1.5 to enable generics)
Then you must
- Right-click on the name of your web application in the Projects tab
- Click on Properties
- Click on Source
- Set the source level to 1.5
In the future, when creating a new web application, on the New Web Application
screen of the wizard, be sure that the checkbox
is unchecked. It seems that this is checked by default for compliance with
J2EE 1.4 projects. When it is checked, then the new JDK 1.5 constructs, like
generics, cannot be used. Back to top of page
MySQL Commands
The name of your MySQL database on ocelot is
username_fall05
where username is your ocelot user name.
To access your database, log onto ocelot and type the command
mysql -h localhost -u username_fall05 -p <Enter Key>
password
You will enter your password after mysql prompts you for it.
Once you are connected, issue the command
use username_fall05
After you are in your database, you can view all tables with
show tables;
Don't forget the ;
at the end.
There won't be any tables until you do your homework. Once you have a table,
you can view its structure with
describe name-of-table;
You can see all the records in the table with
select * from name-of-table;
Exit mysql with
exit;
Back to top of page