RE: BLOB FROM JSP PAGE

2002-01-25 Thread Michael Wentzel

   Your problem stems from (A) you can't call 
 response.getOutputStream
 after you call response.getWriter and (B) all JSPs call 
 response.getWriter
 before they start executing your code.  Move the code to a 
 servlet and you
 will be fine.

If you want to see more details about what Randy is talking about
here take a look at the java file generated from you jsp and
it will explain it more.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Please HELP. blank JSP at client

2002-01-18 Thread Michael Wentzel

 Hi,
 I have a little problem with JSP pages.
 
 JSP pages are working well at server (Tomcat is used). But although
 the url is correct, jsp pages show nothing at clients.
 
 I think, Explorer setting lead to this problem. But I can`t find the
 actual reason. What might be the problem?

A few questions for more details:
1. what port are you using 80 or default?  And if not 80 does the client
site have a firewall which might prevent access from other ports?  If so
you'll probably want to move Tomcat to port 80 if possible.

2. Is the screen truly blank?  Just plain white with no error messages
or anything?  Or if there is an error 404, 405, ... what is it?

3. Are other sites able to be browsed from the client site?  Can they access
stuff like www.slashdot.org, www.userfriendly.org, www.sourceforge.net, ...?
You know, the good stuff;)  If not it's their problem not yours so to speak.

4. Is there any information in the tomcat logs?  What is your configuration?
Tomcat standalone/with apache/with IIS, operating system, etc...?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: trap Browser Close

2002-01-18 Thread Michael Wentzel

 Can I trap browser close  event and send the message back to 
 the server
 when then user either closes the browser window or kills the browser.
 I have to check in some licenses once the user session is over.
 I am using apache 1.3.12 with tomcat 3.2.2

Take a look at the HttpSessionBindingListener.

Your not really trapping the browser close but anytime the accessing user is
no
longer valid.  Note that this session will not be invalidated if the browser
remains open and the user simply goes somewhere else.  In this case it won't
be invalidated until the timeout.

There have been numerous posts on the list in the past.  If you take a look
at
the archives you'll find all the information you need.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: problems with JDBCRealm and oracle

2002-01-18 Thread Michael Wentzel

 My tomcat 4.0.1 runs on a WinNT-machine. In server.xml i' 
 have configured a
 JDBC Realm with the following code:
 Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
  driverName=oracle.jdbc.driver.OracleDriver
  
 connectionURL=jdbc:oracle:thin:@iv003866:1521:db02?user=scott
 ;password=tige
 r
   userTable=users userNameCol=user_name
 userCredCol=user_pass
   userRoleTable=user_roles roleNameCol=role_name /
 
 But when I try to start tomcat I get the following error messages:
 Catalina.start: LifecycleException:  Exception opening 
 database connection:
 a.sql.SQLException: Ung³ltige Argumente in Aufruf (= invalid 
 arguments when
 calling)
 LifecycleException:  Exception opening database connection:
 java.sql.SQLExce
 on: Ung³ltige Argumente in Aufruf
 at 
 org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
 at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:11

Are you able to log into that database directly through the oracle
admin tools using that username and password?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Tomcat and Oracle JDBC-ODBC connection problem. Please help!

2002-01-18 Thread Michael Wentzel

 I have installed tomacat to set up Oracle JDBC-ODBC driver,
 data source... but ran into some problmes:
 
 The database connection with Oracle only works with .java
 files but does not work with jsp files.
 
 For example: test.java would work but test.jsp would not.
 
 This is the error message I got when running with test.jsp:
 
 OCI.DLL: One of the library files needed to run this
 appliction cannot be found.  Can anyone tell me what might
 be the problem?  I checked the dll dependency for OCI.DLL,
 all dll files are there.

Why use the JDBC-ODBC bridge.  It's not really necessary just use
one of the oracle JDBC drivers and forget the bridge.  Several issues,
including threading, pop up when using the bridge.  You can search the
archives if you need more info.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Advantages using Apache httpd

2002-01-18 Thread Michael Wentzel

 What are the advantages from using Apache with Tomcat instead of a
 stand-alone Tomcat?
 I've read the docs but I wanted to hear from other people with
 experience from using it.

Apache is a fine tuned httpd for static content and therefore typically
suppasses Tomcat for serving static content.  In addition, utilizing
Apache also allows you to use other dynamic content such as PHP, Perl,
etc...

Our deliverables have always been with either an IIS or Apache integration
so I can't speak for a comparison of the production performance comparison
between these configurations but it basically comes down to a couple things:

* do you want to fine tune your webserver?
* are you going to have a good deal of static content?

If you answer yes to one or both of these then I would personally suggest
using integration.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Advantages using Apache httpd

2002-01-18 Thread Michael Wentzel

 Another question about apache:
 
 The time that goes between apache delegating requests to 
 tomcat and tomcat
 answering back instead of tomcat answering directly is worthwhile???

I've never done any real scaled testing of large systems so I can only 
speak theoretically here but it kind of depends on your content.  For
example, since static content includes gif's, png's, jpg's, movies, audio,
as well as html if there is also a significant amount of content in
these types of media there may be a noticed improvement when your app
begins to experience increased traffic.  Another thing to take into
consideration here is browser caching of static files and how this will
affect all of this performance.  I'm not sure but I believe that there
is also a, very small, overhead for Tomcat when it encounters a socket 
disconnect from the client(for example when the browser caches a file a.gif 
and  disconnects the requested socket for that file and uses the cached 
version instead).



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: multiple java processes

2002-01-18 Thread Michael Wentzel

 When I start tomcat and do a ps I see 18 java processes have 
 started.  Is
 this normal?  Why are they all there?

Yes it is.  If you want more information try doing a search on this topic in
the archives.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: URGENT HELP REQUIRED. PLEASE RESPOND IMMEDIATELY

2002-01-16 Thread Michael Wentzel

 Posting multiple times within the hour doesn't get your 
 question answered faster.

Yeah, most of the time it can do just the opposite and get you 
on the bad end of a mail filter;)  To state the obvious, it appears
you problem is around the Resource/Resource Param elements.  So I
would start doing some research around that area.  I not real
familiar with 4.0 since we work primary with 3.x so that's as much
help as I can provide.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: jsp wont open unless port 8080 is specified in browser

2002-01-16 Thread Michael Wentzel

 Thanks a lot for your help Travis. I dont suppose you could 
 tell me how to
 configure my windows 2000 server to pass all jsp
 files to tomcat would you?

You need to follow the link Travis provided and how to configure IIS.
Windows 2000 will not pass on the request.  IIS is the WebServer provided
with Windows 2000 Server, or alternatively you can use Apache, but make 
sure you turn off IIS.

This is an issue that is handled well by the documentation so this should
be your first resource.  In addition, this question has been answered and
discussed several times(innumerable) on this list in the past so if you
encounter stumbling blocks(I can assure you someone has asked the question
before), please check one of the list archives and search for IIS or Apache
respectively.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Use of Java Classes in .JSP fails under Tomcat 3.2

2002-01-16 Thread Michael Wentzel

 When I attempt to access methods defined in Java from a .JSP, 
 I am receiving
 a message that the method is not being found.  For example, I 
 have been
 testing with the following .JSP:
 
 %@page import=java.util.*, java.lang.*%
 %
   // Test
 
   String myString = 100 ;
   int myInt = parseInt(myString) ;
   out.println(myInt is  + myInt) ;
 
 %
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0//EN
 html
   head
   titleSimple Test of JAVA Classes/title
   body
   /body
 /html
 
 When I run this .JSP under Tomcat 3.2, I am receiving the 
 following message:
 
 Error: 500
 Location: /testapps/javaTest.jsp
 Internal Servlet Error:
 
 org.apache.jasper.JasperException: Unable to compile class for
 JSP/usr/tomcat/work/localhost_8080%2Ftestapps/_0002fjavaTest_0
 002ejspjavaTes
 t_jsp_0.java:65: Method parseInt(java.lang.String) not found in class
 _0002fjavaTest_0002ejspjavaTest_jsp_0.
   int myInt = parseInt(myString) ;
   ^

You can't simply say parseInt(1.00);  you have to let the compiler
know what instance, or in this case static instance, you want to call
the method on.  The reason for this is this method may be defined in
several different class and the compiler won't know which to use.
What the compiler is actually telling you is it looked for a method with
the signature int parseInt(String s) defined in the current class(the JSP).

Therefore, use the following,

Integer.parseInt(1.00)

This notifies the compiler to use the parseInt method in the Integer
class.  Also, just as a note, the import of java.lang.* is unnecessary.
This is an implicit import.

I would suggest getting a good java book and reading up on the basics of
java before diving head first into servlets, jsp, and Tomcat.  This is a
very core theory in java and it doesn't seem like to fully understand the
core theories of java yet.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Connecting Apache and Tomcat

2002-01-16 Thread Michael Wentzel

 I am having difficulty finding either mod_jk or mod_webapp to 
 connect Apache
 1.3.x to Tomcat 4.1. If anybody could send a URL or info I 
 would greatly
 appreciate it.

Do you mean 4.0.1?  I'm not aware there was a 4.1 yet.  If you need
the 4.0 mod webapp check under(I believe): 

http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0/bin/

Haven't checked the link in a while but I believe that's where it is.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: tomcat apache configuration

2002-01-09 Thread Michael Wentzel

 Hello, 
 I had earlier tomcat 3.2.3 standalone with me running fine 
 where in I could
 all the application context in server.xml file.
 now I want to upgrade to Tomcat 3.3  but I find there is no 
 place where I
 can add the context for the new webapps in th server.xml config file
 also I am intersted in configuring Apache1.3.22 with Tomcat3.3
 Pls let me know  step by step procedure for the same

I think you need to start by reading the documentation!  First off if
you don't understand the basics of configuring Tomcat you will never
be able to fine tune it to your specific needs.  Secondly, all of this
information is provided in the docs therefore no reason to repeat it
here.

Sorry if this seems harsh but that's the facts.  The true purpose, at
least in my opinion, of this list is for help with problems not tutorials.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: tomcat apache configuration

2002-01-09 Thread Michael Wentzel

 I am encountering a problem with tomcat 3.2.3 running 
 standalone on windows
 NT
 
 In all jsp I have some gif images and some js files being accessed...
 now on the Tomcat console window, the below mentioned kind of 
 exception is
 being displayed though on the browser there is no problem on the page
 
 Like on this page I am accessing 2 files date-picker.js  and
 ValidateESRSearch.js 
 2002-01-09 17:16:44 - Ctx( /testapp ): IOException in: R( /testapp +
 /Validatelogin.js + null) socket write error (code=10053)
 2002-01-09 17:16:44 - Ctx( /testapp ): IOException in: R( /testapp +
 /scripts/ValidateESR.js + null) socket write error (code=10053)
 
 Now the problem is how to suppress theze exception or remove it
 All the images  are in the images sub folder in main folder 
 /testapp 
 All the js scripts are in the scripts sub folder in main 
 folder /testapp
 
 
 I am unable to understand why this socket write error is 
 being displayed

The reason for the exception is the browser determines it can use a cached
version of the file and ends the request for that file.  Tomcat has no way
of knowing if the problem is an error or not so it displays the IOException.

I'm not sure what logging level to use but I believe changing the logging
verbosity can remove these messages.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: NoClassDefFound

2002-01-09 Thread Michael Wentzel

   I am trying to run a stand alone class using the java +
 classname.class command and I got the NoClassDefFoundError exception.
 Could someone tell me what I should do?  Thanks very much.

don't include .class.  For example if my class file is MyClass.class

java MyClass

Also, btw, make sure your class is in the classpath.
This is really not a Tomcat specific question.  There are plenty of
general java forums out there(http://www.javaranch.com for example).
Please use these venues for these types of questions.  I would also
suggest picking up a good java book and taking the time to work through
it.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Help needed with package access

2002-01-07 Thread Michael Wentzel

 I am using tomcat and i am unable to compile my servlet 
 classes when i try
 to make an instance of a class that i have created which lies 
 in the same
 folder as my servlet, ie WEB-INF/classes.  A error occurs 
 telling me that it
 cannot resolve the class.
 
 The only way around this is to put these classes i need in 
 the jre/classes
 folder of my java home directory.
 
 Does anybody know a way around this problem so that my 
 servlets can 'see' my
 java classes in the classes folder, or below.

Try doing an explicit import of the class.  i.e. if your class you want to
instantiate is MyClass.class do the following in your servlet:

import MyClass;

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Problem with file URL

2002-01-07 Thread Michael Wentzel

 The OS I'm running on is Unix.  I did some preliminary 
 testing on NT (my
 browser and Tomcat server were on the same machine).  When I 
 ported to Unix,
 I started having issues.

What browser are you using on each of these platforms?  I have a
feeling that if you tested against NT with IE and Unix with 
Netscape the problem is IE is figuring out for you that it needs
to translate the file URL into an http URL.

Otherwise I don't know why it would work in one and not the other.
You may try using a different JVM on you unix box and see if that
affects anything, I doubt it though.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Problem with file URL

2002-01-07 Thread Michael Wentzel

BTW, is there a reason this is that important to you?  How many users 
try to access a url using the file protocol instead of http?

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Problem with file URL

2002-01-07 Thread Michael Wentzel

 There appears to be confusion about the 'file://' protocol.
 
 The file:// protocol is really not a protocol at all, since there 
 are no client-server communications involved. 
 This 'false' protocol identifier is simply a 'nice' little feature
 that web-browsers implement (URL/URLConnection also
 implements this), that provides the means of displaying a
 file stored on the client system (or on a drive that is
 mounted on the client system).
 
 The key here is 'client-system'. When you type a file://
 URL into your browser, your browser goes straight to
 your filesystem to get the file. It does not contact a web-server
 for this. 
 
 If you want to retrieve a 'file' from a web server, you must 
 provide a URL that starts with 'http://' (or https://).

That was kind of my point really.  The point being this is a browser
operation and not a server operation.  In other words, the point being
communicated to the originator of the question is that this is not a
problem with Tomcat, nor something you'd expect Tomcat to take care of,
but basically a browser implementation.

Protocol can really be used in a broad sense.  The file protocol, 
if you insist, is a expected behavior pattern among systems.  
i.e. You _expect_ it to work the same on a SunOS box as on a Linux box 
or a Windoze box.  I don't think there is any confusion just 
miscommunication in some cases.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Linux/windows, database choice, hosting, and whether to plug in to apache or not

2001-12-31 Thread Michael Wentzel


 1.  Should it run on Windows or Linux?   I suspect I should 
 use Linux but i Windows a viable option?

Matter of personal choice.  Many would say a linux server would be
more secure/stable but it really depends on what you're more comfortable
maintaining, your budget, and client preferences in my opinion.

 2.  Should I plug Tomcat into Apache web-server or is the build-in
 web-server for Tomcat good enough?

If you have a large number of static pages I would go with Apache as your
primary webserver or if you have to serve up other forms of dynamic content
such as php, py, etc... but if you're only going to have servlet and/or jsp
content or only a small number of static pages Tomcat standalone will do
fine.

 3.  Is mysql the best open source free database choice?

We use postgreSQL and it works well for us.  I believe postgreSQL works
better
than mySQL when datastores become larger but I'm not exactly sure.


HTH

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com


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




RE: Does security realms encrypt the passwords?

2001-12-27 Thread Michael Wentzel

  The JDBCRealm only compares password but you can specify in 
 the web.xml the
 algorithm you used in your table's column's passwords, it must be any
 algorithm that extends java.security.something, I don't 
 remember very well, so, the answer is that it really encrypts.

I think what he's really asking is if the password gets encrypted during
transmission not during the storage and comparator.  This does not happen
in the Realm api since there is no mechanism(to the best of my knowledge)
except secure sockets, to protect text passed over the socket connect
from the browser to the server.  Once the request is received by the server
encryption/decryption is easy but since browsers have no way of encrypting
the data(you could write something in javascript but it wouldn't be all that
secure since javascript is not a precompiled language) I'm willing to bet
that the actual text sent in the request(over wire) cannot be encrypt.  If
anyone does figure out a way to do this it would be interesting to know
(that's a hint to post it here...;).



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: java source security

2001-12-26 Thread Michael Wentzel

 I have a general Java question regarding safe-guarding java source code
 against decompilation.
 What's the best approach to do this?

There are a magnitude of java obfuscators and obfuscation libs out there
do a search from google and you'll find plenty of resources.

http://www.zelix.com/klassmaster/ - tried a while back and was pretty good
http://www.preemptive.com - expensive, haven't tried
http://www.force5.com/ - good optimization as well as obfuscation

http://jode.sourceforge.net/ - open source
http://www.retrologic.com/ - open source, tried a while back and liked it




---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Does security realms encrypt the passwords?

2001-12-26 Thread Michael Wentzel

 I'm using JDBC realms with Tomcat4.0 with a HTML form. My 
 question is, does 
 the password get sent over the internet in plain text format or is it 
 hashed/encrypted/digested in some way?
 
 A good idea would be to digest it together with a random 
 variable and the 
 session Id using Md5 for example. Otherwise the password will 
 be sent over 
 the internet in plain text format for any hacker to grab it...

The plain ole JDBCRealm does no encryption.  You'll have to extend JDBCRealm
to do any encryption.  JDBCRealm itself is only the server side code it does
not have anything to do with the way the text is sent in the request.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

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




RE: Deploying app under Apache+TomCat (newbie)

2001-09-18 Thread Michael Wentzel

 Where do the /admin, /examples and /test contexts come from? I didn't
 set them anywhere.

AutoConfig.  You can comment out this handler in your server.xml to disable
it.
By default Tomcat creates a context for each dir in webapps/

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Is this the way to do it?

2001-09-17 Thread Michael Wentzel

 snip
 
   Boolean BoolDans = new Boolean(false);
   Boolean BoolAllman = new Boolean(false);
   Boolean BoolFof = new Boolean(false);
   Boolean BoolTextil = new Boolean(false);
   Boolean BoolHp = new Boolean(false);
 
   if (request.getParameter(IntresseDans) != null) {BoolDans = new
 Boolean(true);};
   if (request.getParameter(IntresseAllman) != null) 
 {BoolAllman = new
 Boolean(true);};
   if (request.getParameter(IntresseFof) != null) {BoolFof = new
 Boolean(true);};
   if (request.getParameter(IntresseTextil) != null) 
 {BoolTextil = new
 Boolean(true);};
   if (request.getParameter(IntresseHp) != null) {BoolHp = new
 Boolean(true);};
 snip

a more compact way would also be:

boolean b = (request.getParameter(name)!=null);
or
Boolean b = new Boolean( (request.getParameter(name)!=null) );

I suggest picking up a java book and getting familiar with java, object
oriented code, and general programming practicum before jumping into
Tomcat and JSP.  If you don't have a good grasp on these basics it will
take you MUCH longer to generate efficient java/JSP code.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Help me, please about TomCat 4 and isapi_redirect.dll

2001-08-30 Thread Michael Wentzel

   I am trying to run jsp pages in IIS5.0, but I didn´t suceed 
 yet. Do I need
 to use isapi_redirect.dll how tomcat 3.2.3? and if I need, 
 how should I use
 this?

The short answer... Yes.
Have you had a chance to read the howto?
(http://jakarta.apache.org/tomcat/tomcat-3.2-doc/tomcat-iis-howto.html)

Also, there are a couple stumbling blocks that most people happen
across on their first try which can be found in the list archives.
http://www.aswethink.com/employees/randy/tomcat/mailingList.html


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: jspc

2001-08-29 Thread Michael Wentzel

  I'm trying to figure out a way to pre-compile .jsp pages 
 so that tomcat
 need not compile them on the fly and store the files in the
 /usr/local/tomcat/work directories. I'm trying to use jspc.sh 
 and it will
 create the necessary .java files, but then what do I do with them?
 What directory do they belong in, do I have to make class files?, what
 options to jspc.sh are needed ?

See the archives.  This has been answered a couple times before.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Strange Number format exception

2001-08-27 Thread Michael Wentzel

 I believe this is result of casting or converting a string to 
 an integer
 where the string is not an integer
 
 For example somwhere in the program you would have
 String str = 456;// this is suppose to be integers but the
 exception is raised if they are not and Java tries to convert them to
 integers.
 // meaning you might have 
 String str =
 blahblah;
 Integer num = new Integer (str);// this conversion will rais the
 NumberFormatException.

I believe, from Brandon's post, that he understands the concept of a
NumberFormatException.  He real question is why it is occurring and as
you can see in his stack trace:

 2001-08-27 02:04:14 - ContextManager: Error reading request, ignored -
 java.lang.NumberFormatException: 3379


the String which is trying to be interpreted seems to be 3379 which is
a perfectly valid Number(providing there are no invisible whitespace
characters after the 9.

I would pose that this is a bug and would suggest searching the developer
list to see if anyone has mentioned this one.

Also, check all your config/xml files and make sure there is no whitespace
where there shouldn't be.  A good idea would be to search for a file
containing
the string 3379.

Good Luck.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: registering servlets

2001-08-27 Thread Michael Wentzel

 I'm trying to register a servlet so that I can invoke it like this:
 
 http://host/any-path/servletName
 
 rather than:
 
 http://host/servlet/servletName
 
 I've tried adding my servlet to my web.xml using servlet-name and
 servlet-class, but I still have to go through /servlet/ to 
 get to it:
 
   servlet
 servlet-namesecretServlet/servlet-name
 servlet-classcoreservlets.ProtectedPage/servlet-class
 init-param
   param-namepasswordFile/param-name
  
 param-valueC:\\tomcat\\webapps\\ROOT\\WEB-INF\\passwords.pro
 perties/param
 -value
 /init-param
 load-on-startup2/load-on-startup
   /servlet
 
 Any suggestions?

You also need to add servlet mappings.  The 
/servlet/MyServlet mapping is in the spec for backwards
compatibility.  Take a look at the example web.xml(s)
to see how mappings work.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Session of Tomcat.

2001-08-16 Thread Michael Wentzel

 Can I catch the event when a session is created from tomcat?


Yes, take a look at javax.servlet.HttpSessionBindingListener in servlet API.
This has been covered on this group before please look at the list archives.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Session of Tomcat.

2001-08-16 Thread Michael Wentzel

   Can I catch the event when a session is created from tomcat?
  
  
  Yes, take a look at 
 javax.servlet.HttpSessionBindingListener in servlet API.
  This has been covered on this group before please look at 
 the list archives.
  
 
 Actually, this doesn't accurately answer the original question.
 
 You can indeed use HttpSessionBindingListener to detect when 
 a particular
 object is *added* to a session.  That is not the same as when 
 the session
 is *created*.  Note that it explicitly requires the application to
 participate (by adding a specific session attribute).
 
 In a servlet 2.3 environment (i.e. Tomcat 4), there is a new feature
 called application event listeners.  In particular, there are defined
 listeners for session created and session destroyed that 
 are called at
 those precise times, not just when a particular object is added and
 removed.

That is what I mean.  Binding Listeners and the Tomcat 4 implementation
of the listeners have been discussed before and can be referred to in
more detail in the archives.  I believe someone mentioned doing this
with a SessionInterceptor and the binding listener a while back but
I'm not sure.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com




Q: request replication

2001-08-09 Thread Michael Wentzel

I am having a unique situation pop up.  It's some
kind of concurrency issue but I can't figure out
what's causing it.  I am generating PDFs in a servlet
and a single request to the servlet works fine but
if two users request a PDF at roughly the same time
then the adobe plugin appears to get confused and
doesn't display the generated file.  Each users request
is actually getting made 3 times(using the same request
object) to generate 3 unique files(servlet generates
unique file ids).  I have removed AutoSetup ContextInterceptor so there is
only one instance of the servlet and the jsp calling the servlet is only
making a single request.  The first request for each PDF has a Referer and a
request.getRequestURI() each subsequent(duplicate) request does not have a
Referer.  Any suggestions would be appreciated.

TC 3.2
Win2K
Sun JDK 1.2


---
Michael Wentzel
Software Developer
a href=http://www.aswethink.com;Software As We Think/a



RE: can't open, can't be found

2001-08-09 Thread Michael Wentzel

 When I try to run some .jsp files under webapps, I got can't 
 open and not
 found message.
 
 Anyone knows why or give a guess?

A little more information would be helpful:

Are the jsp's in a specific context?
Can you run the example jsp's?
Can you load static content(.html)?
Are you running stand-alone or with Apache/IIS/...?
What's your config(JDK ver/distrib, OS, Tomcat ver, xml configs)?
What are the exact messages you are receiving?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: IIS+Tomcat Port issue

2001-08-07 Thread Michael Wentzel

 I've the following scenario...
 IIS listening on port 80. 
 Tomcat listening on port 8080.
 
 How do I restrict the users accessing Tomcat directly? 
 What configuration changes do I've to do in order to 
 accomplish this?

As long as your IIS-Tomcat connector is configured correctly you can simply
remove the HttpConnectionHandler from your server.xml.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: IIS+Tomcat Port issue

2001-08-07 Thread Michael Wentzel

 Do you mean on port 8080?
 Jeff

That's the only HttpConnector you mentioned you
were using


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: How do you change the base URL for your servlets in Tomcat?

2001-08-06 Thread Michael Wentzel

 Liam Morley wrote:
 
  Lars,
  You'll want to look at your server.xml file in the conf/ folder,
  specifically towards the bottom (Context /, Special webapps).
 
 Hi Liam.
 
 My problem is that I want to be able to create new web applications
 without editing the config file (server.xml). That is, if I 
 create a new
 directory in TOMCAT_HOME/webapps (with WEB-INF subdirectory 
 and so on),
 then it should be accesible as soon as I have restarted Tomcat. For
 instance: if I create the directory 'robinhat' in TOMCAT_HOME/webapps,
 then I can access it at:
 
 http://myserver/robinhat
 
 _without_ touching server.xml. You suggest, that I should edit the
 Context for every web application in server.xml, but I want to avoid
 that.


If your server.xml has the AutoSetup Servlet configured then all directories
under the webapps tree will be given their own context.  This should be
the default install.  This servlets goes through and finds directories in
the webapps directory which do not already have a context defined for them
and creates one.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: autoencoding issue

2001-08-06 Thread Michael Wentzel

 I'm using Tomcat 3.2.3, and I tried serving chinese (bg, 
 big5) using jsp
 and whenever someone views my pages, their browser's (IE 5, 
 Netscape 4.7) 
 autodetect for character encoding won't work, and they have 
 to manually
 switch the language to see the words.
 
 If one saves the file from the browser, auto-detect works fine.
 
 Any idea how I can resolve this?


It may help to define the meta charset 
( http://www.drclue.net/F1.cgi/HTML/META/META.html )
I haven't done this myself but give it a try.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Servllet

2001-08-06 Thread Michael Wentzel

 How about running an application that periodically posts to 
 the servlet?
 
 
  How can a servlet be automatically be invoked by
  itself, say peroidically?
  Usul

I think a better way is to write a servlet which is configured
as a load on startup servlet which forks a separate scheduler
thread which then defines tasks to be completed at specified
interval(using a properties file or init params...).  The
Thread(Runnable) will essentially be a infinite loop which will
check to see if it's time to run certain tasks. i.e.

while(1) {
if ( /*somethings true 1*/ ) {
/*perform task 1*/
}
if ( /*somethings true 2*/ ) {
/*perform task 2*/
}
// ...
}


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Servllet

2001-08-06 Thread Michael Wentzel

 Maybe do a sleep instead of busy waiting (looping takes up 
 too much cpu
 time).
 
   How about running an application that periodically posts to
   the servlet?
  
  
How can a servlet be automatically be invoked by
itself, say peroidically?
Usul
 
  I think a better way is to write a servlet which is configured
  as a load on startup servlet which forks a separate scheduler
  thread which then defines tasks to be completed at specified
  interval(using a properties file or init params...).  The
  Thread(Runnable) will essentially be a infinite loop which will
  check to see if it's time to run certain tasks. i.e.
 
  while(1) {
  if ( /*somethings true 1*/ ) {
  /*perform task 1*/
  }
  if ( /*somethings true 2*/ ) {
  /*perform task 2*/
  }
  // ...
  }

Yeah, that's the general idea.  That was the //... part any additional
cleanup between states and a wait state.  Otherwise the process, depending
on the performance of your separate scheduled jobs and the frequency of
them, could pretty much lock the processor down.  This is meant as a
rudamentary example.  This is the generic model of a scheduling
thread/server.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realms

2001-08-06 Thread Michael Wentzel

 I wonder if anyone else has come across this.
 
 I'm happily using JDBC Realms with Tomcat v3.3.
 
 I would like to let my users change their passwords - of 
 course I can put up
 a screen that lets them alter the value of their password on 
 the database,
 but then they have to log in again with the new password.  Is 
 there any way
 round this? - ie to let Tomcat know that they've entered a 
 new password?

If you're using FORM based authentication I believe you could do
a request passing with a username and new password passed in URL
as j_username and j_password to j_security_check.  Haven't tried
this myself but it's worth a try.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realms

2001-08-06 Thread Michael Wentzel

 You could store the password in the session.  When the user 
 changes his or
 her password, just update the session information.
 

Advantage: You don't lose existing session data
Disadv   : You're not actually re-authenticating

 
  If you're using FORM based authentication I believe you could do
  a request passing with a username and new password passed in URL
  as j_username and j_password to j_security_check.  Haven't tried
  this myself but it's worth a try.

Advantage: You're actually re-authenticating
Disadv   : You will lose existing session data and start with new session

It all depends on exactly what you're trying to accomplish and which 
method best fits your needs.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: jdbcRealm problem

2001-08-06 Thread Michael Wentzel

Check your Remote User, User Principal and Auth Type header values 
and see if they are getting set after the authorization call.  If
not this could be the problem.  If this is the case I would suggest
putting some additional debug code in JDBCRealm and recompiling it
(or using a debugger) to figure out where everything's going wrong.

Also, do you have any roles set up or are your constraints global?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realms

2001-08-06 Thread Michael Wentzel

 (not really authenticating, you lost me)

Just putting the password in the session doesn't
authenticate a user which I don't know why someone
would want to do this but I could see that someone
might want to re-login.  Putting something in the
session really doesn't have anything to do with 
authentication except that when a user is authenticated
typically a new session is created.

From Mark's email:
...they have to log in again with the new password...

After changing their password they still have a valid
session so there SHOULD be no need to re-authenticate
but there may be special case applications in which a
developer would need to do so.

In addition, it really not a good idea to store a
password in a session(even if encrypted).  It's just
a bad practice in general.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realms

2001-08-06 Thread Michael Wentzel

  Advantage: You don't lose existing session data
  Disadv   : You're not actually re-authenticating
 (not really authenticating, you lost me)

After looking at some code I figured something out...
I was thinking about this architecture wrong.  Kyle was
right just using:

session.setAttribute(j_password, sPassword);

will provide a hook for password changes.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Who should use JDBC realm

2001-08-01 Thread Michael Wentzel

 Hi
  I wanna know about JDBC realm.
   Who should use it  Y.
  Please let me know
 Thanks.

JDBCRealm is a method for securing you webapp.  In
my opinion two of the guidelines for choosing to
go with a JDBCRealm is if you want a security system
which is fully portable to any OS and if you want a
managed authentication free from having to develop
one for yourself.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Windows Versus Linux

2001-08-01 Thread Michael Wentzel

 I am new to the mailing list, so sorry if this
 question has been asked before.  I have been doing
 most my development on a Windows 98 box and setting up
 Apache, Tomcat and Mysql was a snap, but I am trying
 to setup a Linux server and it has been a pain so far.
  I know my way around the Linux operating system, but
 for some reason I can't get all the pieces to work
 together properly.  I was wondering if there is any
 big benefit to running Apache, Tomcat and Mysql on
 Linux over Windows NT server.  I plan to buy Windows
 NT server if I can't get this setup tonight.

Besides being free...  In my opinion(this is a highly
contested argument:), Linux is more stable and more 
secure.  A perfect example is the recent Code Red Worm
which attacks IIS.  While you aren't going to be running
IIS(I assume) it's just a general design philosophy.

In the end I think it comes down to personal preference
and/or what your client/boss says they want to use.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: HTTP 404 Error

2001-08-01 Thread Michael Wentzel

 I'm stumped.  I have the following directory structure/files:
 
 c:/tomcat/webapps/ServletTest/WEB-INF/web.xml
 c:/tomcat/webapps/ServletTest/WEB-INF/classes/ServletTest.class
 
 I added the following to my server.xml file:
 
 Context path=/ServletTest
  docBase=webapps/ServletTest
  crossContext=false
  debug=0
  reloadable=true 
 /Context
 
 And my web.xml contains:
 
 web-app
   servlet
 servlet-nameServletTest/servlet-name
 servlet-classServletTest/servlet-class
   /servlet
   servlet-mapping
 servlet-nameServletTest/servlet-name
 url-pattern/ServletTest/url-pattern
   /servlet-mapping
 /web-app
 
 If I attempt to open http://localhost/ServletTest, I get HTTP 
 404, file not
 found.
 If I attempt to open http://localhost:8080/ServletTest, I get the page
 cannot be displayed.

To get your desired results you can either change your server.xml to be
Context path=/
  docBase=webapps/ServletTest
  crossContext=false
  debug=0
  reloadable=true 
/Context
where the important thing to note is the path, or you can change the request
to be http://localhost:8080/ServletTest/ServletTest.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com




RE: Tomcat and Apache, very newbie question !

2001-08-01 Thread Michael Wentzel

 Apache is an HTTPD, where Tomcat is a servlet container (engine).

Actually, Tomcat is also a httpd although not quite a effecient of
a daemon as Apache, hence why it can also serve static content.
 
 Could some one, give a brief explanation about why to use Apache and
 Tomcat Together ?? what is the main difference between them ?

In all seriousness, I think you need to read the docs and search the 
archive to get your answer for these questions.  These resources will
provide plenty of information for you to figure out what's going on
with.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: apache-tomcat

2001-07-30 Thread Michael Wentzel

 can anybody please tell me how to ascertain that my apache is 
 talking to my
 tomcat ?
 i am using win NT 4.0
tomcat 3.2.2
apache 1.3.11

Pretty easy way is if your jsp's aren't coming up correctly when
accessing through apache...

1. Test apache alone(i.e. static content stuff not served by tomcat)
2. Test tomcat alone(i.e. direct access using specifying tomcats port in
url)

If both work the problem is with your config of the connections.
If either or both fail then you've got some other problems.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Warning: Security Hole With IIS Tomcat

2001-07-27 Thread Michael Wentzel

 Our tomcat directory is C:\Tomcat
 
 Its outside of the inetpub heirarchy, but it is set up in IIS 
 as a virtual
 directory with execute permissions open.
 
 Can hackers still exploit the malformed url handling in IIS 
 with this set
 up?

I don't believe that the virtual dir will allow the traversal to
parent directories but don't take my word for it.  You could always
give it a test yourself.

BTW, one solution is to leave tomcat installed on C: but move
your webapps to another dir along with inetpub.  In server.xml
you can set your context docbase, i.e.

Context path=/ docBase=d:/webapps/Context

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Dynamically Generate PDF

2001-07-25 Thread Michael Wentzel

 I was working on the same problem and have been told of a 
 java utility to
 convert XSL formatted XML into PDF:
 
   http://xml.apache.org/fop/
 
 I have not tried it yet and I suppose it seems like the long 
 way round - but
 if you are using XML as a format it might be your solution.
 
 Another drawback might be that the XSL specification is not 
 yet stable and
 could change considerably.  I would be interested in what you 
 find out.

FOP is actually a very useful tool and while I haven't worked with
it for a while it is quite robust.  The only main problems I had
with it were:

* On large dataset documents it would grind to a halt.
* If a entity was too large for a single page things would get messed up.

I know from keeping an eye on the fop-dev list that the speed thing
has improved in recent releases and there have been multiple discussions
of the splitting algorithm over the past couple of months, but I haven't
paid real close attention to those.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Dynamically Generate PDF

2001-07-25 Thread Michael Wentzel

 I've tried to do this with jsp (without succes), but with a 
 servlet it can be done quite easy:
   Use tex-dvi-ps-pdf (where tex is a TeX document, (LaTeX))
   (maybe it can be done even easier...)
 If someone knows how i could do this with jsp, (read tex with 
 taglibs) i'm eager to know it)
 

This is a restrictive option.  It's much better to use one of the
many XML/XSL based packages and generate from there.  In this way
you can extend the document definitions as needed which with TeX/LaTeX
is possible but not the preferable solution in my book.

Commercial
--
PageLayout - http://www.sitraka.com

Open Source
---
iText - http://www.lowagie.com/iText/
FOP - http://www.xml.apache.org

Other
-
General Info/Links - http://www.planetpdf.com/mainpage.asp?WebPageID=450

 p.s.  It would be handy to cache the results ;p

That could of course be easily done using a static java.util.Map and a
unique id for each unique doc generated.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Servlets In A Package

2001-07-25 Thread Michael Wentzel

I've recently installed JBoss-2.4.0_Tomcat-3.2.2 and I'm now starting to
experiment with all the JBoss samples. The first, Interest, contains a
servlet that I'm trying to get up and running. This InterestServlet is in a
package org.jboss.docs.interest which I've compiled and placed in 
webapps\demo\WEB-INF\classes\org\jboss\docs\interest 


From your NoClassDef message it doesn't seem like the problem is in your
servlet
being in a package.  It is finding the correct package but it's looking for
the
class Interest instead of InterestServlet.  Although your snipping in your
original post looked fine make sure there are no extra spaces in the class
name for the
web.xml.  Also, can you get any servlet mappings to work for servlets in
packages?
If so I would review your web.xml again very closely and look for
missing/extra tags or characters.


--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com 



RE: File Not Found Error

2001-07-25 Thread Michael Wentzel

 I am not sure how you have defined your servlets.
 
 For a servlet called MyServlet, a URL like the following is 
 recommended:
 http://localhost:8080/examples/servlet/MyServlet
 
 servlet needs to be lowercase.
 
 Gautam
 
 -Original Message-
 From: Jeffrey Worst [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 25, 2001 11:59 AM
 To: [EMAIL PROTECTED]
 Subject: File Not Found Error
 
 I keep getting an HTTP 404 file not found error when I try to 
 run a servlet.
 My servlet class file is at C:\tomcat\Servlet\Ex197.class.  
 Hopefully the
 html code below will show what I'm doing wrong:

One word, documentation.  The Tomcat docs are fairly straight
forward in this regard.  In addition you can look at the examples
that come with Tomcat.  While this is an arena for helping each
other with problems it is(or at least should be) expected that
you have read the docs, played with it some, read the archives,
and repeated the above steps.  It sounds to me like you don't
have your server.xml, web.xml and classfiles setup correctly.

I suggest you start from the bottom and work your way up:
Does tomcat run correctly(root context)?
Do JSP's run correctly?
Then start with a servlet...



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBCRealm... simple question

2001-07-25 Thread Michael Wentzel

 Is it normal that I get a JDBCRealm:The database connection 
 is null or was
 found to be closed. Trying to re-open it.  message
 every time I send a post or a get request???
 
 Everything works fine but I'm worrying about performance 
 degradation since
 the connection seems to be reopen for every call.

The source for JDBCRealm should be in 
TOMCAT_HOME/src/org/apache/tomcat/request/.
You can modify it to your hearts content.  This is definitely
something that could be managed in a pool or something along
those lines.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Authentication with NT4.0 login and password

2001-07-23 Thread Michael Wentzel

 I want to make an authentication process with NT login and password, can
you help 
 me please?

This has been discussed on the group before(see archives).  You will need to
write a Realm and then implement whatever NTLM authentication methods you
need in another language, most likely VC++.  I've started working on writing
one a while back but got side tracked when MFC API References were incorrect
and couldn't get API to work.

FYI - Please follow list guidelines and don't post in HTML.  Some people may
not be able to read HTML/RTF/... formatted mail and, in addition, this will
reduce the number of people who actually respond to your post.



--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com



RE: for jsp

2001-07-22 Thread Michael Wentzel

 can some-one tell me what are all the steps to be taken to host a jsp
 page. for now i have tomcat on NT. for the build ( one using ant ) to
 execute what all details do i have to take care of ? especially the
 web.xml file ...
 what will it contain - as there are no servlet specific details ...

This is a VERY rudamentary question.  Please read the documentation, as
you always should, then if you still don't understand, read the
documentation
again, then if you STILL don't understand search the list archives
thoroughly, then finally you should post a question if you don't understand.

While this list is for tomcat users to help each other learn the nuances of
tomcat it is not here to spoon feed those who wish to simply be given the
answers to their question with no work on their part.

Typically, you can find the answer more quickly on your own anyways.
Especially,
on a weekend.

Note:  The reason I post this to the list is so everyone is aware that
 this is the way a mailing list SHOULD be utilized.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: java error window

2001-07-21 Thread Michael Wentzel

 To cause a servlet to load on starting tomcat, i found the 
 load-on-startup tag has been used in tomcat's default 
 web.xml in the conf directory.what does  the no. 
 supplied(-2147483646) stand for?.i used the same no. for my 
 own servlet and it worked fine.

The value refers to the order of startup. In other words,
the lower the number the sooner a servlet is loaded during the
startup process.  This is particularly important if you make a
request in one servlet to another servlet.  It best to use this,
in practice, with values greater than 0.

 Try this: Can i create a servlet which loads on tomcat 
 startup,and access database in the init method?if yes--my 
 server window showed that the servlet retrieved data from 
 database as expected,but then an illegal operation window 
 appeared  and my server stopped repeatedly.
 if this is due memory shortage is it due my 
 Database,jvm,tomcat being on the same machine(Win98,oracle 
 personal ed.,tomcat3.2.1,jdk1.2.2). on suggested by 
 Andrew([EMAIL PROTECTED]) i played with the memory 
 settings in dos properties frame,but to no 
 avail.(Incidentally can i use multiple jvms.)
 this same window appears when i use a jsp page accessing 
 database.but it disappears if i use only servlets accessing database.
 the msgbox showed the following:

What JDBC driver are you using?



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Ordering of parameters in HTTPRequest Object

2001-07-16 Thread Michael Wentzel

 Hello all, I am new to this mailing list, and Tomcat, so please pe 
 patient...
 
 I am using Servlets to recieve html form submissions.
 
 Problem is that the form fields are in a particular order on 
 the form, but 
 when I get the Parameters from the request object this field order is 
 gone...
 
 The post data comes in in the proper order, but I can not recover the 
 ordering.  If it was only 1 form I was dealing with, I could 
 write code to 
 format a response, but the app is very generalized, and it is 
 designed to 
 handle many different forms.
 
 So the question.   Is there no way in tomcat to preserve the 
 ordering of 
 parameters from a form submission?

No.  This is servlet API thing, not a tomcat thing.  I think it's a bad
idea to develop servlet to depend on the order in which a request object
is formed because you never know for sure that an ordering is going to
be fixed.  For example, say a hashing algorithm is used for speed up
access.  How do you order the elements of a hash table?  The only thing
I could suggest is preface every form element with its' order, 1st element
would be 0_elementname and 9th element would be 8_elementname, then order
the elements yourself, but I think this is kind of sloppy.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Tomcat JSPs with custom tags SLOW

2001-07-16 Thread Michael Wentzel

 I recently started to replace the use of scriptlets with 
 custom tags in my JSPs.  Web-to-Go is much faster
 than Tomcat for the JSPs containing custom tags.  My app 
 still has many JSPs that do not contain custom tags and 
 Tomcat is still as fast or faster than Web-to-Go for those 
 scriptlet pages.

I would suggest putting some timing tracking code into your
tag code as well as the jsp's themselves to try to figure out
where exactly the time is being consumed.

In addition, you could try messing around with one of the
existing tomcat tag libs and see if they give you the same
problem.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Report generation

2001-07-16 Thread Michael Wentzel

 I have a report which is written as jsp file, and processed at runtime.
The jsp 
 generates a report about objects in memory, using their attributes (The
object is a  JavaBean). The problem now is that I want to save the reports
for future use, even  when the object has been removed from the memory. Is
there any way to save the 
 output of jsp processing to a file?

I can think of several ways to approach this.  You could create serialized
strings
for the object and create a repository for these.  This would reduce the
size of the repository over reproducing the entire report in the repository
but it means that whenever the report is requested again it would have to be
regenerated.

You could also have all your output go to a StringBuffer then .toString()
the StringBuffer at the end of the jsp as well as outputting to some sort of
repository.

Either of these techniques could be encapsulated into a bean or tag.  Just a
couple of ideas.



--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com 



RE: JDBC Realm on Tomcat 3.2.2

2001-07-15 Thread Michael Wentzel

 After adding the RequestInterceptor
 className=org.apache.tomcat.request.JDBCRealm.. in 
 server.xml, what's
 needed to be in web.xml file.

You need to add your roles for the app and configure your login
method. i.e.

security-constraint
  web-resource-collection
 web-resource-nameProtected Area/web-resource-name
 url-pattern/security/*/url-pattern
  /web-resource-collection
  auth-constraint
 role-nameadmin/role-name
  /auth-constraint
/security-constraint

!-- BASIC/BROWSER BASED --
!--
login-config
  auth-methodBASIC/auth-method
  realm-nameWhatever Here/realm-name
/login-config
 --

login-config
  auth-methodFORM/auth-method
  realm-nameWhatever Here/realm-name
  form-login-config
form-login-page/login.jsp/form-login-page
form-error-page/error.jsp/form-error-page
  /form-login-config
/login-config

You can have as many resources as you wish and multiple roles.
This all is quite well documented in the documentation and if you
look at example files included with tomcat.  Please refer to these
files for information if you have questions.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Setting up SSL for secure credit card transactions

2001-07-15 Thread Michael Wentzel

 I'm trying to set up a SSL for a specific area of my site for credit card 
 transactions.  How do I do this?


By searching the archives!

Hate to sound like a broken record but it's true!

--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com 



RE: . Reloading JSP's

2001-07-11 Thread Michael Wentzel

 I am using tomcat 4.0 beta 5 on win NT and the problem is that when i
 make a change to a jsp page tomcat doesnt pick it up, i have tried to
 refresh the browser, shut down the start up again and nothing happens.
 The only thing i can do is resave the JSP as another name, which is
 really annoying. Any ideas on the situation??

Is your context set to be reloadable?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: . Reloading JSP's

2001-07-11 Thread Michael Wentzel

 Try response.setHeader(pragma,no-cache) and
 response.setHeader(cache-control,no-store) at the top of 
 your .jsps,
 that will/should prevent browsers and proxies from caching. 

This would not be a preferred production solution to the problem
unless it is absolutely necessary since this is going to remove
caching of static objects, such as images, and would reduce
performance on the client-side, but it is a option for debugging
purposes.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: (application library) ClassNotFoundException

2001-07-09 Thread Michael Wentzel

 The only change I made for 9i was to change the driverName from
 oracle.jdbc.driver.OracleDriver to oracle.jdbc.OracleDriver 
 as recommended
 by Oracle.  In my application lib directory I made a link to 
 the classes12.zip
 (and .jar file) and rebuilt.  I've confirmed that the 
 classes12.{jar,zip}
 files are in
 /usr/local/jakarta/jakarta-tomcat-4.0-b5/src/build/webapps/opf
 /WEB-INF/lib/

Herein lies your problem.  The classes12.jar(it has to be a jar not
a zip), has to be in TOMCAT_HOME/lib, not your webapps lib folder.

Think of it this way.  Where do you configure the JDBCRealm?  In
TOMCAT_HOME/conf/server.xml.  The server.xml file is parsed at startup
and therefore the Realm is created before the context(s) have been
loaded.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: (application library) ClassNotFoundException

2001-07-09 Thread Michael Wentzel

 So, this leads me to a follow up question.  I know that I've 
 got the jar
 file in the server/lib directory, is there any way to use that from my
 application.  If not then I have to have the exact same jar file in my
 WEB-INF/lib directory to use Oracle JDBC in my application.

You could always alter you startup script to so that the TOMCAT CLASSPATH
contains the fully qualified oracle jar.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: (application library) ClassNotFoundException

2001-07-09 Thread Michael Wentzel

 You could always alter you startup script to so that the TOMCAT
 CLASSPATH
 contains the fully qualified oracle jar.
 
 Ok that works, but is that the right thing to do?
 K.

No, not really, but if you don't want to have multiple file copies
(which shouldn't be that much of a problem really) this is the only
way to do it, unless you want to rewrite some of tomcats class 
loading/classpath setting mechanism(s).


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realm error on startup

2001-07-09 Thread Michael Wentzel

 Using the JDBC-ODBC Bridge can not lead to jar problems as is included
 on the default bootstrap classpath.., perhaps a incorrectly created
 ODBC?

My point was not that the bridge would cause this problem but that it
causes problems in general.  Why add another layer to your code when
it is unnecessary.  The only reason I really see for Access is DB
portability to other machine, and for most individuals this is not an
issue.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Hi vinay........ (Subj: jar files)

2001-07-08 Thread Michael Wentzel

 Thanks a lot for u r helpful response ...I installed Tomcat 3.2 and
jdk1.2.2 ...
 U told me copy classes12.zip in TOMCAT_HOME/lib/apps but  apps directory
is not in  lib  .So can i copy that zip file directly in TOMCAT_HOME/lib
directory? and one 
 more thing for classpath writing there are two files workers.properties
and 
 wrappers.properties are there with classpath parameter  in
TOMCAT_HOME/conf dir..So  which file i have to edit.can u send me the
classspath string for oracle 
 connectivity ...and where to write that one...
 I will wait for u r response

It doesn't matter where you put the zip file it won't be picked up
automatically.  What you are going to have to do is rename the .zip file to
a .jar file(all a jar file is a zip file of classes/manifest(s)), and put it
in TOMCAT_HOME/lib.

BTW, a couple pointers:
1. This topic has been covered in the list before.  If you search one of the
archivesfor this list you can find your solution immediately as
apposed to waiting for  someone to respond and you also reduce the lists
traffic.
Documentation - List Archive - List.
2. It is a list guideline(which you should have read before subscribing)
thatpostings to the list should be plain text(no html).


--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com 



RE: need help about tomcat4

2001-07-08 Thread Michael Wentzel

 i 've unzipped tomcat4 on my system and created classes 
 forlder in its root dircetory for having servlet classes.i 
 put all servlet classes in that folder.when i access servlet 
 it give status code 404(i.e resource /servlet/classname) not 
 found.what is the problem with it.

Classes go into either TOMCAT_HOME/classes (for tomcat system
classes) and TOMCAT_HOME/webapps/{myapp}/WEB-INF/classes/ (for
application classes).  Therefore you servlet classes should
be in webapps/{myapp}/WEB-INF/classes/ where {myapp} is replaced
with the correct webapp for the particular context you are
working with.

I think, maybe, it's time to go back and read the docs... ;)


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: BUG - valueUnbound e session timeout

2001-07-08 Thread Michael Wentzel

 There is a bug in Tomcat 3.2.2.
 
 The session is not timing out and valueUnbound is not being 
 called, even 
 with setMaxInactiveInterval(10).
 
 This bug only happens in windows 2000.
 
 Pretty annoying stuff...

I run windoze2000 and tomcat 3.2.2 and do not have this problem.
I've never checked, explicitly, if valueUnbound is getting called
but the session timeout event does occur so I just take the specs
word for it that valueUnbound get called(since I don't do anything
special with SessionEvents).

Are you sure this is what is happening?  What, exactly, is the
action you take and the behavior that leads you to believe this is
what is happening?  What JDK( Sun/IBM/1.? ) are you using?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Help on application scope

2001-07-07 Thread Michael Wentzel

   I tried to do a Singleton Instance of a class containing a 
 Hashmap of
 entried mapping IPs to session objects to be used later for session
 invalidation. I instantiate the singleton instance with a 
 generic servlet,
 but I dont think it worked when I started the server because 
 I didnt see my
 println message when I started the server, and I can when I 
 call the servlet
 explicitly. How do I know if I correctly setup the servlet to 
 startup when
 the server starts?

If you don't already you can put debug output into your Servlet's
init() method.  The method gets called whenever an instance of a
Servlet is created.

 Also, having a singleton instance, do I still need to import 
 the class in
 the jsp page I use it in? Should it find it anyways if I dont?

Yes, even though you have an instance classes(jsp's are classes in
the end) have to know where to look for the definition of other classes.
Therefore you can either
a) import the class
b) refer to the fully qualified class name(including package) everytime
   you refer to the class.

 Also, when I do put it in the import, for some reason the 
 singleton instance
 is intantiated twice in different JSP pages, thus furthering 
 my belief that
 this class was created possibly in the first JSP page and 
 discarded, then
 recreated in the second JSP page. Somebody help, This is 
 getting ridiculous
 I originally tried this with application scope but it couldnt find the
 instance in another jsp page though it was in the same application.

The second instance is more than likely because of your servlet mapping.
One instance is created for every mapping in you webapp plus one for the 
default /servlet/ServletName mapping.  You don't really need any mappings
because you don't really need an HttpServlet if I understand you application
appropriately.

My idea went more along these lines
code
public class MyServlet extends javax.servlet.GenericServlet {
public void init(ServletConfig config) throws ServletException {
this.config = config;
log(init);
this.init();
}

public void init() throws ServletException {
  MyClass.initialize();
}
}

public class MyClass {
public static java.util.Map myMap = null;
public static void initialize() {
  if (myMap == null) { myMap = new HashMap(); }
  /* any other init goes here */
}

/* static accessor/modifier methods go here */
}
/code

Then your jsp's would import MyClass and reference the static accessor/
modifier methods as necessary.  The static map will ensure that there is
only one instance of the session mapping per JVM(note that this is
significant since you can ONLY be assured that there is one instance of
the map for each JVM, hence the importance of only having one servlet
mapping for your servlet.)

I don't know exactly what you're trying to accomplish in your app but if
you are trying to manager HttpSession invalidation you might want to 
check out javax.servlet.http.HttpSessionBindingListener and the valueUnbound
method in this class.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: creating a instance of a servlet: takes too long!!

2001-07-06 Thread Michael Wentzel

 why is that my servlet when the first time is invoked, it 
 takes about 30
 seconds or more to start when the servlets that came in tomcat are
 instantaneous? After the servlet container instantiated and 
 initialized my
 servlet, all the following requests are very fast. Is there 
 any advice for
 what we should do and don't do in init() method? 

Well, one option for a solution is set your servlet to load on startup
and have all your initialization done at startup so that these
elements are already initialized before the first request even comes.

 How can I benchmark the time of instantiation of my servlet 
 and the time of
 my init method?

I would just put in some logging code and find out where exactly
the time is being taken up in your servlet(if indeed this is where
it is actually munching clock cycles).

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realm Questions Tomcat 3.2.2

2001-07-06 Thread Michael Wentzel

 Now, when somebody wants to access myServlet resource, he/she 
 must have the role
 of an Administrator or Operator. I think this should be 
 checked into the
 database.  The problem is that, when I've tried to access 
 myServlet for the
 first time, the following message was generated in the tomcat console:
 
 2001-07-05 04:11:49 - ContextManager: JDBCRealm: 
 JDBCRealm.authenticate: SELECT
 PASSWORD FROM MYUSERTABLE WHERE NAME = ?
 2001-07-05 04:11:50 - ContextManager: JDBCRealm: 
 Authentication unsuccessful for
 user null
 
 In the same time, the login window has appeard on Netscape 
 browser, but after
 I'd entered a valid user name and password (from myUserTable) 
 the message was
 the same:
 
 2001-07-05 04:14:19 - ContextManager: JDBCRealm: 
 Authentication unsuccessful for
 user null
 
 It seems for me that the user name is null every time, no 
 matter if I enter a
 valid (user, passwd) or not. Is that a Tomcat bug, or I've 
 missed something?

Check your database schema and make sure it is correct.  If it is
all I can suggest is add some debugging code to JDBCRealm, recompile
and throw it in TOMCAT_HOME/classes/, then restart and see what
the actual value of username is when authenticate(String, String) 
is called.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Help on application scope

2001-07-06 Thread Michael Wentzel

 Dear all,
 I used a java.util.HashMap for session invalidation in my 
 JSPs. It is
 declared as such in 2 jsps:
 
jsp:useBean id=monitor class=java.util.HashMap
 scope=application /
 
  
 (GalleryViewBottom.jsp
 and Logout.jsp)
 
 Now the funny thing is when I issue a
  monitor.put(request.getRemoteAddr(), session);
 
 (GalleryViewBottom.jsp)
 
 And then try to access it from Logout.jsp the monitor has 
 no such key
 value. Isn't application scope mean its accessable from ANY 
 jsp page? I got
 the ideas for this code from Professional JSP (WROX, pg133 
 checklogin.jsp).

Another way to do this, and better in my opinion, would be to
write a GenericServlet which has a static HashMap member which
gets initialized in init() method and has a static get and
put method.  Configure the servlet as a load-on-startup servlet
and you're ready to go.  Just import the class and do

ClassWhatever.get|put(...);

This will remove lines of code from the servlet generated from your
jsp(autogenerated by the useBean tag).

You could also include remove() and clear() methods.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realm error on startup

2001-07-06 Thread Michael Wentzel

 I am getting the following error on startup of Tomcat:
 
 2001-07-06 02:49:01 - ContextManager: JDBCRealm: Starting 
 JDBCRealm, trying
 to acquire JDBC Driver class and DB Connection

You need your libraries in TOMCAT_HOME/lib to be able to make
the connection.  Although JDBCRealm has been mentioned to work
like magic in that it does all the work for you, you still have
to have some library for communicating with the appropriate DB.

 java.util.MissingResourceException: Can't find resource for bundle
 java.util.PropertyResourceBundle, key 
 jdbcRealm.checkConnectionSQLException

These are from the LocalString.properties files.  If you open
webserver.jar you will find several properties files.  The one in
org.apache.tomcat.request is the one this property should be in(the
package which contains JDBCRealm).

My copy does not have a key for jdbcRealm.checkConnectionSQLException.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: JDBC Realm Questions Tomcat 3.2.2

2001-07-06 Thread Michael Wentzel

 Tomcat's JDBC Realm won't work with an empty database 
 password.  I posted
 about this a week ago and asked if it was a bug and noone responded.
 
 If you proved the JDBCRealm a valid username with a blank 
 (empty string)
 password, Tomcat will ignore BOTH Username and password.

Guess I must have glazed over your previous post.

I would view this less as a bug and more as a feature.  You should
never really allow users to have an empty password.  It kind of
defeats the point of having security.  If you are trying to have
a demo/anon user then just do similar to how this is handled in
a ftp server... username=anonymous [EMAIL PROTECTED]

JMHO.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Request redirect

2001-07-04 Thread Michael Wentzel

 I've been trying to find the answer to my question in mail 
 archieve, but
 failed, so, hope, someone could help me. The question is how 
 to make Tomcat
 redirect some requests to another program, lets say an HTTP 
 daemon, running
 on a separate (or the same) workstation (it would be a Java 
 application
 listening for HTTP connections). Tomcat might redirect HTTP 
 request based on
 practically anything - it's not very important for me - some 
 field in HTTP
 header, URL parameter value or just some particular URL. As 
 far as I know
 Apache server can do redirection of HTTP request to another 
 services based
 on URL string (that's what I saw in docs for Tomcat 4.0). And 
 as far as I
 remember Microsoft IIS can do that as well. So, what about 
 Tomcat? I guess
 server.xml file should be modified (Connector section?), 
 but nothing about
 such capability is written in the docs.

Do some research into RequestInterceptors.  They can be very handy.
You could also write a servlet for this but that would be using
a sledge hammer to swat a fly(so to speak).


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Opening up JSP from another window

2001-07-02 Thread Michael Wentzel

 I have one JSP application and I wish to open up another 
 window in JSP.  I was told to specify target=_window in the 
 url to pop up the JSP.  Where do I put this?  If my jsp is 
 test.jsp, to I say.
 http://localhost:8080/test.jsp target=_window
 Can someone suggest the proper format for the URL?

If you are using an href for the link then use
A HREF=test.jsp TARGET=_window/A

BTW, you can put anything you want in TARGET as long as it is
not a current frame or one of the default definitions( blank,
top, ...).


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Does Apache worth it?

2001-07-01 Thread Michael Wentzel

 I am very interested in this issue as well. What if all the 
 pages of the
 website are generated through servlets and JSP's (except for 
 the token few
 images/gifs) ? In cases of no static content, would Apache 
 still make any
 difference ?

No. Since what will essentially happen is a brokerage
call to Tomcat and the response gets redirected through
Apache.  That's the main point(IMHO) of implementing Tomcat 
with its' own webserver.  So, in the case in which you have 
nothing but servlet/jsp content you do not need an extra step.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Prefix subject headers in Tomcat list?

2001-07-01 Thread Michael Wentzel

 Is it possible for the list admin to apply a '[tomcat-user] ' 
 or similar 
 prefix to all mails sent from the mailing list?
 
 This helps a lot in separating list traffic from other traffic.

The to: addr is [EMAIL PROTECTED] you should be
able to filter on that perfectly fine.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: trapping session invalidation

2001-06-29 Thread Michael Wentzel

 I want a certain functionality to be invoked when the session 
 invalidates. 
 How do I know that the session is getting invalidated? Any 
 help on this 
 will be greatly appreciated.

check out HttpSessionBindingListener.valueBound/valueUnbound
FYI - in the future please try to search list archives before
asking questions on the list.  If everyone would do this it would
drastically reduce the number of posts to this list.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Using the servlet element on web.xml to define short name for a servlet in a package

2001-06-29 Thread Michael Wentzel

 I put a package called FTPExplorer.jar under 
 /admin/web-inf/lib containing
 the servlet named
 com.company.ftpexplorer.FTPExplorerServlet.class
 
 When calling the servlet with following URL:
 http://localhost:8080/admin/servlet/com.company.ftpexplorer.FT
 PExplorerServl
 et
 the servlet works ok.
 
 I've defined the following servlet element on the main 
 tomcat web.xml
 
   servlet
   servlet-name
 controller
 /servlet-name
   servlet-class
 com.company.ftpexplorer.FTPExplorerServlet
 /servlet-class
   /servlet
 
 When trying to call the servlet with either URLs:
 http://localhost:8080/controller
 http://localhost:8080/admin/servlet/controller
 
 Tomcat can't find the servlet ( 404 )
 
 What is wrong ?

Creating a servlet name does not create the corresponding
servlet mapping, such as:

servlet-mapping
servlet-name
controller
/servlet-name
url-pattern
/controller
/url-pattern
/servlet-mapping

then use http://localhost:8080/controller (if you're in the root
context that is).

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



Interesting tips on JDC re: Servlet Filters

2001-06-27 Thread Michael Wentzel

For those not on the JDC Tips list there is a interesting
issue that was just sent out last night regarding

 * Improving Code Reuse With Servlet Filters
 * Using Filters To Modify The Server's Response

The first one is an intro and the second tip is a interesting
little extension that some users might find interesting.

Those interested can check it out at http://developer.java.sun.com/



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Managing non http requests

2001-06-27 Thread Michael Wentzel

 I'm checking the feasibility of building a 'message server' based on
 Tomcat that will receive messages (xml or other format) from clients,
 route them to a backend system and send the response.
 
 1. There maybe situations that the application response to the http
 request should be sent to a different url or maybe even using non http
 protocol (asynchronous mode). How should I handle this case 
 so that the
 client will receive an immediate response and disconnect while the
 thread continues to process the request?
 2. I will also accept request from MQ and other non http channels. Is
 there a way to enjoy Tomact services like thread pooling for those
 requests? Should I package them in http and resend to the web server?


If I am following you correctly a RequestInterceptor could be used for this.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: IIS tomcat and transparent logins

2001-06-27 Thread Michael Wentzel

 When I was using IIS/NT for my authentication users could 
 login into the
 server using a link that looked something like this
 http://username:[EMAIL PROTECTED]/sdfsdf/
 http://username:[EMAIL PROTECTED]/sdfsdf/ 
  
 Is there anyway to do this in tomcat.  Really what I am trying to
 accomplish, is move a user from one of my company's web site 
 to another site
 ( they are on two different systems) without having to have a 
 double login.
 I searched through the archives but wasn't able to find 
 anything on this
 topic.  Any suggestions are appreciated?

NTLM Auth is one way to do this(without passing the auth credentials
in the plain text url).  I've been working on writing up a NTLMRealm
for a while but am having a rough time with getting the MFC stuff
to cooperate.  If anyone's had better luck with this let me know.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: TOMCAT SUCKS

2001-06-27 Thread Michael Wentzel

 5. And what if you have a problem that is not in the 
 documentation (99% of 
 the problem with Tomcat are not even mentioned in the 
 documentation)? I guess 
 the only way is to post in the mailing list. And guess what 
 happens if nobody 
 has experienced this problem before? You have to start 
 wasting your time 
 again.

Hello!!! Ever heard of the archives?!?!  Just about any question
you could imagine are out there.  Sometimes you have to work for
your money not just get it handed to you on a silver platter.

 I really think that TOMCAT is OK for testing purposes. Trust 
 me - for complex 
 configurations it sucks. 
 If you want to use a good production application server - 
 take a look at 
 WebLogic, Resin, Allaire JRun, etc.

Weblogic... slower than molasses unless configured just right
and REALLY overkill (especially financially) unless
you have a complex ORB model.
Resin.. Haven't worked with it can't say much.
JRun... Costs money and have to say it quite suspicious that
so many developers are moving from it to tomcat?!?!

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Info Required : Very urgent please !

2001-06-25 Thread Michael Wentzel

 We have just finished the development of a business critical 
 application to
 run on JSP/tomcat and SuSe Linux and are implementing it. 

??? You finished development but NOW your implementing it???
Sounds confusing to me.  Do you mean your deploying it?

 We need confirmation whether we can release a commercial application 
 on 'tomcat' and if we need any support, does any company offer 
 support at cost.

As far as whether you can release a commercial app with tomcat.
Take a look at the license.  Hint: It's the standard Apache license
if that gives you any ideas.

For support, I believe that this user group, along with several sites
around the web( do a google search ) for tomcat provide enough support
for just about any possible problem out there.  Take a look at the
list archive.  Pretty much every question that could be asked has
been asked; 99.9...% of which have been answered promptly by
other users.  Free support, who can beat that!


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: TOMCAT3.2.1 + apache + jetspeed 1.3 on NT

2001-06-25 Thread Michael Wentzel

 if anyone has used the above configuration , kindly help with the
following
 as soon as i get the default jetspeed login page and try to create new
user  , i am  taken to the next screen allright but the intended mail
containing the secret key 
 never reaches me.the tomcat console shhows the error as...
  - ctx (  / jetspeed + /css/default.css + null)  connection aborted by
peer : 
 socket write arror

I don't know about using jetspeed(haven't worked with it) but your socket
write error is due to the client(webbrowser) closing the connection for the
default.css file because it realized it already has it in local cache.

FYI - Please refrain from sending HTML messages to the list.  Some people
are unable to read these message and you will get responses to questions
much more quickly if everyone can read your message.  Plus the fact that
this is a usage guideline that is stated in the webpage before you subscribe
to the list.  Please, no cutesie backgrounds here!  Save the fluff for the
M$ lists;)


--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com 



RE: application error

2001-06-22 Thread Michael Wentzel

 Iam getting application error java.exe error while i fetch data from mssql

 server/mysql server thru dsn.when i enter ok/cancel the tomcat server
shutdown. 
 again i have to restart it. pls help me how to  get rid of this.

First off, go to the ODBC control panel and make sure you can connect to the
ODBC source through the control panel(using the test function at end of
configurator).
If this works explain in more detail, including source if possible, how you
make your connection in java.


--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com



RE: User IP Address

2001-06-22 Thread Michael Wentzel

 Brilliant! works perfectly.  Now to write the logging program...

You might want to check out Randy's request logging interceptor
see attachment...

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



attch:

Since a number of people have asked for it over the past and I had a
little extra time, I wrote a RequestInterceptor that logs requests.

Its still a little rough and have room for some performance
improvements, but I believe that it is functional.  You can view the
documentation and download it from:

http://www.aswethink.com/employees/randy/tomcat/requestLogger.html

If you have any feedback, please send it directly to me so that we
don't clutter up the list.



RE: session timeout handling

2001-06-22 Thread Michael Wentzel

 When a Tomcat session times out does it send you to a preset 
 error page?

No. not unless you throw an exception due to dependence on something
from session.  You could develop an entire webapp without ever using
the session and despite the fact you never use it it will still be
instantiated.  For obvious reasons.

 What is the mechanism there?

No mechanism!

 What is the best way to handle timed out users? 

Depends.  Do you have a security concern(if so you should be implementing
Realms of some sort which manage the session timeout for you)?  Are you
requiring something to exist in the session for certain portions of your
app? ...  It all depends on what you specs and app requirements state.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: session timeout handling

2001-06-22 Thread Michael Wentzel

 We carry a userid and a shopping cart in the session thu out the app.
 If the user goes to lunch and comes back, we would like to 
 give them sort of
 friendly error if their session times out.

Allowing the garbage collector(unless you are REALLY nitpicky about
knowing that errant Objects are being gc immediately) to manage the
cleaning up of these session objects is probably a best practice in
most cases.  This is why I would suggest a Realm for most cases instead
of a implementation of HttpSessionBindingListener(no reason to reinvent
the wheel/pull out the sledge hammer to swat a fly) but the idea that you
want a friendly error on timeout makes me want to say that a
Listener is probably your best bet.  If you are new to the
Model-View-Control
theory Listeners can be kind of daunting to begin with but I would suggest
picking up a good java book if this is the case.  The problem with 
implementing with Realms in you case is, if you were to use FORM AUTH TYPE,
how to determine whether a user is making their initial login or are in the
timeout scenario.  The idea in the post below regarding the refresh meta tag
is also a possible solution and you could make it even more ingenious and
do something with javascript possibly with timers and configure a timer
for some time n  timeout time that would do something like pop up a warning
stating You will be automatically timed out in x minutes  Since this
is
client side it will not cause a request to the server to reset the timeout.

www.bankofamerica.com does something similar to this for their online
banking
I believe.

Just a couple of possibilities.

---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Exception message

2001-06-18 Thread Michael Wentzel

   I'm new user of tomcat web server. I'm able to setup the 
 web server and view the default Tomcat home page but 
 sometimes I got an exception message displayed on my dos 
 screen when I try to run the my test program. Is my program 
 caused this exception or the setup ?
 
 Thanks
 
 Here is the exception message:  
 
 2001-06-18 11:50:34 - Ctx( /mytest ): IOException in: 
 R( /mytest + /test.html + null) Connection aborted by peer: 
 socket write error  


This is not really an exception.  What is happening is the
browser realizes that it already has a cached copy of the doc
and closes the connection with the server before transfer has
been completed.  The server has no way of knowing the difference
between a erroneous socket close and a pre-empted socket close
such as this one.  Therefore it assumes an error since it can't
write to a socket which was previously open.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Getting file information

2001-06-18 Thread Michael Wentzel

 Greetings to all, newbie here.
 Would like to ask if anyone knows how to get the file 
 information such as the file name(not the entire path)
 of the running JSP file?
 
 Let's say i were to run confirmation.jsp, how do i get the 
 filename to a string when confirmation.jsp is running?
 I tried getRealpath and it returns the entire directory with 
 the filename.Could i just get the filename instead?

Why not just do a substring on getRealPath() based on the
lastIndexOf(FILE_SEPARATOR)?  Parsing this String is not
very complicated.  You can even write it in such a way that
code will not have to be changed if it is moved to a OS with a
different file separator( using java.io.File.separator ).


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: Can't happen - classname is null, who added this

2001-06-16 Thread Michael Wentzel

 This message is generated by Tomcat ServletWrapper program.
 It is trying to load the servlet, but finds that it's class (note: Class
not same
 as Object) is NULL.  
 I sincerely doubt that there is a bug in their program - I would start
looking
 at your CLASSPATH and other ENV variables.  
 Seems to be a common program . 

This does not have to do with classpath OR env vars.  It is actually a flaw
in class
loading.  Every time a class is recompiled it generates a new id based on
the class
definitions and therefore when tomcat tries to instantiate a instance of a
class
and the serialid has changed since the classdef was loaded the classloadeer
believes
that it can't find the classdef and throws this message.

Once again I am going to mention that people need to stop posting to the
list in
HTML.  If you go back and read the webpage where you signed up for the list
one of the
guidelines is no meta formats(ie HTML).  Some people who use mailviewers
such as pine,
elm, mail( don't laugh I do actually know individuals who have used mail to
read/send
mail ), cannot read or will have a difficult time reading HTML messages.

I realize no matter how many times I rant about this there will still be
people who
post in HTML but my objective is to reduce the number of these individuals
and while
I CAN read HTML messages I don't see the need for that kind of excessive
junk here and
understand the viewpoint of those who aren't able to read these messages.



--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com



RE: tomcat work with mozilla but not with IE

2001-06-15 Thread Michael Wentzel

I had installed Tomcat as a stand-alone servlet container!
I can start tomcat with the startup- script!
When I try to access http://localhost:8080/index.html
the Internet Explorer can't locate the site!
With the mozilla- Browser all looks pretty fine!!!

===

If your machine has a network IP address you may try using that( i.e.
http://10.0.0.5:8080/ ) or otherwise try the loopback device
http://127.0.0.1:8080 to verify it is a IE network config issue.



--- 
Michael Wentzel 
Software Developer 
Software As We Think - http://www.aswethink.com



RE: tomcat security, JDBCRealm, SimpleRealm readable passwords

2001-06-15 Thread Michael Wentzel

 Hi,
 I've set up tomcat 3.3 and almost everything works fine. 
 I've set up a mySQL database 'authority' to authenticate against
 in a simple test webapplication. And now I have the following question
 and maybe someone can help me.
 I don't like having passwords on my filesystem readable to people
 who have fileaccess. If I'm using SimpleRealm I have users/passwords
 in clear text in a file and thats not secure. If I use
 JDBCRealm I can store encrypted passwords in the table, but I don't
 know how tomcat can read them. So in the table I have to use
 passwords that are not encrypted.
  On the other hand if I let tomcat
 connect to the database as user 'tomcat' for example with some
 password anyone who will find out about the password will
 be able to connect to the database and read all the authentication
 information without a problem. 
 So my question is:
 Is there anyway to use password encryption in tomcats
 authentication mechanism?
 I'd greatly appreciate any help,

None of these methods really support credential encryption in their current
state.  But as you may well know;) Tomcat is open source, therefore if you
take a look at org.apache.tomcat.request.JDBCRealm.java in the src tree
and the method authenticate(String, String) you will see where users are
authenticated.  You could modify this class in any manner you see fit to
authenticate against encrypted passwords in the database table.  I was
actually planning on doing this myself for our use but haven't gotten to it
just yet.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com



RE: executing the servlet

2001-06-15 Thread Michael Wentzel

 if you wanna run servlet on context examples all the
 servlet will run by default at servlets and if you
 have a servlet named HelloWorldExample the url
 should be
 
 http://localhost/examples/servlets/TestServlet
 
 
 --- [EMAIL PROTECTED] wrote:
  What do I put in the url to execute a servlet on a
  localhost machine. I am 
  using jakarta as standalone.
  Is it:  http://localhost/servletpage ?please
 help

JMHO, but it seems blatently obvious that no personal research was done to
find an answer to this question before posting to the maillist.  I will say
what I, and many others here, have said many, many times before... The order
in which you should find solutions to problems is as follows(and this
applies to anything, not just tomcat):

1. View documentation(local and online)
2. Search through list archives
3. If you still can't find a solution then and only then   
   should you post to the list.

I understand that starting out can be daunting but if you don't learn to
pick this kind of stuff up yourself you will always be 'relying on the
kindness of strangers'.

Typically, you can find an answer for yourself much more quickly than
waiting around for someone else to answer you anyways.

This stuff, plus creating alternative mappings to servlets, is VERY well
documented IMHO.

OK, I've finished ranting on this matter.



---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com
Undergraduate Student
Georgia Institute of Technology, CoC
mailto:[EMAIL PROTECTED]



  1   2   3   >