Re: JNDI Datasource question

2002-12-02 Thread Ron Smits
Jake,

thanks, this is a great answer and answers my question exactly. :)
Especially the META-INF/context.xml. was somthing that I must have
overlooked 

Ron

On Mon, 2002-12-02 at 11:09, Jacob Kjome wrote:
 
 Hi Ron,
 
 That is referring to a context configuration file.  You *always* need to 
 set up your DataSources through the proprietary server configuration.  The 
 stuff in the web.xml only defines the interface.  For instance, if you set 
 up DBCP specific stuff in the web.xml file, your app would be dependent on 
 running under Tomcat and be incompatible with every other app server.  JNDI 
 is meant to provide a standard interface while allowing the vendor to 
 provide a proprietary implementation.  That way, you get to code to a 
 standard and you get to pick the vendor who provides the best 
 implementation (by your own definition).  That provides for both standards 
 *and* market competition.  Neat, eh?
 
 See the following for context configuration files:
 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automatic%20Application%20Deployment
 
 Also, look at admin.xml and manager.xml in CATALINA_HOME/webapps for reference.
 
 I addition, Craig R. McClanahan pointed out the following when deploying 
 via the manager app:
 
 quote
 For the deploy command, simply include your context confgiuration file in
 the WAR at META-INF/context.xml.
 
 In Tomcat 4.1, you can dynamically deploy a context configuration file
 instead of, or along with your webapp.  Such a file can contain the
 Context element, and all nested subelements, from what you would
 normally put in server.xml, so you can indeed dynamically deploy an app
 with a custom realm.
 /quote
 
 Jake



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




JNDI Datasource question

2002-12-01 Thread Ron Smits
Evening

A question to grow my knowledge:)

On tomcat 4.1.12-LE-jdk14 deployment with java jsdk 1.4.1_01-b01 I have
installed the two missing jar files from commons (dbcp and pool) and
made the example from the documentation (/DBTest) work. Great work, well
written and very clear.

So my question. If I want to use DataSources I always need to change or
add Contect (or defaultContext) in the conf/server.xml? According to the
documentation I can define a Resource as:
Context ...
  ...
  Resource name=jdbc/EmployeeDB auth=Container
type=javax.sql.DataSource
 description=Employees Database for HR Applications/
  ...
/Context

in server.xml or as 
resource-ref
  descriptionEmployees Database for HR Applications/description
  res-ref-namejdbc/EmployeeDB/res-ref-name
  res-ref-typejavax.sql.DataSource/res-ref-type
  res-authContainer/res-auth
/resource-ref

int web.xml of an application that is deployed. But where to I put all
the values named in the ResourceParams entries if I want to declare them
from the web.xml file?

Ron




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: package declaration / import - new improved!

2002-11-28 Thread Ron Smits
Your bean needs a constructor without arguments like:
public class Abean {
  public Abean () {
   // does nothing
  }
}

this way the bean can be instanciated.

Ron

On Thu, 2002-11-28 at 10:37, [EMAIL PROTECTED] wrote:
 Hi,
 Similar to a recent posting, after some research into the subject, 
 regarding importing a package into my JSP, I understand thus:
 
 If I have Abean.java and of course Abean.class belonging to package mybean 
 (source below),  in webapps/mydir/WEB-INF/mybean/mybean.class, and my JSP 
 in webapps/mydir/index.jsp that includes the bean: 
 
 %@ page language=java %
 
 %@ page import=mybean.* %
 
 html
 headtitle/title/head
 bodyTEST/body
 /html
 
 I get the error package mybean does not exist
 import mybean.*;
 
 The bean source (only for the technically minded now):
 
 package mybean;
 
 public class Abean {
 
 public int aMethod() {
 int i = 10;
 return i;
 }
 }  
 
 What am I doing wrong here please? Please someone help!
 
 thanks
 
 Paul.
 
 
 
  



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: How to add a servlet to a new Webapp

2002-11-28 Thread Ron Smits
If I understand everything correctly :)  the invoker servlet is by
default disabled. I had to add the following to my web.xml to be able to
access servlets that are not defined in the web.xml:

servlet-mapping
servlet-nameinvoker/servlet-name
url-pattern/servlet/*/url-pattern
/servlet-mapping

then it worked for me :)

Ron

On Thu, 2002-11-28 at 14:16, Curley, Thomas wrote:
 No -
 The requested resource (/study/TestServlet) is not available.
 
 
 Note
 I have just added the servlet mappings into examples web.xml and I can also now 
access the TestServlet in the examples context using either
 http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.TestServlet
 or
 http://localhost:8080/examples/servlet/TestServlet
 
 
 but neither works for the study webapp ?
 
 
 
 
 
 -Original Message-
 From: Martin Gruner [mailto:[EMAIL PROTECTED]]
 Sent: 28 November 2002 13:10
 To: 'Tomcat Users List'
 Subject: AW: How to add a servlet to a new Webapp 
 
 
 Hi!
 Try to access /study/TestServlet!!
 
 Martin
 
  -Ursprüngliche Nachricht-
  Von: Curley, Thomas [mailto:[EMAIL PROTECTED]]
  Gesendet: Donnerstag, 28. November 2002 13:58
  An: [EMAIL PROTECTED]
  Betreff: How to add a servlet to a new Webapp 
  
  
  Hi All,
  
  Using Tomcat 4.1.12 on Win 2K
  
  I am getting a 404 error when I try to create a new webapp 
  and add a very basic servlet.  The servlet works if I create 
  the package structure within the examples WEB-INF/classes.  
  Here are the steps:
  
  1.  created webapps/study
  2.  created 
  .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav
  a and compiled [ok]
  3.  added the following line to server.xml after the 
  examples /Context 
  
  Context path=/study docBase=study debug=0 
  /Context
  4.  just copied the examples web.xml to study/WEB-INF and 
  added the following lines
  
  
  servlet
servlet-name
TestServlet
/servlet-name
servlet-class
com.wrox.projsp.ch03.TestServlet
/servlet-class
  /servlet
  
  servlet-mapping
  servlet-nameTestServlet/servlet-name
  url-pattern/TestServlet/url-pattern
  /servlet-mapping
  
  
  5.  restart tomcat 
  
  
  RESULT - The requested resource (/study/servlet/TestServlet) 
  is not available.
  
  
  Can anyone see what I am missing ?
  
  
  
  thanks
  
  
  Thomas
  
  
  
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: help with multilingual JSP sites pls. using a Filter to rewrite the URL ?

2002-11-25 Thread Ron Smits
The browser can tell you the language that the system is setup for:

Accept-Language: en-us, en;q=0.50

This is from my Mozilla setup All modern browsers will return an Accept
Language string

Another question related to this, Are you telling me that all your jsp
pages have the actual content stored in several properties files? I
wonder what that would look like

Ron


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: tomcat sessions and webapp deployment

2002-11-25 Thread Ron Smits
Morning
 
 Nope, Tomcat 4.1.x will hang onto the sessions.  And the even worse news is
 that Tomcat 3.3.2-dev will now hang onto the sessions across a
 context-reload :).

This is not the behaviour I see.Sessions are invalidated after an ant
reload on tomcat 4.1.12-LE on a semislackware install

Ron


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Apache-Tomcat Conf

2002-11-23 Thread Ron Smits
To get tomcat to generate the mod_jk.conf file I had to do the
following:
just after the Server  line in server.xml add:  
  Listener className=org.apache.ajp.tomcat4.config.ApacheConfig
modJk=/opt/apache2/lib/mod_jk.so
workersConfig=/opt/tomcat/conf/jk/workers.properties/

then find the default virtual host  and add:
  Listener className=org.apache.ajp.tomcat4.config.ApacheConfig
  append=true forwardAll=true

That's it. Some notes though
* if you are using apache 2.0.43, you need to compile mod_jk
  yourself
* once the file has been created. I find it best to copy it to a
  safe place and make any needed changes by hand

Ron
On Sat, 2002-11-23 at 12:50, Nitesh Garg wrote:
 
 I hv downloaded Apache/Tomcat 4.1.12 and have apache 2.0, I want to configure my 
tomv\cat with apache. As in the given step when I run tomcat(it runs on standalone ) 
it does not generate mod_jk.conf-auto that i need to put in http.conf.
 
  
 
 Any suggestion to configure tomcat with apache will be help full
 
  
 
 thanx in advance
 
 Nitesh
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




apache and tomcat and a webapp

2002-11-23 Thread Ron Smits
This might not even be possible but I cannot find a definitive yes or no
answer

I am developing a webapp based on jsp and servlets. Once this is done I
want to deploy it on a server that has several domains on it. Currently
this server is running apache with JServ. 

My idea is to have apache 2.0.X together with tomcat 4.1.12 to take over
this work. I have managed to get apache to talk to tomcat using the
mod_jk connector. But I can only access my application by using the
application path (http://localhost/application/) instead of having
served up as the root of the virtual host (http://localhost/).

How to go about this?

Ron Smits
[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: apache and tomcat and a webapp

2002-11-23 Thread Ron Smits
Let me try and be more specific :)

First of all, if I get all to work the current setup with JServ will
disappear and I am testing this in a test environment (Vmware)

So let me see if I can chop my questions up in different parts
The application is being developed using tomcat 4.1.12 running
standalone. The development is going nice and contacting the application
on localhost:8080/application is perfect.

Question 1:
I want the application to be the root of the tomcat. Meaning that in my
test environment when I contact localhost:8080 I get the application and
not the standard Tomcat page.
I edited the server.xml and changed the Root context to point to the
application:
 Context path= docBase=application debug=0/ I even removed the
ROOT directory. When starting this up going to localhost:8080 will give
me a No context configured to process this request If I go to
localhost:8080/application my application is there. So how do I change
this?

Because the current server that needs to be replaced is running several
domains in a virtual setup (and very nicely too thanks to apache). My
idea is to remove the current 1.3 install with JServ and replace it with
apache 2.0.43 that will run all the virtual hosts and will talk to
tomcat for the web application (see question 1) that will be in a new
virtual host. So after I have been able to get question 1 answered
(replacing the root context with my application) the next question will
be what the best way is of setting mod_jk up to serve up the application
when apache gets a request for this application.

I hope this is more clearer 

Ron

PS to fullfill the list:
OS linux version 2.4.19
TOMCAT 4.1.12
JDK: jsdk1.4.1_1
Hardware never enough but it is a big enough intel box :)
Network: running fine, thank you :)




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]