RE: Session Timeout

2002-01-30 Thread Purcell, Scott

I think Justin is correct in stating to put the timeout in the JSP's. I bet
the web.xml file is only for servlets.

Anyone know for sure?

Scott

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 10:42 AM
To: [EMAIL PROTECTED]
Subject: Session Timeout


Hi,
I tried setting session timeout to 5 mins using web.xml (please see
the following code), but it does not seem to be working. In my jsp I
displayed getMaxInactiveInterval() and it shows 1800 (30 mins). Can anyone
please let me know if I can use web.xml for session timeout in jsp pages or
not.
session-config
session-timeout
5
/session-timeout
/session-config


Sumit.
The information contained in this e-mail and any files transmitted with it
may be privileged and confidential.  If the reader of this message,
regardless of the address or routing, is not an intended recipient, you are
hereby notified that you have received this transmittal in error and any
review, use, distribution, dissemination or copying is strictly prohibited.
If you have received this message in error, please delete this e-mail and
all files transmitted with it from your system and notify the sender by
reply e-mail or by calling 1-888-338-6076. 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Applet Hassles

2002-01-17 Thread Purcell, Scott

Hello,
I have been using the Tomcat on NT for the past 7 months mostly dealing with
Servlets and JSP's, and everything works great. I believe I have all my
classpaths correct and the system configured properly.

But whenever I create an applet, not using a package, and place it in the
/classes directory (eg. classes/digitalClock.class), then put my HTML for
the applet tag into my /root folder, the system cannot ever seem to find
the damn applet class. I get a class not found exception. I double checked
my classpath and I am pointing to the /classes directory?


Do I need to put in servlet.digitalClock.class in the applet tag? I tried
that too and it does not work?  Does any ideas I can try to get this to
function?

Thanks,

Scott Purcell


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Applet Problems

2002-01-17 Thread Purcell, Scott

Hello,

I am having trouble running any applets from on my tomcat server on my NT
box. I truly believe I have all my classpaths configured properly, as I can
run any type of servlet or bean. If I create a simple java file under
/root/web-inf/classes/clock.class (which is in my classpath), then take a
html file and put it in the /root folder and call that .html file, I always
get a class not found error.

Do I need to put /servlet.clock.class in my applet tag? I tried that with
no success. I am missing something simple and could use some assistance with
this.

Thanks, 

Scott Purcell


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Servlet Mapping Q

2001-12-14 Thread Purcell, Scott

Hello,
Yesterday I have been trying to use an init method to read the web.xml file
for some parameters. I am just trying to learn JSP/Servlets. Anyway, I know
I have the parameters in the web.xml file correct, but it still would not
read them. Then I got the following email from Larry that showed why this
did not work.

Subject: RE: web.inf still need help ... Please


Note that http://localhost:8080/servlet/cwp.ShowMessage
will not see the init parameter since the invoker servlet
(i.e. /servlet) is not part of the Servlet spec.  You
should include a servlet-mapping in the web.xml and
invoke the servlet using the url-pattern specified.  Then
the servlet should see the init parameters.

Cheers,
Larry


So I have searched for information about servlet-mapping and url-pattern. I
found some information, but have no clue what they are talking about. All I
can come up with is that fact that the generic /servlet does not see the
invoker servlet (/servlet). I can also see it configure under the server.cfg
file. But anyway, I would like to configure a /servletdir that I could then
use my web.xml file with. I am sure someone out there knows how do to this,
and I could really use the help.

Thanks,
Scott


Scott Purcell


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: web.xml file confusion

2001-12-13 Thread Purcell, Scott

Thanks Craig,
I think my issue is registering the servlet. I cannot seem to find how to do
that. How do I register a servlet with the server?

thanks
Scott



-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 1:51 PM
To: Tomcat Users List
Subject: Re: web.xml file confusion




On Thu, 13 Dec 2001, Purcell, Scott wrote:

 Date: Thu, 13 Dec 2001 13:34:18 -0600
 From: Purcell, Scott [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: web.xml file confusion

 Hello,
 I am working out of Martys book on Servlets, and there is an example of
 using the init block to get some parameters from the web.xml file.
 When I searched for web.xml to find it, I found one in about each
directory.
 I do not think that is right. Where should the web.xml file live?

 Also, Is there a way to find out (print out possibly) the parameters so I
 can see what is being read? I am asking this, because I have added the
 following snippet to my web.xml file, but the code below does NOT read
those
 params. I am confused by this, and could use some assistance.


There should be a web.xml file for each web application (in a WEB-INF
subdirectory), because each application is independent of the others.

The basic rules for what web.xml is all about are spelled out in the
Servlet Specificaiton, which you can download at:

  http://java.sun.com/products/servlet/download.html

(although I suspect that reading the book's discussion about web.xml would
also probably help you understand it better :-).


 Thanks
 Scott



 // here is part of my web.xml file The file I am running and compiles
 properly is in a package called cwp.ShowMessage. I thought all looks good,
 but maybe a second set of eyes may help.


 web-app

  servlet
   servlet-nameShowMessage/servlet-name
   servlet-classcwp.ShowMessage/servlet-class
 init-param
   param-namemessage/param-name
 param-valueAlert FM/param-value
 /init-param
   init-param
 param-namerepeats/param-name
 param-value20/param-value
   /init-param
 /servlet


  servlet
   servlet-nameShowMessage/servlet-name
   servlet-classcoreservlets.ShowMessage/servlet-class
 init-param
   param-namemessage/param-name
 param-valueAlert FM/param-value
 /init-param
   init-param
 param-namerepeats/param-name
 param-value20/param-value
   /init-param
 /servlet



 // part of my class to go get the web.xml parameters message and repeats.
 public class ShowMessage extends HttpServlet {

  private String message;
  private String defaultMessage= No Messages Today;
  private int repeats = 1;

  public void init() throws ServletException {
  ServletConfig config = getServletConfig();
  message = config.getInitParameter(message);
  if (message == null) {
  message= defaultMessage;
  }

  try {
  String repeatString = config.getInitParameter(repeats);
  repeats = Integer.parseInt(repeatString);
  } catch (NumberFormatException nfe) {
  }
  }



The missing link is that you need to use a servlet-mapping to connect a
particular request URL to the servlet definition, then use that URL to
request the servlet's output.

 Scott Purcell


Craig McClanahan


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




web.inf still need help ... Please

2001-12-13 Thread Purcell, Scott

I am still lost with the web.inf file.
All I want to do is run an example of using the init() to get one time start
up initializers into a servlet.
I am on tomcat 3.2 and all seems to run fine.
I have a basic install and I am just using my localhost. I am learning how
to do JSP and Servlets.

My install is: D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT
My Classes are:
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\WEB-INF\classes
and I created a package called cwp in the classes dir.

All my classpaths are set and all runs great. I just cannot get the
following code to work. According to my book, this should go to the
...\WEB-INF directory and read the web.xml file (shown below) and get
parameters. But I have been jacking with this for hours and I am getting
frustrated. Can someone assist me with what I may be doing wrong? Do I need
to register something else? Or is the web.xml file all that needs to be
updated? 
Is there a way to find out where the getServletConfig() is looking? That may
help with this mess also.

Here is my class:

package cwp;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;

public class ShowMessage extends HttpServlet {

 private String message;
 private String defaultMessage= No Messages Today2;
 private int repeats = 1;
 private String stuff;
 
  public void init() throws ServletException { 
 ServletConfig config = getServletConfig(); // suposed to go read
the web.xml file but it does not.
 message = config.getInitParameter(message);
 }
 
 public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
 
response.setContentType(text/html);
PrintWriter out = response.getWriter();
String title = The ShowMessage Servlet;
out.println(ServletUtilities.headWithTitle(title) +
BODY BGCOLOR=\#FdF5E6\\n +
H1 ALIGN=\CENTER\ + title + /H1);
for (int i=0; irepeats; i++) {
out.println(B + message + /BBR + stuff);
}
out.println(/BODY/HTML\n);
 }
}

here is my web.xml file
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;



web-app
servlet
servlet-nameShowMsg/servlet-name
servlet-classcwp.ShowMessage/servlet-class
init-param
param-namemessage/param-name
param-valuefm/param-value
/init-param
init-param
param-namerepeats/param-name
param-value5/param-value
/init-param
/servlet
/web-app


Scott Purcell


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: web.inf still need help ... Please

2001-12-13 Thread Purcell, Scott

Thanks Larry,
Now I have something to try.

I will get on it asap.

Thanks
Scott

-Original Message-
From: Larry Isaacs [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 3:05 PM
To: 'Tomcat Users List'
Subject: RE: web.inf still need help ... Please


Note that http://localhost:8080/servlet/cwp.ShowMessage
will not see the init parameter since the invoker servlet
(i.e. /servlet) is not part of the Servlet spec.  You
should include a servlet-mapping in the web.xml and
invoke the servlet using the url-pattern specified.  Then
the servlet should see the init parameters.

Cheers,
Larry


 -Original Message-
 From: Purcell, Scott [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 3:48 PM
 To: '[EMAIL PROTECTED]'
 Subject: web.inf still need help ... Please
 
 
 I am still lost with the web.inf file.
 All I want to do is run an example of using the init() to get 
 one time start
 up initializers into a servlet.
 I am on tomcat 3.2 and all seems to run fine.
 I have a basic install and I am just using my localhost. I am 
 learning how
 to do JSP and Servlets.
 
 My install is: D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT
 My Classes are:
 D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\WEB-INF\classes
 and I created a package called cwp in the classes dir.
 
 All my classpaths are set and all runs great. I just cannot get the
 following code to work. According to my book, this should go to the
 ...\WEB-INF directory and read the web.xml file (shown below) and get
 parameters. But I have been jacking with this for hours and I 
 am getting
 frustrated. Can someone assist me with what I may be doing 
 wrong? Do I need
 to register something else? Or is the web.xml file all that 
 needs to be
 updated? 
 Is there a way to find out where the getServletConfig() is 
 looking? That may
 help with this mess also.
 
 Here is my class:
 
 package cwp;
 
 import java.io.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 import java.util.*;
 
 public class ShowMessage extends HttpServlet {
 
  private String message;
  private String defaultMessage= No Messages Today2;
  private int repeats = 1;
  private String stuff;
  
   public void init() throws ServletException { 
  ServletConfig config = getServletConfig(); // 
 suposed to go read
 the web.xml file but it does not.
  message = config.getInitParameter(message);
  }
  
  public void doGet(HttpServletRequest request, HttpServletResponse
 response) throws ServletException, IOException {
  
 response.setContentType(text/html);
 PrintWriter out = response.getWriter();
 String title = The ShowMessage Servlet;
 out.println(ServletUtilities.headWithTitle(title) +
 BODY BGCOLOR=\#FdF5E6\\n +
 H1 ALIGN=\CENTER\ + title + /H1);
 for (int i=0; irepeats; i++) {
 out.println(B + message + /BBR + stuff);
 }
 out.println(/BODY/HTML\n);
  }
 }
 
 here is my web.xml file
 ?xml version=1.0 encoding=ISO-8859-1?
 
 !DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
 http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;
 
 
 
 web-app
 servlet
 servlet-nameShowMsg/servlet-name
 servlet-classcwp.ShowMessage/servlet-class
 init-param
 param-namemessage/param-name
 param-valuefm/param-value
 /init-param
 init-param
 param-namerepeats/param-name
 param-value5/param-value
 /init-param
 /servlet
 /web-app
 
 
 Scott Purcell
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Tomcat/JSP Question

2001-06-01 Thread Purcell, Scott

I think you may have the syntax for 
  jsp:get_property
  jsp:set_property
wrong.
It is jsp:getProperty()
and jsp:setProperty()
 
Here is a textbook example from Fields and Kolbs book. Hope it helps
#JSP
 
% page import = com.taglib.wdjsp.components.CompoundIntrestBean %
jsp:useBean id=calculator class=CompoundInterestBean /
jsp:setProperty name=calculator property=principal /
/jsp:useBean
jsp:getProperty name=calculator property=principal /
 
Hope that helps,
Scott
 
 
 

-Original Message-
From: Mike Alba [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 2:47 PM
To: [EMAIL PROTECTED]
Subject: Tomcat/JSP Question


Hi,
 
  Forgive me for the beginner question but I am trying to 
instantiate a class for a JSP.
I am using:
jsp:useBean id = EX class = Example scope = session /

Thus I am under the assumption that my Example class is being
instantiated and the constructor is called, is this incorrect?
Basically I am trying to instantiate a class for a session and
was wondering if this is the way to do it. 
And so if it is can I access class objects, I am assuming
I am supposed to use 
  jsp:get_property
  jsp:set_property
 
rather then EX.counter
where counter is a property of the Example class
 
Once again sorry for the newbie question
and thanks for any help you can give!!
 
Mike




port 8080 to port 80?

2001-05-18 Thread Purcell, Scott

Hello,
I am using the Tomcat learning Servlets and JSP. All is well. I would like
to change the port from 8080 to 80.
I have Martys Halls book and it says to edit the port number in the
/install_dir/webserver.xml file and replace 8080 with 80. But I do not see
the line as he shows on page 16 of his book.

I believe this would be simple. Has anyone done this on tomcat 3.22b2?

Thanks you

Scott Purcell






Servlet Placement

2001-05-18 Thread Purcell, Scott

Hello,
I am following Martys book and I am missing something slight.

I created a HelloWorld servlet and placed it in the
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\WEB-INF\classes
and also set my ENV on NT for the servlet.jar and jasper and I CAN YES
compile and all is well.
In my browser if I call http://localhost:8080/servlet/HelloWorld all is
good.

So now I created a directory under classes called coreservlets and moved
that HelloWorld.java file into there, added the package coreservlets; at the
top of the file, recompiled the file (that went well) but I can't get it to
show up in the browser.
I tried
http://localhost:8080/servlet/HelloWorld that does not work.
http://localhost:8080/servlet/coreservlet and that does not work.? Do I need
to set some other ENV for that coreservlet directory? which is where I am
going to put all my testing files?

Thanks,

Scott Purcell




ServletConfig question on Tomcat

2001-05-18 Thread Purcell, Scott

Hello And Happy Friday to all.

I am working out of Marty's Core Servlets book and I am having trouble
getting an init statement to work.
For those that have the book it is on page 40. If you don't have the book, I
will try and explain it here.

The code below is suposed to look at the web.xml file for some init
parameters. According to the book the web.xml file is to be placed in the
/installdir/webpages/WEB-INF and the file just lists param names and values.

And according to the book, when a servlet gets called and it has the
following method
public void init(ServletConfig config)
super.init(config);
message = config.getInitParameter(message);

that this init gets called just once, and all subsequent hits of this are
threaded. So its a one time initialization.

I have the web.xml file filled out properly and I have my class file in the
/installdir/webapps/root/web-inf/classes/coreservlets and I marked my code
with package coreservlets. All works, it just does not go out and get the
web.xml file for my info.

Below is all the code, you can try and run it, if you like. It looks kind of
cool, and I would like to get it to run.
If anyone understands, or knows of a missing config in my setup, please let
me know.


Thanks
Scott Purcell

 code #
package coreservlets;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class ShowMessage extends HttpServlet {
private String message;
private String defaultMessage = No New Messages;
private int repeats = 1;

public void init(ServletConfig config) throws ServletException {
super.init(config);
message = config.getInitParameter(message);
if (message == null) {
message = defaultMessage;
}
try {
String repeatString = config.getInitParameter(repeats);
repeats = Integer.parseInt(repeatString);
} catch(NumberFormatException nfe) {
}
}


public void doGet(HttpServletRequest request,
  HttpServletResponse response)
throws ServletException, IOException {
response.setContentType(text/html);
PrintWriter out = response.getWriter();
String title = The ShowMessage Servlet;
out.println(ServletUtil.headWithTitle(title) +
BODY BGCOLOR=\#fdf5e6\\n +
H1 ALIGN=CENTER + title + /h1);
for (int i=0; irepeats; i++) {
out.println(message + br);
}
out.println(/BODY/HTML);
}
}


 xml 
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;

web-app
  servlet
servlet-name
  ShowMessage
/servlet-name

servlet-class
  coreservlets.ShowMessage
/servlet-class

init-param
  param-name
message
  /param-name
  param-value
Shibboleth
  /param-value
/init-param

init-param
  param-name
repeats
  /param-name
  param-value
10
  /param-value
/init-param
  /servlet
  
/web-app



RE: ServletConfig question on Tomcat

2001-05-18 Thread Purcell, Scott

Thanks,
Ill give that a shot, and let you know.
Scott

-Original Message-
From: HD [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 18, 2001 1:52 PM
To: [EMAIL PROTECTED]
Subject: Re: ServletConfig question on Tomcat


Try to put your servlet directly under Web-inf/classes
instead of put it in your pkg coreservlets.
See if it works.

As my exp, I usually create the package under webapps,
then Web-inf/classes is directly under that directory.
 All servlets are placed under classes.
then go to URL:
localhost:8080/pkg_name/servlet/servlet-name

I think I had a similar problem when not putting a
servlet in the class directory but in another dir
which is under class dir.

Hope this helps.


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Register a Servlet?

2001-05-18 Thread Purcell, Scott

Hello,
How do you register a servlet under the tomcat?

My book says to register the servlet (page 39) of Marty's book.?

Does anyone know what they mean?

Thanks

Scott Purcell




Where do Servlets go?

2001-05-04 Thread Purcell, Scott

Hello,
I have the book, Java Server Pages from Duane K Fields and Kolb, and I am
running the tomcat server. I just used the default install. Anyway, I want
to try an example from the book, but do not know where to put the Servlet so
my .jsp page can find it.

I was hoping someone could explain to me, where these two files should go.
If they go in the same dir somewhere, or in different dirs.?

Also, if there is anything else I should know, please advise.


Thanks have a nice Friday,

Scott Purcell



Scott Purcell




CSS Help

2001-04-18 Thread Purcell, Scott

Hello,
I am starting to test out the Tomcat Server, and I am doing an example that
is in the Core Servlets and JSP book. Anyway, they have an example of using
some CSS in a resume posting example. 

I am entering the HTML into the following folder under Tomcat:
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\test.html

So I decided to put my CCS page here also
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\test.css

The beginning of my HTML has the following:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional/EN"
HTML
HEAD
   TITLEFree Resume Posting/TITLE
   LINK REL=STYLESHEET HREF="test.css" TYPE="text/css"
/HEAD
BODY


I have tried about everything, but I cannot pick up the CSS file? I have
restarted the tomcat, and cleared browser cache, quit the browser. Here is
the message from the Tomcat Console.

2001-04-18 09:16:29 - Ctx( /jobs-site-styles.css ): 404 R(
/jobs-site-styles.css
 +  + null) null
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): FileHandler: Ends with
\/. D
:\tomcat\jakarta-tomcat-3.2.2b2\webapps\jobs-site-styles.css\
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): 404 R(
/jobs-site-styles.css
 +  + null) null
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): FileHandler: Ends with
\/. D
:\tomcat\jakarta-tomcat-3.2.2b2\webapps\jobs-site-styles.css\
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): 404 R(
/jobs-site-styles.css
 +  + null) null

I see a slash before jobs but it is not in my HTML? This is my first CSS
mission, does anyone see any issues here?

Thanks
Scott Purcell




RE: CSS Help

2001-04-18 Thread Purcell, Scott

Thanks Greg,
I have no clue why, but I changed to your way, and it runs fine. Only the
browser Gods know why this kind of wierdness occurs.


Scott

-Original Message-
From: Greg Chakmakian [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 9:36 AM
To: [EMAIL PROTECTED]
Subject: RE: CSS Help


This is the way I've always done it. . .

LINK href="style.css" rel=stylesheet type=text/css


. . And I put it in between my head tags like you did.  Hope this helps.

-greg




-Original Message-----
From: Purcell, Scott [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 10:18 AM
To: '[EMAIL PROTECTED]'
Subject: CSS Help


Hello,
I am starting to test out the Tomcat Server, and I am doing an example that
is in the Core Servlets and JSP book. Anyway, they have an example of using
some CSS in a resume posting example. 

I am entering the HTML into the following folder under Tomcat:
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\test.html

So I decided to put my CCS page here also
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\test.css

The beginning of my HTML has the following:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional/EN"
HTML
HEAD
   TITLEFree Resume Posting/TITLE
   LINK REL=STYLESHEET HREF="test.css" TYPE="text/css"
/HEAD
BODY


I have tried about everything, but I cannot pick up the CSS file? I have
restarted the tomcat, and cleared browser cache, quit the browser. Here is
the message from the Tomcat Console.

2001-04-18 09:16:29 - Ctx( /jobs-site-styles.css ): 404 R(
/jobs-site-styles.css
 +  + null) null
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): FileHandler: Ends with
\/. D
:\tomcat\jakarta-tomcat-3.2.2b2\webapps\jobs-site-styles.css\
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): 404 R(
/jobs-site-styles.css
 +  + null) null
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): FileHandler: Ends with
\/. D
:\tomcat\jakarta-tomcat-3.2.2b2\webapps\jobs-site-styles.css\
2001-04-18 09:16:30 - Ctx( /jobs-site-styles.css ): 404 R(
/jobs-site-styles.css
 +  + null) null

I see a slash before jobs but it is not in my HTML? This is my first CSS
mission, does anyone see any issues here?

Thanks
Scott Purcell




Code Q.

2001-04-18 Thread Purcell, Scott

Hello, 
I am learning JSP and have done quite a few examples from the Core Servlets
and JSP book. 
I apologize for asking this q here, but I am trying to learn Tomcat and put
my whole picture together, and I figured that
the people on this line, would probably know what these lines mean.
Anyway, I keep typing these few lines but really don't have a grasp of what
they are doing. 
I would really like to understand in a 'Laymans' fashion what I am doing and
what these lines do. 
public class Hello extends HttpServlet { 
//I am assuming that the class Hello, that I am creating 
// is extending HttpServlet class? 
// but what does the extends really mean? 
public void doGet(HttpServlet request, 
HttpServlet response) 
throws ServletException, IOExcedption; 
// It looks like I am creating? or calling? a method here. And am I passing
it the HttpServlet class? 
I am very confused on this, and would enjoy hearing from someone that
wouldn't mind going over that with me. 
Thanks very much, 
Sincerely 
Scott 






Classpaths

2001-04-16 Thread Purcell, Scott

Hello,
I am confused on CLASSPATH variable on my NT 4.0 box. I am running the
tomcat server, and the Sun book for Core JSP says I can make a folder called
classes in the installdir. My install is at the following location:
D:\tomcat\jakarta-tomcat-3.2.2b2
Inside there are libsrcconfdoclogswebappsworkbinLICENSE
The book says I should create a dir at that level called classes which I
can insert my servlets. 
So I created a dir called classes, and put in a few java files.

I set the CLASSPTH like this:
set CLASSPATH=.;D:\tomcat\jakarta-tomcat-3.2.2b2\lib\servlet.jar
I assume that will get all the classes I need like the HttpServlet, etc.

And that seemed to work. But later I was working on packages, and they said
to do some other classpaths for working with packages, and now I am all
screwed up. 

My Question:
Can I look at what CLASSPATHS are set? If so, how?
How do I work with packages and keep all these paths straight?

Any assistance would be appreciated.
Scott




Newbie Questions JSP/Tomcat

2001-04-16 Thread Purcell, Scott

Hello,
I am new to JSP and especially Tomcat. I do have it installed and working on
a NT4.0 Box.

Anyway, I am working out of Suns book "Core Servlets And JavaServer Pages".
On page 25 they talk about placing Servlets in the install_dir/classes
directory. My install did not come with a classes dir, in the install_dir?
should I create one? I just want to invoke some simple servlets from the
book to get a handle on how things work.

Also, if I place that directory there, and I update my servlet.java file, I
assume I need to recompile the servlet, and also restart the tomcat? Because
that doesn't seem very efficient. But if that is the way it is I would like
to know.

One last Question. my background is Perl/CGI and I have taken two of suns
classes for Java. But I am not very good with the Java language yet. (my
problem is understanding extending, and that sort of OO stuff). Is it going
to be a problem trying to learn JSP without a great background in Java? Or
if I hack on JSP, will that help me understand the java language a little
better? Kind of a egg or chicken thing going here.

Thanks for any advice or assistance,
Sincerely
Scott









Package Q

2001-04-16 Thread Purcell, Scott

Hello,
I am running the tomcat web server and I am working on Servlets. My install
is on
D:\tomcat\jakarta-tomcat-3.2.2b2
I am working on packages from Suns book, and have had success with creating
a folder called coreservlets under the following path:
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\WEB-INF\classes\coreservlets
and have created some .java files there and have compiled. So I am competent
with my CLASSPATH settings. 

My question:
Now the book is calling (on page 33) two .java files. One calling the other.
The book stated to put both .java files into the coreservlets folder but
does not tell me how to compile this. So I try to compile as if it were a
normal .java file, but the calling file does not find the other file.
eg.
These two files are both sitting in the coreservlets folder, but I get
errors (as if I doesn't see the ServletUtilities.java file);
### file 1
package coreservlets;

import javax.servlet.*;
import javax.servlet.http.*;

public class ServletUtilities {
public static final String DOCTYPE = "!DOCTYPE HTML PUBLIC
\"=//W3C//DTD HTML 4.0 " + "Transitional/EN\"";

public static String headWithTitle(String title) {
return (DOCTYPE + "\n" +
"html\n" +
"head/title" + title + "/title/head\n");
}
}
# file 2
package coreservlets;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWWW3 extends HttpServlet {
public void doGet(HttpServletRequest request,
  HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(ServletUtilities.headWithTitle("Hello") +
"body bgcolor=\"red\"\n" +
"h1Hello WWW Red/h1\n" +
"/body/html");
}
}

But when I compile I get the following error:
 -d
D:\tomcat\jakarta-tomcat-3.2.2b2\webapps\ROOT\WEB-INF\classes\coreservlets
elloWWW3.java
HelloWWW3.java:13: cannot resolve symbol
symbol  : variable ServletUtilities
location: class coreservlets.HelloWWW3
out.println(ServletUtilities.headWithTitle("Hello") +
^
1 error

So that tells me it cannot find the ServletUtilities file?

Could someone try and get me through this?

Thanks
Scott



newbie Q on config

2001-03-30 Thread Purcell, Scott

Hello,
I have downloaded the Tomcat binary product onto my NT box here at the
office. I am studying JSP, and want to use the Tomcat to run simple JSP
files which may  consist of either Servlets or Beans.

Anyway, I downloaded it, went to: d:\tomcat\jakarta-tomcat-3.2.2b2\bin 
and issued a startup, which produced the following.
2001-03-30 02:52:00 - ContextManager: Adding context Ctx( /examples )
2001-03-30 02:52:00 - ContextManager: Adding context Ctx( /admin )
Starting tomcat. Check logs/tomcat.log for error messages
2001-03-30 02:52:00 - ContextManager: Adding context Ctx(  )
2001-03-30 02:52:00 - ContextManager: Adding context Ctx( /test )
2001-03-30 02:52:01 - PoolTcpConnector: Starting HttpConnectionHandler on
8080
2001-03-30 02:52:01 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007

All looks good here, I believe.
there are documents (.html) files in the doc directory, so I tried doing the
following from a browser:
http://127.0.0.1/index.html
but it did not respond? 

So my question is, doesn't one call it like that, or is there some other way
to call it.? And should I be able to just put a .jsp file somewhere to
test.? I figured it would probably go into the doc directory, but I don't
want to screw anything up. So I am asking for some assistance first.

Thank you,
Sincerely
Scott






Scott Purcell