RE: locating .properties files

2001-05-03 Thread Matthew O'Haire

Hi all,
 
We've found a solution to this, so for the benefit of the list here it is...
 
It seems Class.getResourceAsStream() and
ServletContext.getResourceAsStream(), the Javadoc for the latter says as
much:

This method has a different purpose than java.lang.Class.getResource, which
looks up resources based on a class loader. This method does not use class
loaders.

So it seems my original code worked in the IDE because Forte was including
my project in the classpath for starting the "embedded" Tomcat.
 
This meant that to manage resources we needed access to the ServletContext.
 
Rather than put references to "web layer" concepts in the "business layer"
we created a PropertiesFactory (singleton) class that was instantiated by
the LoginAction (with the ServletContext) and used by the business layer
without any reference to ServletContext.
 
We could have had the Factory surface ResourceStreams, but we thought that
by abstracting the access mechanism we could store propeties wherever we
wanted, as long as we surfaced them as java.util.Properties.
 
Anyhow, it works fine now in both the IDE and in production.  If anyone else
has a similar problem I'd be happy to share the code.  Thanks for the
feedback.
 
Matt.
 

-Original Message-
From: Jeff Trent [mailto:[EMAIL PROTECTED]]
Sent: Friday, 4 May 2001 14:29
To: [EMAIL PROTECTED]
Subject: Re: locating .properties files


I have the same problem ... I need to keep the properties file in two places
or else something gets wacked.  Haven't had the patience to research it any
further...
 

- Original Message - 
From: Jason   Chaffee 
To: '[EMAIL PROTECTED]'
  
Sent: Thursday, May 03, 2001 7:36 PM
Subject: RE: locating .properties files


You shouldn't be adding WEB-INF/classes to your classpath.  This should be
running as a web app. 

You should have the following in your deployment desciptor and you should
have ApplicaionResoruces.properties in the WEB-INF/classes directory:

 
ActionServlet 
 
org.apache.struts.action.ActionServlet 
 
application 
ApplicationResources 
 
 
config 
/WEB-INF/struts-config.xml 
 
 
locale 
true 
 
 
null 
false 
 
1 
 

-Original Message- 
From: Nigel Ainslie [ mailto:[EMAIL PROTECTED]
 ] 
Sent: Thursday, May 03, 2001 4:29 PM 
To: '[EMAIL PROTECTED]' 
Subject: RE: locating .properties files 


Hi Scott, 
I work with Matt.thanks for the response. We have located the properties

file in WEB-INF/classes both at that directory level and at the directory 
that the classes reside in (WEB-INF/classes/sub-directory/actualcode.class) 
but we still get the same error. Even tried adding $TOMCAT 
HOME.WEB-INF/classes to the classpath to no avail. 
Is there some subtlety that we are missing? 
Regards Nige 


-Original Message- 
From: Scott Walter [ mailto:[EMAIL PROTECTED]
 ] 
Sent: Friday, 4 May 2001 7:18 
To: [EMAIL PROTECTED] 
Subject: Re: locating .properties files 


You should just have to put it somewhere in the 
classpath (i.e. web-inf/classes) 

scott. 
--- Matthew O'Haire <[EMAIL PROTECTED]> wrote: 
> 
> Where should I put .properties file(s) in my WAR ? 
> 
> Should they be in the application .jar (where I put 
> the classes that use the 
> properties files, ie. the helpers used to implement 
> the struts Actions), or 
> in the META-INF somewhere? 
> 
> When I run the application under Forte it works fine 
> with the .properties in 
> the META-INF/Classes directory, but once I've packed 
> it up as a WAR it 
> doesn't run.  I getting a application generated 
> runtime exception stating 
> that the properties file was not found... 
> 
> I'm using the following code to locate and load the 
> .properties: 
> 
>   Properties p = new Properties(); 
>   InputStream is = 
> 
Thread.currentThread().getContextClassLoader().getResourceAsStream("datasour

> ce.properties"); 
>   if (is == null) { 
> throw new RuntimeException("ConnectionFactory: 
> could not find 
> 'datasource.properties' configuration file"); 
>   } 
>   p.load(is); 
> 
> Any assistance would be greatly appreciated. 
> 
> Thanks, 
> Matt. 


= 
~~~ 
Scott 

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




Re: How to check if an array is null

2001-05-03 Thread Chris Butler

 checks for null: whether the bean or bean
property exists.  it works fine with arrays.

c

At 03:08 PM 5/3/2001 -0400, Alex Colic wrote:
>Hi, I have a class which has a method 'Columns' which is a one dim array of
>Strings. How can I check to see if that method returns null. I want to write
>out one message if it is null another if it is not.
>
>Thanks for the help.
>
>Regards
>
>Alex




Struts in new JSP 2nd Edition Book

2001-05-03 Thread Sean

Hello All,

Have not seen this posted yet, wanted to update people.  There is a whole
chapter on Struts in the new JSP second edition book:

http://www.amazon.com/exec/obidos/ASIN/1861004958/smw-20

There is also a reference to an example at the WROX site.  It is a Struts
shopping cart example:

http://quark.newparticles.com/struts/

It looks to be pretty thourough and is a great resource as an example
application.  I thought this might interest everyone.

Sean




Re: locating .properties files

2001-05-03 Thread Jeff Trent
Title: RE: locating .properties files



I have the same problem ... I need to keep the 
properties file in two places or else something gets wacked.  Haven't had 
the patience to research it any further...
 

  - Original Message - 
  From: 
  Jason 
  Chaffee 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Thursday, May 03, 2001 7:36 
PM
  Subject: RE: locating .properties 
  files
  
  You shouldn't be adding WEB-INF/classes to your 
  classpath.  This should be running as a web app. 
  You should have the following in your deployment desciptor and 
  you should have ApplicaionResoruces.properties in the WEB-INF/classes 
  directory:
           
  ActionServlet     
  org.apache.struts.action.ActionServlet 
      
       
  application     
  ApplicationResources      
      
       
  config     
  /WEB-INF/struts-config.xml 
      
        
      
  locale     
  true      
      
       
  null     
  false      
      
  1      
  -Original Message- From: Nigel 
  Ainslie [mailto:[EMAIL PROTECTED]] 
  Sent: Thursday, May 03, 2001 4:29 PM To: '[EMAIL PROTECTED]' Subject: 
  RE: locating .properties files 
  Hi Scott, I work with Matt.thanks 
  for the response. We have located the properties file 
  in WEB-INF/classes both at that directory level and at the directory 
  that the classes reside in 
  (WEB-INF/classes/sub-directory/actualcode.class) but 
  we still get the same error. Even tried adding $TOMCAT HOME.WEB-INF/classes to the classpath to no avail. Is there some subtlety that we are missing? Regards Nige 
  -Original Message- From: Scott 
  Walter [mailto:[EMAIL PROTECTED]] 
  Sent: Friday, 4 May 2001 7:18 To: 
  [EMAIL PROTECTED] Subject: Re: locating 
  .properties files 
  You should just have to put it somewhere in the 
  classpath (i.e. web-inf/classes) 
  scott. --- Matthew O'Haire 
  <[EMAIL PROTECTED]> wrote: > 
  > Where should I put .properties file(s) in my WAR 
  ? > > Should they be in 
  the application .jar (where I put > the classes 
  that use the > properties files, ie. the helpers 
  used to implement > the struts Actions), or 
  > in the META-INF somewhere? > 
  > When I run the application under Forte it works 
  fine > with the .properties in > the META-INF/Classes directory, but once I've packed 
  > it up as a WAR it > doesn't 
  run.  I getting a application generated > 
  runtime exception stating > that the properties 
  file was not found... > > I'm using the following code to locate and load the 
  > .properties: > 
  >   Properties p = new 
  Properties(); >   InputStream is = 
  > Thread.currentThread().getContextClassLoader().getResourceAsStream("datasour 
  > ce.properties"); >   if (is == null) { > throw new 
  RuntimeException("ConnectionFactory: > could not 
  find > 'datasource.properties' configuration 
  file"); >   } >   p.load(is); > 
  > Any assistance would be greatly 
  appreciated. > > 
  Thanks, > Matt. 
  = ~~~ Scott 
  __ 
  Do You Yahoo!? Yahoo! Auctions - buy 
  the things you want at great prices http://auctions.yahoo.com/ 



Re: Servlets, Beans, Struts, and Threading

2001-05-03 Thread Sean

John,

If I subclass servlets does that mean they always run within their own
thread?  The reason I ask is that this "process" I am talking about is a
connection to a remote server.  The calls to and from this process are
asynchronous and thus the remote server can send messages to this process at
any time reguardless if a request is being processed by Tomcat or not.  I
want to make sure that this process has its own processing space (so it
doesn't block) but still conform to the standards of the servlet container
(i.e. startup and stop).  Since this process currently runs in its own
thread implementing our own Service architecture I thought I might be able
to subclass it and implement the Servlet interface in order to give it it's
own thread of execution in the servlet container. That was what lead me to
ask whether or not a Servlet is guaranteed to be in its own thread of
execution.

Any insight you, Paul, or anyone else could give here would be greatly
appreciated.

Sean

- Original Message -
From: "John Raley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 12:20 PM
Subject: Re: Servlets, Beans, Struts, and Threading


> Sean,
>
> You would probably not write the task as a Servlet.  Instead, as part of
your
> startup you'd put the task in application scope.  Remember that
Servlets/JSPs
> that talk to the task are going to do so from different threads
(potentially at
> the same time).  The task would probably manage its own threads.  If it
> executes periodically check out the Timer / TimerTask classes in
java.util -
> they might save you a fair amount of work.  There's no reason any of this
> should be Tomcat-specific.





RE: database connection

2001-05-03 Thread Natra, Uday

There is only one ServletContext for the entire Web Application.


-Original Message-
From: Ying Teng [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 5:05 PM
To: [EMAIL PROTECTED]
Subject: RE: database connection



The ServletContext object of databaseServlet or the ActionServlet? Could you
be more specific? Thanks.


-Original Message-
From: Vivek Bhaskaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: Re: database connection


A reference to the DataSource is stored in the ServletContext object... You
can get it from that.

- Original Message -
From: "Ying Teng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 11:28 AM
Subject: RE: database connection


>
> What you described is true. Now my question is how to get the datasource
> without referencing the actionServlet. I wanted to intialize the database
> hashtable of the databaseServlet class in the databaseServlet init
function.
> In order to do that, I need to get the datasource. But I can not reference
> the actionServlet because the action is initialized after the database is
> initialized (as in the log file). Hope someone can give me some hints.
> Thanks.
>
> Ying
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: database connection
>
>
>
> You will add the key information to the datasource info in you
> struts-config.xml file  it will look like this:
> 
>key="[some name I'll use to reference this datasource]"
>autoCommit="false"
>description="Data Source Configuration"
>driverClass="org.gjt.mm.mysql.Driver"
>maxCount="4"
>minCount="2"
>password="pass"
>
> url
> ="jdbc:mysql://bethsoft.dev.zenimax.com:3306/test?user=user&password=pass
> "
>user="user"
> />
>   
>
> Then, after that's done, the easiest way to access it is to reference it
by
> the action servlet (servlet),  because using actionServlet you can just do
> servlet.findDataSource("the name you called your datasource")  and voila,
> you have your datasource object.  From that datasource object you can
> create a connection.
> If you cannot access the actionServlet, then it's a little more
> difficult--and actually I wouldn't be able to help much there, but at
least
> your question would then be "how do I get the datasource without
> referencing the actionServlet"
>
> -Dallas
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




RE: locating .properties files

2001-05-03 Thread Jason Chaffee
Title: RE: locating .properties files





You shouldn't be adding WEB-INF/classes to your classpath.  This should be running as a web app.


You should have the following in your deployment desciptor and you should have ApplicaionResoruces.properties in the WEB-INF/classes directory:

    
    ActionServlet
    org.apache.struts.action.ActionServlet
    
    application
    ApplicationResources
    
    
    config
    /WEB-INF/struts-config.xml
    
    
    locale
    true
    
    
    null
    false
    
    1
    


-Original Message-
From: Nigel Ainslie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 4:29 PM
To: '[EMAIL PROTECTED]'
Subject: RE: locating .properties files



Hi Scott,
I work with Matt.thanks for the response. We have located the properties
file in WEB-INF/classes both at that directory level and at the directory
that the classes reside in (WEB-INF/classes/sub-directory/actualcode.class)
but we still get the same error. Even tried adding $TOMCAT
HOME.WEB-INF/classes to the classpath to no avail.
Is there some subtlety that we are missing?
Regards Nige



-Original Message-
From: Scott Walter [mailto:[EMAIL PROTECTED]]
Sent: Friday, 4 May 2001 7:18
To: [EMAIL PROTECTED]
Subject: Re: locating .properties files



You should just have to put it somewhere in the
classpath (i.e. web-inf/classes)


scott.
--- Matthew O'Haire <[EMAIL PROTECTED]> wrote:
> 
> Where should I put .properties file(s) in my WAR ?
> 
> Should they be in the application .jar (where I put
> the classes that use the
> properties files, ie. the helpers used to implement
> the struts Actions), or
> in the META-INF somewhere?
> 
> When I run the application under Forte it works fine
> with the .properties in
> the META-INF/Classes directory, but once I've packed
> it up as a WAR it
> doesn't run.  I getting a application generated
> runtime exception stating
> that the properties file was not found...
> 
> I'm using the following code to locate and load the
> .properties:
> 
>   Properties p = new Properties();
>   InputStream is =
>
Thread.currentThread().getContextClassLoader().getResourceAsStream("datasour
> ce.properties");
>   if (is == null) {
> throw new RuntimeException("ConnectionFactory:
> could not find
> 'datasource.properties' configuration file");
>   }
>   p.load(is);
> 
> Any assistance would be greatly appreciated.
> 
> Thanks,
> Matt.



=
~~~
Scott


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





RE: locating .properties files

2001-05-03 Thread Nigel Ainslie

Hi Scott,
I work with Matt.thanks for the response. We have located the properties
file in WEB-INF/classes both at that directory level and at the directory
that the classes reside in (WEB-INF/classes/sub-directory/actualcode.class)
but we still get the same error. Even tried adding $TOMCAT
HOME.WEB-INF/classes to the classpath to no avail.
Is there some subtlety that we are missing?
Regards Nige


-Original Message-
From: Scott Walter [mailto:[EMAIL PROTECTED]]
Sent: Friday, 4 May 2001 7:18
To: [EMAIL PROTECTED]
Subject: Re: locating .properties files


You should just have to put it somewhere in the
classpath (i.e. web-inf/classes)

scott.
--- Matthew O'Haire <[EMAIL PROTECTED]> wrote:
> 
> Where should I put .properties file(s) in my WAR ?
> 
> Should they be in the application .jar (where I put
> the classes that use the
> properties files, ie. the helpers used to implement
> the struts Actions), or
> in the META-INF somewhere?
> 
> When I run the application under Forte it works fine
> with the .properties in
> the META-INF/Classes directory, but once I've packed
> it up as a WAR it
> doesn't run.  I getting a application generated
> runtime exception stating
> that the properties file was not found...
> 
> I'm using the following code to locate and load the
> .properties:
> 
>   Properties p = new Properties();
>   InputStream is =
>
Thread.currentThread().getContextClassLoader().getResourceAsStream("datasour
> ce.properties");
>   if (is == null) {
> throw new RuntimeException("ConnectionFactory:
> could not find
> 'datasource.properties' configuration file");
>   }
>   p.load(is);
> 
> Any assistance would be greatly appreciated.
> 
> Thanks,
> Matt.


=
~~~
Scott

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



RE: Problem in struts-example accessing ApplicationResources

2001-05-03 Thread Anthony Martin



I had 
this problem last night on Windows ME, JDK 1.3.1.  The exact same project 
files worked fine on Win2k and FreeBSD without having to mess with the classpath 
like that.
 
I have 
found that Windows ME has issues with it's environment space.  Some issues 
clear up when you execute "COMMAND /e 2048" from start, run.
 
 
Anthony

  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 03, 2001 4:11 
  PMTo: [EMAIL PROTECTED]Subject: Problem in 
  struts-example accessing ApplicationResourcesI have just started to evaluate Struts as a 
  possible platform for development. When I tried to run the 
  struts-example I got the following error (reading the mail indicates other 
  newbies are having similar problems): Error: 500 Location: 
  /struts-example/index.jsp Internal Servlet Error: 
  javax.servlet.ServletException: Missing message for key index.title 
    This seemed like an 
  environment problem and I was able to get around this by adding: 
  $TOMCAT_HOME\webapps\struts-example\WEB-INF\classes to my 
  classpath.  Does anyone have an explanation for why this was necessary? 
  I am running Tomcat 3.2.1 standalone on Windows ME and use 
  jdk1.2.2-006. Thanks, Damon 



Problem in struts-example accessing ApplicationResources

2001-05-03 Thread Damonwfinney
I have just started to evaluate Struts as a possible platform for development.

When I tried to run the struts-example I got the following error (reading the 
mail indicates other newbies are having similar problems):

Error: 500
Location: /struts-example/index.jsp
Internal Servlet Error:

javax.servlet.ServletException: Missing message for key index.title
  

This seemed like an environment problem and I was able to get around this by 
adding:

$TOMCAT_HOME\webapps\struts-example\WEB-INF\classes

to my classpath.  Does anyone have an explanation for why this was necessary?

I am running Tomcat 3.2.1 standalone on Windows ME and use jdk1.2.2-006.

Thanks,
Damon


Nested and problems

2001-05-03 Thread Roman Fail

I am having difficulty with the HTML output when using nested iterate
tags.  After reviewing the archives, I can see others have had a similar
goal but I didn't see any working solutions. 
 
For some reason all of the output from the inner  is being
printed before the body of the outer tag is printed.  Is this a bug, or
due to some sort of recursion issue?  I am using the most recent binary
nightly build.  Here is an example of the code that I *wish* would work
intuitively:
 


  
  OrderNum:
  

 
It is sort of a parent-child-grandchild relationship, the Report bean
returns an ArrayList of Customer beans, which in turn return an
ArrayList of Order beans.  The desired effect is like this:
 
-
John Smith
   OrderNum: 10034
   OrderNum: 25467
   OrderNum: 29876
-
Jane Doe
   OrderNum: 15678
   OrderNum: 23456
 
...and so on for more customers.  The output actually looks like:
 
JohnSmith100342546729876JaneDoe1567823456
   OrderNum:
   OrderNum:
   OrderNum:
-
   OrderNum:
   OrderNum:
-
 
The funny thing is that if I get rid of  and use
, the order numbers come up in the right place, but the
customer names are output *below* the matching order numbers.  Go
figure.
 
I tried using a scriplet 'for' loop instead of the outer iterate tag,
and everything works fine.  Example:
 
<% ArrayList customers = report.getCustomers();
  for (int i=0; i < customers.size(); i++) {
  CustomerBean customer = (CustomerBean)customers.get(i);
  pageContext.setAttribute("customer", customer,
PageContext.PAGE_SCOPE);
%>
  
  
  OrderNum:
  
<% } %>
 
So does anyone know why this happens?  I searched the archives and found
some people who said they were successfully doing this, but only in
theory:
 
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg03951.html
 
I can provide the complete JSP code and the bean classes (which are real
simple, I wrote them just to test this).  
 
Craig indicated that this was possible to do like so:
> > For example, consider a bean that has a getter method:
> >
> > public Map getProperties();
> >
> > and you had a collection of them called "beans".  Then you
can:
> >
> > 
> >   Now processing bean 
> >   
> > Property 
> > has value 
> >   
> > 
 
(near the bottom of
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg05232.html
)
 
Any ideas?  My gut tells me it is a recursion issue. I can leave it as a
scriptlet.but if that was acceptable I wouldn't be using Struts
anyway!
 
Thanks,   
Roman
[EMAIL PROTECTED]  
 
 



RE: database connection

2001-05-03 Thread Ying Teng


The ServletContext object of databaseServlet or the ActionServlet? Could you
be more specific? Thanks.


-Original Message-
From: Vivek Bhaskaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: Re: database connection


A reference to the DataSource is stored in the ServletContext object... You
can get it from that.

- Original Message -
From: "Ying Teng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 11:28 AM
Subject: RE: database connection


>
> What you described is true. Now my question is how to get the datasource
> without referencing the actionServlet. I wanted to intialize the database
> hashtable of the databaseServlet class in the databaseServlet init
function.
> In order to do that, I need to get the datasource. But I can not reference
> the actionServlet because the action is initialized after the database is
> initialized (as in the log file). Hope someone can give me some hints.
> Thanks.
>
> Ying
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: database connection
>
>
>
> You will add the key information to the datasource info in you
> struts-config.xml file  it will look like this:
> 
>key="[some name I'll use to reference this datasource]"
>autoCommit="false"
>description="Data Source Configuration"
>driverClass="org.gjt.mm.mysql.Driver"
>maxCount="4"
>minCount="2"
>password="pass"
>
> url
> ="jdbc:mysql://bethsoft.dev.zenimax.com:3306/test?user=user&password=pass
> "
>user="user"
> />
>   
>
> Then, after that's done, the easiest way to access it is to reference it
by
> the action servlet (servlet),  because using actionServlet you can just do
> servlet.findDataSource("the name you called your datasource")  and voila,
> you have your datasource object.  From that datasource object you can
> create a connection.
> If you cannot access the actionServlet, then it's a little more
> difficult--and actually I wouldn't be able to help much there, but at
least
> your question would then be "how do I get the datasource without
> referencing the actionServlet"
>
> -Dallas
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





Struts with Tomcat and JRun

2001-05-03 Thread Park, Doug N


Hi All,

We have been running a struts application for the last couple of months on
Tomcat and now we have a user group that wants to run it on a JRun server as
well. Any thoughts on getting the same app to work on both? Looks like the
only issue is the Tomcat string, JRun Boolean problem.

Thanks for the help,
Doug Park





Re: database connection

2001-05-03 Thread Vivek Bhaskaran

A reference to the DataSource is stored in the ServletContext object... You
can get it from that.

- Original Message -
From: "Ying Teng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 11:28 AM
Subject: RE: database connection


>
> What you described is true. Now my question is how to get the datasource
> without referencing the actionServlet. I wanted to intialize the database
> hashtable of the databaseServlet class in the databaseServlet init
function.
> In order to do that, I need to get the datasource. But I can not reference
> the actionServlet because the action is initialized after the database is
> initialized (as in the log file). Hope someone can give me some hints.
> Thanks.
>
> Ying
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: database connection
>
>
>
> You will add the key information to the datasource info in you
> struts-config.xml file  it will look like this:
> 
>key="[some name I'll use to reference this datasource]"
>autoCommit="false"
>description="Data Source Configuration"
>driverClass="org.gjt.mm.mysql.Driver"
>maxCount="4"
>minCount="2"
>password="pass"
>
> url
> ="jdbc:mysql://bethsoft.dev.zenimax.com:3306/test?user=user&password=pass
> "
>user="user"
> />
>   
>
> Then, after that's done, the easiest way to access it is to reference it
by
> the action servlet (servlet),  because using actionServlet you can just do
> servlet.findDataSource("the name you called your datasource")  and voila,
> you have your datasource object.  From that datasource object you can
> create a connection.
> If you cannot access the actionServlet, then it's a little more
> difficult--and actually I wouldn't be able to help much there, but at
least
> your question would then be "how do I get the datasource without
> referencing the actionServlet"
>
> -Dallas
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




Re: locating .properties files

2001-05-03 Thread Scott Walter

You should just have to put it somewhere in the
classpath (i.e. web-inf/classes)

scott.
--- Matthew O'Haire <[EMAIL PROTECTED]> wrote:
> 
> Where should I put .properties file(s) in my WAR ?
> 
> Should they be in the application .jar (where I put
> the classes that use the
> properties files, ie. the helpers used to implement
> the struts Actions), or
> in the META-INF somewhere?
> 
> When I run the application under Forte it works fine
> with the .properties in
> the META-INF/Classes directory, but once I've packed
> it up as a WAR it
> doesn't run.  I getting a application generated
> runtime exception stating
> that the properties file was not found...
> 
> I'm using the following code to locate and load the
> .properties:
> 
>   Properties p = new Properties();
>   InputStream is =
>
Thread.currentThread().getContextClassLoader().getResourceAsStream("datasour
> ce.properties");
>   if (is == null) {
> throw new RuntimeException("ConnectionFactory:
> could not find
> 'datasource.properties' configuration file");
>   }
>   p.load(is);
> 
> Any assistance would be greatly appreciated.
> 
> Thanks,
> Matt.


=
~~~
Scott

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



Re: How to check if an array is null

2001-05-03 Thread Scott Walter

if(classinstance.Columns()==null)
   //do something
else
   //do something

NOTE:  There is a difference between checking if an
array is null and checking if the elements within the
array are null.  The above example checks the array
itself.

scott.
--- Alex Colic <[EMAIL PROTECTED]> wrote:
> Hi, I have a class which has a method 'Columns'
> which is a one dim array of
> Strings. How can I check to see if that method
> returns null. I want to write
> out one message if it is null another if it is not.
> 
> Thanks for the help.
> 
> Regards
> 
> Alex
> 


=
~~~
Scott

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



RE: I8N newbie question

2001-05-03 Thread Anthony Martin

Do you mean, how do you internationalize the submit value?  That question
has been answered in the list before:






Anthony

-Original Message-
From: Kris Vandenberk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 10:49 AM
To: [EMAIL PROTECTED]
Subject: I8N newbie question


Hi,

let's say I have the following piece of code :


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>


  
    

   



  


//

The translation of Username and Password works, but how can I translate the
submit value ... ?


thanks

Kris



RE: I8N newbie question

2001-05-03 Thread Nanduri, Amarnath

Why do you want to translate the submit value ? Try this then and it will
work. Constants is a java file. This name will be send back to the server if
you press this button. The message appearing to the user is
internationalized.



  



cheers,
Amar..


-Original Message-
From: Kris Vandenberk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 1:49 PM
To: [EMAIL PROTECTED]
Subject: I8N newbie question


Hi,

let's say I have the following piece of code :


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>


  
    

   



  


//

The translation of Username and Password works, but how can I translate the
submit value ... ?


thanks

Kris



Re: I8N newbie question

2001-05-03 Thread Maxime Soucy

I'm new to Struts also and I faced the same problem recently... and my
solution was to use this

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>



   




Maxime Soucy
Ad-Opt Technologies


- Original Message -
From: "Kris Vandenberk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 1:49 PM
Subject: I8N newbie question


> Hi,
>
> let's say I have the following piece of code :
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
>
>   
>      property="username" size="15"/>
> 
>      property="password" size="15"/>
> 
> 
>   
>
>
> //
>
> The translation of Username and Password works, but how can I translate
the
> submit value ... ?
>
>
> thanks
>
> Kris
>




Re: RE: i18n...

2001-05-03 Thread jsmith

I am using iPlanet iAS 6.0 SP2.  I may try other app servers out just to 
see if that is the problem.  Would it be worth giving it a shot on 
Tomcat?

--
Jason Smith
[EMAIL PROTECTED]

- Original Message -
From: Jason Chaffee <[EMAIL PROTECTED]>
Date: Thursday, May 3, 2001 11:37 am
Subject: RE: i18n...

> I concur, Resin is an excellent app server.  If you need EJBs as 
> well, you
> can also use JBoss with Resin.
> 
> -Original Message-
> From: Paul Tindall [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 02, 2001 9:09 PM
> To: [EMAIL PROTECTED]
> Subject: Re: i18n...
> 
> 
> Jason,
> 
> I looked through the email trail for this and didn't see any 
> mention of
> which servlet engine you are using.  Outside of checking your 
> environmentand configuration as Martin suggests (which is probably 
> the root cause), you
> may want to take a look Resin (www.caucho.com).  It is super-fast 
> and very
> clean.  I've had many strange problems (non-Struts) disappear after
> switching to it.
> 
> Regards,
> 
> Paul
> 
> - Original Message -
> From: "Martin Cooper" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, May 02, 2001 10:46 PM
> Subject: Re: i18n...
> 
> 
> > This is very strange. We have some pages that have more than 
> twice as many
> >  instances as you mention. I just did a quick test 
> on our
> > latest build, and it's really very fast. Certainly nothing that 
> needs any
> > performance enhancement.
> >
> > You might want to poke around in your environment and see if there's
> > something going on in the container or the JVM that's causing 
> the problem.
> I
> > don't think the issue is the  tag itself.
> >
> > --
> > Martin Cooper
> >
> >
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, April 27, 2001 10:53 AM
> > Subject: i18n...
> >
> >
> > > I have a couple of questions.
> > >
> > > I had a JSP in which I had approximately 40 bean:message tags 
> for i18n.
> > > This page was taking 15 seconds to load.  If I had two 
> requests for the
> > > page at the same time it would take 45 to 60 seconds.  
> Obviously this is
> > > not acceptable.  When I replaced the bean:message tags with 
> the text,
> > > the response time goes to a respectable 3 to 5 seconds with 
> multiple> > hits.  Therefore, I have to come up with another 
> method of
> > > internationalization.
> > >
> > > I am new to this so I am looking for suggestions.  I have to 
> support 4
> > > languages.  My current thought is to detect the browser's 
> settings and
> > > forward the request to the appropriate JSP that is specific to the
> > > language settings.  I'm not sure exactly where this should be 
> done.  I
> > > would like it to be dynamic so that I can reuse FORM and 
> ACTION beans
> > > for each related page.
> > >
> > > Again, any suggestions would be appreciated.
> > >
> > > --
> > > Jason Smith
> > > [EMAIL PROTECTED]
> > >
> >
> >
> >
> 




Re: Servlets, Beans, Struts, and Threading

2001-05-03 Thread Paul Tindall

Sean,

It is my undertanding that you do not want to do your own threading anywhere
within a J2EE container as bad things can happen.  If you need to create a
timer process to kick off other communication processes, WebLogic and Resin
both have them and the containers will manage the threads.  These timer
features are not part of the J2EE standard so I'm not sure about Tomcat or
other containers and what level of support they might have.

Regards,

Paul


- Original Message -
From: "Sean" <[EMAIL PROTECTED]>
To: "Struts Users" <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 10:31 AM
Subject: Servlets, Beans, Struts, and Threading


> Hello All,
>
> This is a simular question I asked on the Tomcat mailing list and never
got
> a reply.  I was hoping someone could give me some good input on this topic
> from this list.
>
> If I have a process that needs to run within Tomcat&Struts to communicate
> with a remote server, and that process needs it's own thread of execution,
> what would be the best way to go about this in the Tomcat/Servlet
container
> world?  I am not sure if each Servlet has it's own thread of execution so
I
> wasn't sure if I should just subclass Servlet or HttpServlet.  I am not
sure
> of the ramifications of having a bean manage it's own threads and how that
> would effect Tomcat in general.
>
> Does anyone have any pointers, ideas, or suggestions on how they have done
> this or would go about doing this nicely in Tomcat?  Would this be cross
> container code or Tomcat specific?
>
> Thanks,
> Sean
>




How to check if an array is null

2001-05-03 Thread Alex Colic

Hi, I have a class which has a method 'Columns' which is a one dim array of
Strings. How can I check to see if that method returns null. I want to write
out one message if it is null another if it is not.

Thanks for the help.

Regards

Alex




connection Pool

2001-05-03 Thread Lu, Ping X.

My question:
1. when setup at strust-config.xml, who instance the connect pool ?( is
Struts )
 2. my company  have a situation, we want connect pool shere by all webapps,
for example : 10 data-source and maxCount="20" for each, it there a way
tomcat can do this? (I know Jrun,websphere and weblogic may support this
function).

-Original Message-
From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, May 02, 2001 2:10 PM
To: [EMAIL PROTECTED]
Subject:RE: database connection


You will add the key information to the datasource info in you
struts-config.xml file  it will look like this:


  

Then, after that's done, the easiest way to access it is to
reference it by
the action servlet (servlet),  because using actionServlet you can
just do
servlet.findDataSource("the name you called your datasource")  and
voila,
you have your datasource object.  From that datasource object you
can
create a connection.
If you cannot access the actionServlet, then it's a little more
difficult--and actually I wouldn't be able to help much there, but
at least
your question would then be "how do I get the datasource without
referencing the actionServlet"

-Dallas




"Ying Teng"

  
x.com>   cc:

 Fax to:

05/02/01 Subject: RE: database
connection  
12:31 PM

Please

respond to

struts-user









The question is how to add or specify the datasource key value. I
added the
datasource tag contents in the struts-config.xml file. What else do
I need
to do? Do I need add an ActionDataSource class? Do I need to use the
GenericDataSource class? Thanks.

Ying


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 12:06 PM
To: [EMAIL PROTECTED]
Subject: RE: database connection



The reason why the value is null is because that is the default when
you
don't specify a "key" value for your datasource.  When that is the
case you
will obtain your connection in the following manner:



   try {
  javax.sql.DataSource dataSource =
servlet.findDataSource(null);
  java.sql.Connection myConnection =
dataSource.getConnection();


  Once again, if you want to change the value from "null" to
something
  else, just add " key=[something other than null] " to your
datasource
  configuration.

  Hope that helps.

  -Dallas







"Ying Teng"

x.com>   cc:
 Fax to:
05/02/01 Subject: RE: database
connection
09:50 AM
Please
respond to
struts-user






Yes, I did. I use my SQL and mine looks like this:



  

What else do I need to do to add this datasource to struts? Thanks.

Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 11:05 AM
To: [EMAIL PROTECTED]
Subject: Re: database connection




Did you set up the data source configuration in your
struts-config.xml
file?
I'm using oracle 8.1.6, my setup looks like this.


  


-Donnie Hall




|+--->
||  yteng@zenimax|
||  .com |
||   |
||  05/02/2001   |
||  09:39 AM |
||  Please   |
||  respond to   |
||  struts-user  |
||   |
|+--->

>

---
-|
  |
|
  |   To: [EMAIL PROTECTED]
|
  |   cc: (bcc: Donnie Hall/Enron Communications)
|
  |   Subject: database connection
|

>

---

RE: database connection

2001-05-03 Thread Ying Teng


What you described is true. Now my question is how to get the datasource
without referencing the actionServlet. I wanted to intialize the database
hashtable of the databaseServlet class in the databaseServlet init function.
In order to do that, I need to get the datasource. But I can not reference
the actionServlet because the action is initialized after the database is
initialized (as in the log file). Hope someone can give me some hints.
Thanks.

Ying

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 3:10 PM
To: [EMAIL PROTECTED]
Subject: RE: database connection



You will add the key information to the datasource info in you
struts-config.xml file  it will look like this:


  

Then, after that's done, the easiest way to access it is to reference it by
the action servlet (servlet),  because using actionServlet you can just do
servlet.findDataSource("the name you called your datasource")  and voila,
you have your datasource object.  From that datasource object you can
create a connection.
If you cannot access the actionServlet, then it's a little more
difficult--and actually I wouldn't be able to help much there, but at least
your question would then be "how do I get the datasource without
referencing the actionServlet"

-Dallas























I8N newbie question

2001-05-03 Thread Kris Vandenberk

Hi,

let's say I have the following piece of code :


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>


  
    

    


  


//

The translation of Username and Password works, but how can I translate the
submit value ... ?


thanks

Kris




try to give a solution on this one...

2001-05-03 Thread Charlemagne L. Rey

hello everybody,

i have this case and i don't know how to do it?

i'm trying to iterate the collection results and
gave the id result to each of the entry.













now, i would like to create a link to another page using
the information that i have from the instance of each result.
i have an idea but i'm not sure if it is right? i would to
like consult it to everybody...

my idea:
create a form that contains the hidden properties using
the data i could have from the "result" instances.
but i do not know how to create that form and to pass
the data that i got to the hidden properties...

any idea?

thanx.
charlemagne



Re: Servlets, Beans, Struts, and Threading

2001-05-03 Thread John Raley

Sean,

You would probably not write the task as a Servlet.  Instead, as part of your
startup you'd put the task in application scope.  Remember that Servlets/JSPs
that talk to the task are going to do so from different threads (potentially at
the same time).  The task would probably manage its own threads.  If it
executes periodically check out the Timer / TimerTask classes in java.util -
they might save you a fair amount of work.  There's no reason any of this
should be Tomcat-specific.

Sean wrote:

> Hello All,
>
> This is a simular question I asked on the Tomcat mailing list and never got
> a reply.  I was hoping someone could give me some good input on this topic
> from this list.
>
> If I have a process that needs to run within Tomcat&Struts to communicate
> with a remote server, and that process needs it's own thread of execution,
> what would be the best way to go about this in the Tomcat/Servlet container
> world?  I am not sure if each Servlet has it's own thread of execution so I
> wasn't sure if I should just subclass Servlet or HttpServlet.  I am not sure
> of the ramifications of having a bean manage it's own threads and how that
> would effect Tomcat in general.
>
> Does anyone have any pointers, ideas, or suggestions on how they have done
> this or would go about doing this nicely in Tomcat?  Would this be cross
> container code or Tomcat specific?
>
> Thanks,
> Sean




Usage of "include" or "forward" in Action definition

2001-05-03 Thread James Howe

Could someone explain a little more about when you would want to use either 
the "include" or "forward" attributes of the action tag (used in 
struts-config.xml) instead of the "type" attribute"?  An example or two 
would go a long way to clarifying when and why someone might want to use 
either include or forward.

Thanks.




Changes in Tomcat 3.3?

2001-05-03 Thread dhay



Does anyone out there know whether I have to change somekind of document base in
Tomcat 3.3?  I have moved to it from 3.2 and none of my images are showing up,
including those with struts html:image tag.

Any help appreciated!

Dave






RE: i18n...

2001-05-03 Thread Jason Chaffee
Title: RE: i18n...





I concur, Resin is an excellent app server.  If you need EJBs as well, you can also use JBoss with Resin.


-Original Message-
From: Paul Tindall [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 9:09 PM
To: [EMAIL PROTECTED]
Subject: Re: i18n...



Jason,


I looked through the email trail for this and didn't see any mention of
which servlet engine you are using.  Outside of checking your environment
and configuration as Martin suggests (which is probably the root cause), you
may want to take a look Resin (www.caucho.com).  It is super-fast and very
clean.  I've had many strange problems (non-Struts) disappear after
switching to it.


Regards,


Paul


- Original Message -
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 10:46 PM
Subject: Re: i18n...



> This is very strange. We have some pages that have more than twice as many
>  instances as you mention. I just did a quick test on our
> latest build, and it's really very fast. Certainly nothing that needs any
> performance enhancement.
>
> You might want to poke around in your environment and see if there's
> something going on in the container or the JVM that's causing the problem.
I
> don't think the issue is the  tag itself.
>
> --
> Martin Cooper
>
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 27, 2001 10:53 AM
> Subject: i18n...
>
>
> > I have a couple of questions.
> >
> > I had a JSP in which I had approximately 40 bean:message tags for i18n.
> > This page was taking 15 seconds to load.  If I had two requests for the
> > page at the same time it would take 45 to 60 seconds.  Obviously this is
> > not acceptable.  When I replaced the bean:message tags with the text,
> > the response time goes to a respectable 3 to 5 seconds with multiple
> > hits.  Therefore, I have to come up with another method of
> > internationalization.
> >
> > I am new to this so I am looking for suggestions.  I have to support 4
> > languages.  My current thought is to detect the browser's settings and
> > forward the request to the appropriate JSP that is specific to the
> > language settings.  I'm not sure exactly where this should be done.  I
> > would like it to be dynamic so that I can reuse FORM and ACTION beans
> > for each related page.
> >
> > Again, any suggestions would be appreciated.
> >
> > --
> > Jason Smith
> > [EMAIL PROTECTED]
> >
>
>
>





RE: Struts and VisualAge 3.5.3 with WTE

2001-05-03 Thread Jon.Ridgway

Hi Kyle,

Yes error messages are OK. One thing I did have to change was under point
7), the servlet-path should read :

*.do

the / in front seems to have caused a problem. 

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 16:02
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE


Very good Jon.  One last question -- have you tested far enough to see if
Error messages display in JSP's?  I think you might have to set another
classpath on the servlet engine or the workspace classpath to get that to
work -- it's not working so far in my system...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/03/2001 10:14:15 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE



Hi All,

Just to let you know that the following seems to have worked fine.

1) Add WTE & EJB Env to workspace.
2) Create open editions of :

 - org.w3c.dom
 - org.xml.sax
 - org.xml.sax.helpers

 in the IBM XML Parser for Java project.

3) Create a new Xerces project and import all the src from the Xerces 1.3.1
build ie javax and org substrees.
4) Create a new webgroup in the default.servlet_engine file, eg :

   
   Struts
   $approot$/web
   $approot$/web
   /struts
   
   false


*Note that I have used a root-uri so I can keep things seperate.
*Note that both the doc root and classpath point to the same dir.

5) Copy the default_app dir to struts (or whatever you called your
webgroup)
6) Rename the servlets/default_app.webapp file to web/struts.webapp
7) Edit struts.webapp to include your action servlet, to provide JSP 1.1
and
struts taglib definitions eg :

  
  action
  Struts Action Servlet
  org.apache.struts.action.ActionServlet
  /*.do
  
application
ApplicationResources
  
  
config
/WEB-INF/struts-config.xml
  
  
debug
2
  
  
detail
2
  
  
validate
true
  
  true
  

  
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

8) Unpack the struts-blank.war file into struts/web
9) Kick of the WTE env and type http://localhost:8080/struts/index.jsp

   *Note that here struts is the root-uri I used in default.servlet_engine

10) Gasp in amassment as all works.

EJB Env seem OK. If stomping on IBM XML Parser for Java project then use
JAXP1.1 as per Kyles instructions.

Hope this helps.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 14:06
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE


Now that's interesting.  Once you've done that does all of the WTE work?
Have you tested EJB's as well as servlets?

Kyle

Arjun Bhattacharya <[EMAIL PROTECTED]> on 05/02/2001
05:27:40 PM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE





Kyle,

FYI, I found a *dirty* way to import Xerces into VAJ. Import it into the
XML4J project and select yes to overwrite everything. That will work.

Regards,

Arjun

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Jon,

 There is no easy way to convert.  You could possibly write a program
to do it (maybe with Xalan) but the problem is that VAJ spreads over two
files what it takes web.xml only one to do

 Interesting -- I couldn't get Xerces to import into 3.5.3 without
conflicting with IBM XML4J.  I even tried deleting the duplicate classes
from XML4J, but that screwed it up...  Sun's Jaxp seemed to work well
enough for me...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 12:09:29 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

Sorry to bother you again. I take it from your reply that VisualAge 3.5.3
does not support web.xml files, is there an easy way to convert both ways ?
Also I found that importing the latest version of xerces worked for me.
Struts seems to use some of its classes as well as jaxp stuff (doesn't seem
to bother Websphere test env. Not sure about EJB env yet, I'll let you know
tomorrow). Off to catch the last of the sun.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 15:26
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Ahh -- good catch Jon.  I actually meant the default.servlet_engine file in
step 3.  That contains the document root and classpath.  You also have to
create a .webapp file (of course) to actually load the ActionServlet
appropriately...

Kyle

"Jon.Ridgway" <[E

RE: nested logic:iterate tags

2001-05-03 Thread tpeters

Richard,

What does the array look like? Can you post the logic for that array?

On Thu, 03 May 2001, Richard Murray wrote:

> 
> Hi, 
> 
> For anyone interested I managed fix my problem with the following:
> 
>  scope="page">
> 
> 
> 
> 
> 
> 
> 
> 
> Regards
> 
> Richard
> 
> -Original Message-
> From: Richard Murray [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 03, 2001 2:44 PM
> To: '[EMAIL PROTECTED]'
> Subject: nested logic:iterate tags
> 
> 
> Hi, 
> 
> I'm trying to generate a table of data from a 2 dimensional array of Strings
> called ( String[][] data ).  I am trying to use the struts tag
>  to loop through the data and generate the table.  As it is a
> 2 dimensional array I have nested the iterate statements as follows:
> 
>  scope="page">
> 
> 
> 
> 
> 
> 
> I get the following exception trying to run this:
> 
> org.apache.jasper.compiler.CompileException:
> F:\projects\fcutc\deploy\fcutc\list.jsp(40,1) Unable to convert a String to
> java.lang.Object for attribute collection 
> 
> I'm trying to use the id ("rows") from the first iterate statement as a
> variable in the second, however it seems it looks as though it is being
> treated as a string rather than a variable.  I thought the id held the
> current object in the iteration, which in my case is an array.
> 
> Hope someone can help.  I'm pretty new to struts ( and JSP ) so I may have
> done something obviously wrong.
> 
> Thanks.
>  
> Richard Murray 
> Software Engineer - Net Products Development 
> QSP
> OLAS House, Team Valley Trading Estate,
> 5th Avenue Business Park,
> Gateshead, Tyne & Wear NE11 0XA  
> Switchboard+44 (0) 191 402  
> Direct line   +44 (0) 191 402 3329 
> email  [EMAIL PROTECTED] 
> website   www.qspgroup.com 
> QSP - Enabling e-Finance 
> 
> 
> 
> 
> **
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager at [EMAIL PROTECTED]
> 
> This footnote also confirms that this email message has been swept by
> for the presence of computer viruses.
> 
> http://www.qspgroup.com
> **

Thomas Peters

Senior Software Engineer
Aidera Solutions

Cell: 603-566-5406
Voice Mail: 603-888-7700



Servlets, Beans, Struts, and Threading

2001-05-03 Thread Sean

Hello All,

This is a simular question I asked on the Tomcat mailing list and never got
a reply.  I was hoping someone could give me some good input on this topic
from this list.

If I have a process that needs to run within Tomcat&Struts to communicate
with a remote server, and that process needs it's own thread of execution,
what would be the best way to go about this in the Tomcat/Servlet container
world?  I am not sure if each Servlet has it's own thread of execution so I
wasn't sure if I should just subclass Servlet or HttpServlet.  I am not sure
of the ramifications of having a bean manage it's own threads and how that
would effect Tomcat in general.

Does anyone have any pointers, ideas, or suggestions on how they have done
this or would go about doing this nicely in Tomcat?  Would this be cross
container code or Tomcat specific?

Thanks,
Sean



RE: Struts and VisualAge 3.5.3 with WTE

2001-05-03 Thread Kyle Brown

Very good Jon.  One last question -- have you tested far enough to see if
Error messages display in JSP's?  I think you might have to set another
classpath on the servlet engine or the workspace classpath to get that to
work -- it's not working so far in my system...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/03/2001 10:14:15 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE



Hi All,

Just to let you know that the following seems to have worked fine.

1) Add WTE & EJB Env to workspace.
2) Create open editions of :

 - org.w3c.dom
 - org.xml.sax
 - org.xml.sax.helpers

 in the IBM XML Parser for Java project.

3) Create a new Xerces project and import all the src from the Xerces 1.3.1
build ie javax and org substrees.
4) Create a new webgroup in the default.servlet_engine file, eg :

   
   Struts
   $approot$/web
   $approot$/web
   /struts
   
   false


*Note that I have used a root-uri so I can keep things seperate.
*Note that both the doc root and classpath point to the same dir.

5) Copy the default_app dir to struts (or whatever you called your
webgroup)
6) Rename the servlets/default_app.webapp file to web/struts.webapp
7) Edit struts.webapp to include your action servlet, to provide JSP 1.1
and
struts taglib definitions eg :

  
  action
  Struts Action Servlet
  org.apache.struts.action.ActionServlet
  /*.do
  
application
ApplicationResources
  
  
config
/WEB-INF/struts-config.xml
  
  
debug
2
  
  
detail
2
  
  
validate
true
  
  true
  

  
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

8) Unpack the struts-blank.war file into struts/web
9) Kick of the WTE env and type http://localhost:8080/struts/index.jsp

   *Note that here struts is the root-uri I used in default.servlet_engine

10) Gasp in amassment as all works.

EJB Env seem OK. If stomping on IBM XML Parser for Java project then use
JAXP1.1 as per Kyles instructions.

Hope this helps.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 14:06
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE


Now that's interesting.  Once you've done that does all of the WTE work?
Have you tested EJB's as well as servlets?

Kyle

Arjun Bhattacharya <[EMAIL PROTECTED]> on 05/02/2001
05:27:40 PM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE





Kyle,

FYI, I found a *dirty* way to import Xerces into VAJ. Import it into the
XML4J project and select yes to overwrite everything. That will work.

Regards,

Arjun

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Jon,

 There is no easy way to convert.  You could possibly write a program
to do it (maybe with Xalan) but the problem is that VAJ spreads over two
files what it takes web.xml only one to do

 Interesting -- I couldn't get Xerces to import into 3.5.3 without
conflicting with IBM XML4J.  I even tried deleting the duplicate classes
from XML4J, but that screwed it up...  Sun's Jaxp seemed to work well
enough for me...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 12:09:29 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

Sorry to bother you again. I take it from your reply that VisualAge 3.5.3
does not support web.xml files, is there an easy way to convert both ways ?
Also I found that importing the latest version of xerces worked for me.
Struts seems to use some of its classes as well as jaxp stuff (doesn't seem
to bother Websphere test env. Not sure about EJB env yet, I'll let you know
tomorrow). Off to catch the last of the sun.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 15:26
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Ahh -- good catch Jon.  I actually meant the default.servlet_engine file in
step 3.  That contains the document root and classpath.  You also have to
create a .webapp file (of course) to actually load the ActionServlet
appropriately...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 09:45:01 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:   Kyle Brown/Raleigh/IBM@IBMUS
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

If you have time, could you elaborate on step three. The /servlets/.webapps file that I am familiar with in VAJ
makes no mention of doc roots and s

RE: Struts and VisualAge 3.5.3 with WTE

2001-05-03 Thread Jon.Ridgway

Hi All,

Just to let you know that the following seems to have worked fine.

1) Add WTE & EJB Env to workspace.
2) Create open editions of :

- org.w3c.dom
- org.xml.sax
- org.xml.sax.helpers

in the IBM XML Parser for Java project.

3) Create a new Xerces project and import all the src from the Xerces 1.3.1
build ie javax and org substrees.
4) Create a new webgroup in the default.servlet_engine file, eg :

   
   Struts
   $approot$/web
   $approot$/web
   /struts
   
   false


*Note that I have used a root-uri so I can keep things seperate.
*Note that both the doc root and classpath point to the same dir. 
 
5) Copy the default_app dir to struts (or whatever you called your webgroup)
6) Rename the servlets/default_app.webapp file to web/struts.webapp
7) Edit struts.webapp to include your action servlet, to provide JSP 1.1 and
struts taglib definitions eg :

  
  action
  Struts Action Servlet
  org.apache.struts.action.ActionServlet
  /*.do
  
application
ApplicationResources
  
  
config
/WEB-INF/struts-config.xml
  
  
debug
2
  
  
detail
2
  
  
validate
true
  
  true
  
 
  
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

8) Unpack the struts-blank.war file into struts/web
9) Kick of the WTE env and type http://localhost:8080/struts/index.jsp 

   *Note that here struts is the root-uri I used in default.servlet_engine

10) Gasp in amassment as all works.

EJB Env seem OK. If stomping on IBM XML Parser for Java project then use
JAXP1.1 as per Kyles instructions.

Hope this helps.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 14:06
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE


Now that's interesting.  Once you've done that does all of the WTE work?
Have you tested EJB's as well as servlets?

Kyle

Arjun Bhattacharya <[EMAIL PROTECTED]> on 05/02/2001
05:27:40 PM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE





Kyle,

FYI, I found a *dirty* way to import Xerces into VAJ. Import it into the
XML4J project and select yes to overwrite everything. That will work.

Regards,

Arjun

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Jon,

 There is no easy way to convert.  You could possibly write a program
to do it (maybe with Xalan) but the problem is that VAJ spreads over two
files what it takes web.xml only one to do

 Interesting -- I couldn't get Xerces to import into 3.5.3 without
conflicting with IBM XML4J.  I even tried deleting the duplicate classes
from XML4J, but that screwed it up...  Sun's Jaxp seemed to work well
enough for me...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 12:09:29 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

Sorry to bother you again. I take it from your reply that VisualAge 3.5.3
does not support web.xml files, is there an easy way to convert both ways ?
Also I found that importing the latest version of xerces worked for me.
Struts seems to use some of its classes as well as jaxp stuff (doesn't seem
to bother Websphere test env. Not sure about EJB env yet, I'll let you know
tomorrow). Off to catch the last of the sun.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 15:26
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Ahh -- good catch Jon.  I actually meant the default.servlet_engine file in
step 3.  That contains the document root and classpath.  You also have to
create a .webapp file (of course) to actually load the ActionServlet
appropriately...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 09:45:01 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:   Kyle Brown/Raleigh/IBM@IBMUS
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

If you have time, could you elaborate on step three. The /servlets/.webapps file that I am familiar with in VAJ
makes no mention of doc roots and servlet paths. Could you provide an
example file and/or point me to the docs.

Everything else is very clear and has been a great help. Many thanks

Jon Ridgway.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 13:57
To: [EMAIL PROTECTED]
Subject: Re: Struts and VisualAge 3.5.3 with WTE

One more modification to this set of instructions:

I didn't like my own solution about modifying the Dig

RE: nested logic:iterate tags

2001-05-03 Thread Richard Murray

Hi, 

For anyone interested I managed fix my problem with the following:










Regards

Richard

-Original Message-
From: Richard Murray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 2:44 PM
To: '[EMAIL PROTECTED]'
Subject: nested logic:iterate tags


Hi, 

I'm trying to generate a table of data from a 2 dimensional array of Strings
called ( String[][] data ).  I am trying to use the struts tag
 to loop through the data and generate the table.  As it is a
2 dimensional array I have nested the iterate statements as follows:








I get the following exception trying to run this:

org.apache.jasper.compiler.CompileException:
F:\projects\fcutc\deploy\fcutc\list.jsp(40,1) Unable to convert a String to
java.lang.Object for attribute collection 

I'm trying to use the id ("rows") from the first iterate statement as a
variable in the second, however it seems it looks as though it is being
treated as a string rather than a variable.  I thought the id held the
current object in the iteration, which in my case is an array.

Hope someone can help.  I'm pretty new to struts ( and JSP ) so I may have
done something obviously wrong.

Thanks.
 
Richard Murray 
Software Engineer - Net Products Development 
QSP
OLAS House, Team Valley Trading Estate,
5th Avenue Business Park,
Gateshead, Tyne & Wear NE11 0XA  
Switchboard+44 (0) 191 402  
Direct line   +44 (0) 191 402 3329 
email  [EMAIL PROTECTED] 
website   www.qspgroup.com 
QSP - Enabling e-Finance 




**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager at [EMAIL PROTECTED]

This footnote also confirms that this email message has been swept by
for the presence of computer viruses.

http://www.qspgroup.com
**



nested logic:iterate tags

2001-05-03 Thread Richard Murray

Hi, 

I'm trying to generate a table of data from a 2 dimensional array of Strings
called ( String[][] data ).  I am trying to use the struts tag
 to loop through the data and generate the table.  As it is a
2 dimensional array I have nested the iterate statements as follows:








I get the following exception trying to run this:

org.apache.jasper.compiler.CompileException:
F:\projects\fcutc\deploy\fcutc\list.jsp(40,1) Unable to convert a String to
java.lang.Object for attribute collection 

I'm trying to use the id ("rows") from the first iterate statement as a
variable in the second, however it seems it looks as though it is being
treated as a string rather than a variable.  I thought the id held the
current object in the iteration, which in my case is an array.

Hope someone can help.  I'm pretty new to struts ( and JSP ) so I may have
done something obviously wrong.

Thanks.
 
Richard Murray 
Software Engineer - Net Products Development 
QSP
OLAS House, Team Valley Trading Estate,
5th Avenue Business Park,
Gateshead, Tyne & Wear NE11 0XA  
Switchboard+44 (0) 191 402  
Direct line   +44 (0) 191 402 3329 
email  [EMAIL PROTECTED] 
website   www.qspgroup.com 
QSP - Enabling e-Finance 




**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager at [EMAIL PROTECTED]

This footnote also confirms that this email message has been swept by
for the presence of computer viruses.

http://www.qspgroup.com
**



Re: Help simple Iteration question?

2001-05-03 Thread Jean-Noel Ribette

Hi Alec,

If I understand what you want to do, you're trying to iterate over two collections at 
the same time, and not over nested
ones. That can't be done in Struts now.

However, you can modifiy the html code to do something like this:

















Hope this help,

Jean-Noel

- Original Message -
From: Alex Colic <[EMAIL PROTECTED]>
To: Struts <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 3:26 PM
Subject: Help simple Iteration question?


> Hi,
>
> I hope someone can help with the iterate tag. I have a question regarding
> nested iteration and struts.
>
> I have a request object, 'status', that has two properties, rows and cols.
> Each of these properties is an array of strings. I am trying to create an
> html table from these two properties.
>
> Obviously the below is wrong. I am trying to set-up the table so that column
> one is printed first than the value for row one, than a new row.
>
> e.g.
> col1, row1
> col2, row2
> col3, row3
>
> Any idea how I could structure this nested iteration?
>
> Any help is appreciated.
>
> Alex
>
> 
> 
>   
> 
>  
>   
>   
> 
>
> Regards
>
> Alex
>
>




RE: Struts and VisualAge 3.5.3 with WTE

2001-05-03 Thread Kyle Brown

Very nice Dan!  Now if we could only do this inside VAJ...

The interesting thing about this entire subject is that less than a week
ago I was explicitly and clearly told by Dave Ings, the VisualAge project
manager at IBM that there was NO WAY to make VAJ 3.5.3 work this way.  I
was told that there was no plan to support web.xml files at all. There
seems to be a significant difference between what the programmers have done
and what management knows about :)

Now, one more interesting piece of information.  Go to the root of the VAJ
3.5.3 Installation and open the "readme.html" file.  There is a section
(1.8) labeled "changing servlet engine mode to Full 2.2. compliance mode".
It says all you have to do is create a property file called
ivj.servlet.properties in the \ide\project_resources\IBM WebSphere Test
Environment\ directory that contains the following line:

com.ibm.websphere.servlet22.compliant = true

This might solve ALL of our problems with the silly XML file formats!  I'm
trying it now...

Kyle



"Dan Miser" <[EMAIL PROTECTED]> on 05/02/2001 03:37:26 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE



I'll have to try the latest version of Xerces. I didn't have any luck with
Xerces 1.22. I got things running using JAXP 1.01, but that seems rather
backwards to me. I'm also getting errors during JSP page compiles, but I
don't think that's related to the XML issue.

As for converting from web.xml to name.webapp, there's a file called
webapp.xsl that does the conversion for you. Here's the line I use from my
batch file:

java -cp c:/java/xalan.jar;c:/java/xerces.jar org.apache.xalan.xslt.Process
-IN %1 -xsl "c:/program files/ibm/visualage for
java/ide/project_resources/ibm websphere test
environment/properties/webapp.xsl" -OUT %2

Example usage:
cvtwebxml c:/dev/phone/web/web-inf/web.xml
c:/wte/phone/servlets/phone.webapp
--
Dan Miser
http://www.distribucon.com

>From: "Jon.Ridgway" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: RE: Struts and VisualAge 3.5.3 with WTE
>Date: Wed, 2 May 2001 17:09:29 +0100
>
>Hi Kyle,
>
>Sorry to bother you again. I take it from your reply that VisualAge 3.5.3
>does not support web.xml files, is there an easy way to convert both ways
?
>Also I found that importing the latest version of xerces worked for me.
>Struts seems to use some of its classes as well as jaxp stuff (doesn't
seem
>to bother Websphere test env. Not sure about EJB env yet, I'll let you
know
>tomorrow). Off to catch the last of the sun.


_
Get your FREE download of MSN Explorer at http://explorer.msn.com






Help simple Iteration question?

2001-05-03 Thread Alex Colic

Hi,

I hope someone can help with the iterate tag. I have a question regarding
nested iteration and struts.

I have a request object, 'status', that has two properties, rows and cols.
Each of these properties is an array of strings. I am trying to create an
html table from these two properties.

Obviously the below is wrong. I am trying to set-up the table so that column
one is printed first than the value for row one, than a new row.

e.g.
col1, row1
col2, row2
col3, row3

Any idea how I could structure this nested iteration?

Any help is appreciated.

Alex



  

 
  
  


Regards

Alex




RE: Struts and VisualAge 3.5.3 with WTE

2001-05-03 Thread Kyle Brown

Now that's interesting.  Once you've done that does all of the WTE work?
Have you tested EJB's as well as servlets?

Kyle

Arjun Bhattacharya <[EMAIL PROTECTED]> on 05/02/2001
05:27:40 PM

Please respond to [EMAIL PROTECTED]

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE





Kyle,

FYI, I found a *dirty* way to import Xerces into VAJ. Import it into the
XML4J project and select yes to overwrite everything. That will work.

Regards,

Arjun

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Jon,

 There is no easy way to convert.  You could possibly write a program
to do it (maybe with Xalan) but the problem is that VAJ spreads over two
files what it takes web.xml only one to do

 Interesting -- I couldn't get Xerces to import into 3.5.3 without
conflicting with IBM XML4J.  I even tried deleting the duplicate classes
from XML4J, but that screwed it up...  Sun's Jaxp seemed to work well
enough for me...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 12:09:29 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

Sorry to bother you again. I take it from your reply that VisualAge 3.5.3
does not support web.xml files, is there an easy way to convert both ways ?
Also I found that importing the latest version of xerces worked for me.
Struts seems to use some of its classes as well as jaxp stuff (doesn't seem
to bother Websphere test env. Not sure about EJB env yet, I'll let you know
tomorrow). Off to catch the last of the sun.

Jon.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 15:26
To: [EMAIL PROTECTED]
Subject: RE: Struts and VisualAge 3.5.3 with WTE

Ahh -- good catch Jon.  I actually meant the default.servlet_engine file in
step 3.  That contains the document root and classpath.  You also have to
create a .webapp file (of course) to actually load the ActionServlet
appropriately...

Kyle

"Jon.Ridgway" <[EMAIL PROTECTED]> on 05/02/2001 09:45:01 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:   Kyle Brown/Raleigh/IBM@IBMUS
Subject:  RE: Struts and VisualAge 3.5.3 with WTE


Hi Kyle,

If you have time, could you elaborate on step three. The /servlets/.webapps file that I am familiar with in VAJ
makes no mention of doc roots and servlet paths. Could you provide an
example file and/or point me to the docs.

Everything else is very clear and has been a great help. Many thanks

Jon Ridgway.

-Original Message-
From: Kyle Brown [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 13:57
To: [EMAIL PROTECTED]
Subject: Re: Struts and VisualAge 3.5.3 with WTE

One more modification to this set of instructions:

I didn't like my own solution about modifying the Digester and looked
around to see if I couldn't solve the problem in a way that didn't require
you to modify code.  It turns out this isn't too hard.  What you have to do
is import only those parts of JAXP that are required to meet the
requirements of Struts.  So, if you download the JAXP 1.01 from Sun's
website and import the entire contents of the jaxp.jar file and all of the
classes in parser.jar file EXCEPT those classes that start with org.w3c
into VisualAge for Java, then you will have an additional parser that will
correspond to the JAXP API and will work with Struts, but will not conflict
with the IBM XML4Java parser that the WTE requires.

By the way, this removes the need to modify the struts-config.dtd file.

Kyle Brown

-- Forwarded by Kyle Brown/Raleigh/IBM on 05/02/2001
08:58 AM ---

Kyle Brown
05/01/2001 07:25 AM

To:   [EMAIL PROTECTED]
cc:
From: Kyle Brown/Raleigh/IBM@IBMUS
Subject:  Re: Struts and VisualAge 3.5.3 with WTE  (Document link: Kyle
  Brown)

Yes, I've managed to do it.  Getting Struts to work under VAJ 3.5.3 was a
bit of a challenge to say the least.

 You have to be sure that you change the default.servlet_engine file to
point to your new web app and that you create a new directory under the
"default_host" subdirectory and put your new .webapp file there.  This is
what the documentation is trying to tell you to do.

 Other things you have to do to make this work:

 (1) You have to change the Digester to work with the older (pre JAXP)
SAXParser classes.  This turns out to amount to changing only four or five
methods in the class in fairly simple ways.  You have to do this because
you can't replace the IBM parser classes with Xerces since the WTE servlet
engine depends on the IBM parser API.

 (2) You have to add your Struts project to the Servlet Engine
classpath (from the WTE Control panel).

 (3) Your .webapp file has to have the document root and servlet path
point to the same directory to match the directory structur

very important please help guys....is it possible to update properties of an object in an iteration?

2001-05-03 Thread Dudley [EMAIL PROTECTED]

pleeaaasssee help

What i have is this...




.
.
.   



  


  


  


  


  



   








  

  


  


  


  


  
   




  


  

 

I want ot update the "state" property using the checkbox . does anyone have any suggestions?
Pleeeaaaeee!!




New error after upgrading to latest build

2001-05-03 Thread Brian Bowman








Hi,

 

I have a Struts application that has been up and running in production
for about 2 months now. I decided to upgrade to the latest nightly build to get
up to date. The old version was Feb 18 nightly build. Now my application and
the example application will no longer run. They both kick out the same error
below. I am not explicitly removing any attributes to cause this so I have no
idea where to look. Is it maybe a servlet engine version issue? We are
currently running Tomcat 3.2 embedded in JBoss2.0. I couldn’t find any other
messages about this error.

 

Any help would be greatly appreciated.

 

Thanks, Brian

 

javax.servlet.ServletException: cant remove Attributes from request scope    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:453)    at _0002flogon_0002ejsplogon_jsp_0._jspService(_0002flogon_0002ejsplogon_jsp_0.java:393)    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)    at org.apache.tomcat.core.Handler.service(Handler.java:286)    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:799)    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:745)    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:407)    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)    at java.lang.Thread.run(Thread.java:484)

 








Re: Newbie question about form beans

2001-05-03 Thread Jim Downing

Thanks. My apologies for not checking the archive well enough...

jim

- Original Message -
From: "Jean-Noel Ribette" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 1:08 PM
Subject: Re: Newbie question about form beans


> Hi Jim,
>
> There has been discussions about this on the mailing list. I suggest you
have a look at the archive at
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/. Look for
"EJB" and specially "communicating with EJB".
>
> Jean-Noel
>
> - Original Message -
> From: Jim Downing <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 03, 2001 1:42 PM
> Subject: Newbie question about form beans
>
>
> > Hi,
> > I'm new to struts, we're planning to use it to access an EJB tier.  I'm
> > bothered by what seems to be an inefficient and difficult to maintain
> > pattern were using as a consequence:
> >
> > A large portion of what our app does is pretty standard - getting a
record
> > out of a database, presenting it to the user in form(s) to be edited,
and
> > then saving the changes back to the database.  The structure can be
viewed
> > something like this:- the entity EJB has a set of attributes, with a set
of
> > accessors, and some other stuff.  To reduce network traffic we use
> > ValueObjects, which have the same set of attributes and accessors. This
will
> > get passed into the struts application, where it interacts with a form
bean
> > which has, oh look!: the same set of attributes and accessors, and some
> > methods to do other stuff.
> >
> > Surely it should be possible to define a single bean for attributes and
> > accessors, and wrap it with the functionality it needs at different
stages.
> > I can see my way through doing this in the EJB tier, but not when it
comes
> > to struts - since my form bean already extends ActionForm and multiple
> > inheritance is unavailable.
> >
> > Please somebody telling I'm totally missing the trick here!
> > jim
> >
> >
>
>




RE: Internationalised strings and scriptlets

2001-05-03 Thread Nanduri, Amarnath

OhBoy. I would never do this. The main reason is that if ou are
internationalizing your app, you never know what the next language you are
going to support in your application. So if you wrote for some particualr
languages and you want to include an other language you need to rewrite the
whole app. I would suggest that you use a keycode (for every kind of message
out there). This keycode is mapped to a table in a database. Then redesign
your app to do something with it.

cheers,
Amar..

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 4:45 AM
To: [EMAIL PROTECTED]
Subject: Internationalised strings and scriptlets



Is it possible to access internationalised messages from inside scriptlets? 

For example consider a dropdown list populated with text strings produced by
a 
 tag.  I then want to do some processing based on a user

selection:

 <% 
 String selectedItem = request.getParameter( "dropDown" );
 String internationalisedString = ???
 if ( selectedItem.equals( internationalisedString ) ) 
 {
// do something
 } 
 %>

How do I get a value for internationalisedString?

Thanks,
Sam



--
This message was sent using http://uk2.net
NEWS - CHEAPEST DEDICATED SERVERS IN THE WORLD -  25/month
FREE UK DIAL 0845 609 1370 - username uk2: - password: uk2
UK's FREE Domains, FREE Dialup, FREE Webdesign, FREE email




RE: Jsp not displayed on first time.

2001-05-03 Thread Nanduri, Amarnath

Yeah. I get the same problem with Weblogic 6. I think it is a bug with
WebLogic hot deploy mechanism. You need to stop and start weblogic again for
this problem to disappear. 

cheers,
Amar..

-Original Message-
From: Tewathia, Atul [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 03, 2001 2:43 AM
To: [EMAIL PROTECTED]
Subject: Jsp not displayed on first time.




Whenever I start my application after redeploy I get the error given below.
But on a subsequent refresh of the page the browser displays the jsp on the
screen exactly fine. This happens for every jsp in my application. Does any
body know why this happens ?

  
<[WebAppServletContext(786280
,withdraw)] Servlet failed with Exception
java.lang.ClassCastException: org.apache.struts.action.ActionMappings
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:696)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:441)
at jsp_servlet._contactinfo._jspService(_contactinfo.java:90)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:208)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:244)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>



NoSuchMethodError when running examples

2001-05-03 Thread Lim Wee Lit

Hi,

I've just installed struts on tomcat 3.2.1. I could start tomcat without
any problems but when I tried browsing to struts-example, I get the
following error:


Internal Servlet Error:

javax.servlet.ServletException
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

Root cause: 
java.lang.NoSuchMethodError
at
org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:524)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:432)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:385)
at
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:233)
at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:706)
at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
=

I did some research and could isolate the the taglibs are cause of the
problems:

==
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
==

I even set the trace for jasper to DEBUG but the logs did not reveal
anything useful:

==
2001-05-03 07:45:56 - JspEngine --> /index.jsp
2001-05-03 07:45:56 -ServletPath: /index.jsp
2001-05-03 07:45:56 -   PathInfo: null
2001-05-03 07:45:56 -   RealPath:
/projects/www/webapps/struts-example/i
ndex.jsp
2001-05-03 07:45:56 - RequestURI: /struts-example/index.jsp
2001-05-03 07:45:56 -QueryString: null
2001-05-03 07:45:56 - Request Params:
2001-05-03 07:45:56 - Classpath according to the Servlet Engine is:
/projects/ww
w/webapps/struts-example/WEB-INF/classes:/projects/www/webapps/struts-example/WE
B-INF/lib/struts.jar
2001-05-03 07:45:56 - Package name is: [default package]
2001-05-03 07:45:56 - Class file name is:
/opt/tomcat-3.2.1/work/localhost_8080%
2Fstruts-example/_0002findex_0002ejspindex.c

Re: Newbie question about form beans

2001-05-03 Thread Jean-Noel Ribette

Hi Jim,

There has been discussions about this on the mailing list. I suggest you have a look 
at the archive at
http://www.mail-archive.com/struts-user%40jakarta.apache.org/. Look for "EJB" and 
specially "communicating with EJB".

Jean-Noel

- Original Message -
From: Jim Downing <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 1:42 PM
Subject: Newbie question about form beans


> Hi,
> I'm new to struts, we're planning to use it to access an EJB tier.  I'm
> bothered by what seems to be an inefficient and difficult to maintain
> pattern were using as a consequence:
>
> A large portion of what our app does is pretty standard - getting a record
> out of a database, presenting it to the user in form(s) to be edited, and
> then saving the changes back to the database.  The structure can be viewed
> something like this:- the entity EJB has a set of attributes, with a set of
> accessors, and some other stuff.  To reduce network traffic we use
> ValueObjects, which have the same set of attributes and accessors. This will
> get passed into the struts application, where it interacts with a form bean
> which has, oh look!: the same set of attributes and accessors, and some
> methods to do other stuff.
>
> Surely it should be possible to define a single bean for attributes and
> accessors, and wrap it with the functionality it needs at different stages.
> I can see my way through doing this in the EJB tier, but not when it comes
> to struts - since my form bean already extends ActionForm and multiple
> inheritance is unavailable.
>
> Please somebody telling I'm totally missing the trick here!
> jim
>
>




Newbie question about form beans

2001-05-03 Thread Jim Downing

Hi,
I'm new to struts, we're planning to use it to access an EJB tier.  I'm
bothered by what seems to be an inefficient and difficult to maintain
pattern were using as a consequence:

A large portion of what our app does is pretty standard - getting a record
out of a database, presenting it to the user in form(s) to be edited, and
then saving the changes back to the database.  The structure can be viewed
something like this:- the entity EJB has a set of attributes, with a set of
accessors, and some other stuff.  To reduce network traffic we use
ValueObjects, which have the same set of attributes and accessors. This will
get passed into the struts application, where it interacts with a form bean
which has, oh look!: the same set of attributes and accessors, and some
methods to do other stuff.

Surely it should be possible to define a single bean for attributes and
accessors, and wrap it with the functionality it needs at different stages.
I can see my way through doing this in the EJB tier, but not when it comes
to struts - since my form bean already extends ActionForm and multiple
inheritance is unavailable.

Please somebody telling I'm totally missing the trick here!
jim




Re: File uploads and Struts

2001-05-03 Thread Tharwat Abdul-Malik

There is an pretty good example in the source directory src/upload/* or
webapps/struts-upload.war

- Original Message -
From: "Graeme Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 2:15 AM
Subject: File uploads and Struts


> Anyone here know where I can find a tutorial or explanation on using the
>  tag for file uploads?  The struts documentation is fairly thin
> on this area.
>
> Regards,
>
> Graeme.
>




Re: ActionForward matching url-pattern

2001-05-03 Thread Chris Butler

my guess is that this can be avoided with web.xml.
in web.xml you set the patterns which do URL/servlet matching...

can you provide more details on the forward called
and your pattern matching in web.xml?

c

At 04:00 PM 5/2/2001 -0400, Mindaugas Idzelis wrote:
>When you create a new ActionForward, why does it match the location against
>the url-pattern? I would like to forword to an absolute location without
>matching it against the url-pattern. Any way to do this? Thank you.
>
>--Min Idzelis




RE: New to struts

2001-05-03 Thread Manabendra Sarkar

Hi,
u copy the struts-example.war to tomcat\webapps and then type the url
localhost:8080\struts-example. u should get a pge which is the home page for
the 
example application that comes with the struts

thanx

manabendra

> -Original Message-
> From: Geoffrey Van Nuffelen [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, May 03, 2001 3:25 PM
> To:   Struts-User (E-Mail)
> Subject:  New to struts
> 
> Hi,
> 
> I am new to struts.
> I did the download of the release of strust (1.0b1).
> 
> I use winzip, and now I have a directories structure. 
> 
> But where to begin ?  What I have to do to create a new application ?
> 
> Thanks 
> geoffrey...
> 



New to struts

2001-05-03 Thread Geoffrey Van Nuffelen

Hi,

I am new to struts.
I did the download of the release of strust (1.0b1).

I use winzip, and now I have a directories structure. 

But where to begin ?  What I have to do to create a new application ?

Thanks 
geoffrey...





classloader problem using WLS6.0

2001-05-03 Thread Glania, Damian

Hi,
if I deploy my EJB-applikation using struts (struts.jar is stored in the
.war-file in WEB-INF/lib) as .ear-file (on WLS6.0 SP1 running on NT4.0 or
Win2000) I get exceptions like:
java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLo
ader.java:280)
at
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.
java:147)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
org.apache.struts.action.ActionServlet.processActionForm(ActionServlet.java:
1667)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1534)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:489)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
(The classloader seems to find the ActionServlet but not the ActionForm)
I read all posting concerning "classloader" here and in the WL-news-groups
and tried some sugestions (including placing struts.jar in the CLASSPATH in
startWeblogic-script and removing1
from web.xml ) but nothing helps. 

If  I expand the .war-file by myself to appropriate directory structure all
works perfectly well.

Thanks,
  Damian




Internationalised strings and scriptlets

2001-05-03 Thread 3zero3


Is it possible to access internationalised messages from inside scriptlets? 

For example consider a dropdown list populated with text strings produced by a 
 tag.  I then want to do some processing based on a user 
selection:

 <% 
 String selectedItem = request.getParameter( "dropDown" );
 String internationalisedString = ???
 if ( selectedItem.equals( internationalisedString ) ) 
 {
// do something
 } 
 %>

How do I get a value for internationalisedString?

Thanks,
Sam



--
This message was sent using http://uk2.net
NEWS - CHEAPEST DEDICATED SERVERS IN THE WORLD -  25/month
FREE UK DIAL 0845 609 1370 - username uk2: - password: uk2
UK's FREE Domains, FREE Dialup, FREE Webdesign, FREE email





RE: GenericDataSource Reconnection

2001-05-03 Thread Alan Inser

Andre,

Though PoolMan is now version 2.0.1, your code could be interesting. If you
find it again, thanks to put it on this list or send it directly to me at
[EMAIL PROTECTED]

On the other hand, I do not understand why you had to stuck the poolman
instance in the init method, maybe it was related to version 4.1. In the 2.0
Poolman user guide, there is a little section on Struts that tells how to
get the DataSource instance from a static method of PoolMan:
javax.sql.DataSource ds = PoolMan.findDataSource(dbname);

Thanks.
Adriano Labate

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 5:49 PM
To: [EMAIL PROTECTED]
Subject: RE: GenericDataSource Reconnection


i was using PoolMan at first.  i subclassed ActionServlet and just stuck my
poolman instance in one of the init methods.  it worked fine.  i'm just
using
the built in struts pool now because i'm lazy.

if i remember correctly, poolman didn't check each connection before handing
it
out either.  but what it did do was refresh the connections at a
configurable
interval.  i really wanted a check in there to make sure the connection
wasn't
stagnant, so i overrode the validate method in JDBCPool to call a class that
implemented a simple interface called ConnectionTester.   you would could
associate a ConnectionTester class with each db connection in the config
file,
and by default you would just use a dummy ConnectionTester that always
returned
true.  My OracleConnectionTester class just did a "select sysdate from dual"
and
returned false if a SQLException was thrown.

i believe i still have this code lying around if someone wants to take a
look.
it was in PoolMan1.4.1.

ab

>  From:  [EMAIL PROTECTED]
> Date:   05/02/2001 09:44 AM
>Please respond to struts-user
>
>
>Hi,
>
>>The difficulty is to find a pretty efficient SQL statement which you want
>to
>>execute each time before returning a connection.
>> --- Matthias
>
>As it was already suggested in this forum, the query "select dummy from
>dual" could work well for a Oracle database. For other databases there
would
>be specific query strings like the one for Oracle. It could be a property
of
>the application.
>
>Is anyone working with PoolMan connection pool instead of the one available
>in Struts? Thanks.
>
>Adriano Labate
>
>
>-Original Message-
>From: Matthias Bauer [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, May 02, 2001 3:59 PM
>To: [EMAIL PROTECTED]
>Subject: Re: GenericDataSource Reconnection
>
>
>
>