Collections in ActionForm

2004-10-18 Thread Ivan Vasquez
Is is OK to use Collections (or sets, lists, maps for that matter)
inside an ActionForm? We are trying to represent fairly complex
multiple-choice items in our forms.

Ivan

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



RE: Collections in ActionForm

2004-10-18 Thread Ivan Vasquez
Have you ever deployed them in a clustered environment? Yes, all
underlying objects are serializable and session replication is properly
configured.

-Original Message-
From: Michael McGrady [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 18, 2004 10:06 AM
To: Struts Users Mailing List
Subject: Re: Collections in ActionForm

Ivan Vasquez wrote:

Is is OK to use Collections (or sets, lists, maps for that matter)
inside an ActionForm? We are trying to represent fairly complex
multiple-choice items in our forms.

Ivan

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




  

Yes.  I recommend you check out Ted Husted's book on struts if you need 
to know more.

Michael McGrady


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


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



Dissapearing items in cluster

2004-10-14 Thread Ivan Vasquez
Our application has a form with a multiple-selection item. We implemented it by 
including a List in the ActionForm. Each item in the List is a plain-old object, added 
from the corresponding Action.

When this application runs in a 2-node cluster, items in the List dissappear at 
random. Session replication in the cluster is working properly. When either server is 
put down, the application works normally.

Is it OK to use Lists in ActionForms as described? 
Has anybody seen this behavior in a cluster?

Environment:
Tomcat 5.0.28 (cluster)
Struts 1.2.4

Ivan

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

RE: Where Is the Best Place To Store Files?

2004-10-13 Thread Ivan Vasquez
Unless the tomcat server(s) has fileserver capabilities, you can create
an NFS mount to a fileserver share and have your code create Files
there.

Better yet (IMO), store them in the database as BLOBs so all your data
lives at a single location. The decision depends on what use is given to
those files (are they likely to be modified? ready only? etc)

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 13, 2004 11:30 AM
To: [EMAIL PROTECTED]
Subject: Where Is the Best Place To Store Files?

I am using the Struts to build a web application.  I
am going to store some files (the files can be .doc,
.txt, .pdf, .jpg, whatever) on the server; e.g.
somewhere in my web application.

Where is the proper and best place to store files? 
$TOMCAT\webapps\MyApplication\

Thanks for suggestions.



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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


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



File upload but outside session

2004-10-01 Thread Ivan Vasquez
Hi,

Our users need to upload a file as part of a form submission. First we
used struts-upload FormFile as one of the fields of the ActionForm. It
worked well until we tested it in a Tomcat cluster. 

Since the form is session-scoped, the FormFile has to be serialized for
sessions to be replicated. However we get a NotSerializableException for


org.apache.commons.fileupload.DeferredFileOutputStream

So now I'm trying to keep the file upload outside the session. I tried
using commons fileupload from my Action, but when I parse the
HttpServletRequest I get no items!

Any ideas?
Thank you.

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



How to prevent directory listing?

2004-09-02 Thread Ivan Vasquez
Is it possible to prevent a particular Struts webapp from displaying
directory listings? That is, global /conf/web.xml has its DefaultServlet
with listings set to true, thus enabling dir listing for all apps. Can I
then prevent a particular Struts webapp from doing so by setting
something in the local web.xml?

Thank you. 
Ivan.

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



RE: How to prevent directory listing?

2004-09-02 Thread Ivan Vasquez
Thanks Jason,

I already did, but it seems to override ActionServlet and none of my
pages work. I also tried by changing the startup order to 3 (after
ActionServlet), but still no luck!

Ivan.

-Original Message-
From: Jason Lea [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 6:40 PM
To: Struts Users Mailing List
Subject: Re: How to prevent directory listing?

I think (haven't tried this myself) you can override it in your own 
application's web.xml

eg add this to your web.xml in the appropriate place

servlet
servlet-namedefault/servlet-name
servlet-class
  org.apache.catalina.servlets.DefaultServlet
/servlet-class
init-param
param-namedebug/param-name
param-value0/param-value
/init-param
init-param
param-namelistings/param-name
param-valuefalse/param-value
/init-param
load-on-startup1/load-on-startup
/servlet

Ivan Vasquez wrote:

Is it possible to prevent a particular Struts webapp from displaying
directory listings? That is, global /conf/web.xml has its
DefaultServlet
with listings set to true, thus enabling dir listing for all apps. Can
I
then prevent a particular Struts webapp from doing so by setting
something in the local web.xml?

Thank you. 
Ivan.

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


  



-- 
Jason Lea



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


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



Classloading problem

2004-08-31 Thread Ivan Vasquez
We have Tomcat 5.0.16 and were incorrectly placing common jars (such as
JDBC drivers) in /common/lib. 

Now we just moved them to /shared/lib (for truly common stuff) and
WEB-INF/lib, but now all applications complain giving a
java.lang.ClassNotFoundException, just like if things weren't in
Tomcat's classpath anymore. Apps and Tomcat restarts have been done
several times.

Is there anything in web.xml, server.xml, etc that needs to be set? What
are we possibly missing? Tomcat docs are pretty straightforward about it
and everything seems right.

Once again, thanks in advance.
Ivan.

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



RE: Classloading problem

2004-08-31 Thread Ivan Vasquez
Sure, in common/lib it works well. But from Tomcat docs:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html

The following rules cover about 95% of the decisions that application
developers and deployers must make about where to place class and
resource files to make them available to web applications:

* For classes and resources specific to a particular web
application, place unpacked classes and resources under /WEB-INF/classes
of your web application archive, or place JAR files containing those
classes and resources under /WEB-INF/lib of your web application
archive.
* For classes and resources that must be shared across all web
applications, place unpacked classes and resources under
$CATALINA_BASE/shared/classes, or place JAR files containing those
classes and resources under $CATALINA_BASE/shared/lib.

--Then goes on...---

Common - This class loader contains additional classes that are made
visible to both Tomcat internal classes and to all web applications.
Normally, application classes should NOT  be placed here. All unpacked
classes and resources in $CATALINA_HOME/common/classes, as well as
classes and resources in JAR files under the
$CATALINA_HOME/commons/endorsed and $CATALINA_HOME/common/lib
directories, are made visible through this class loader.

Shared - This class loader is the place to put classes and resources
that you wish to share across ALL  web applications (unless Tomcat
internal classes also need access, in which case you should put them in
the Common  class loader instead). All unpacked classes and resources in
$CATALINA_BASE/shared/classes, as well as classes and resources in JAR
files under $CATALINA_BASE/shared/lib, are made visible through this
class loader.



In our case we want to share jars common to all applications, but none
of them are required by Tomcat.

Ivan.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 12:52 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

I have been using 5.0.27, putting my JDBC drivers in common/lib, and my 
struts jars in WEB-INF/lib of each application, and haven't had any 
problems. Why do you say incorrectly?

Erik


Ivan Vasquez wrote:

We have Tomcat 5.0.16 and were incorrectly placing common jars (such as
JDBC drivers) in /common/lib. 

Now we just moved them to /shared/lib (for truly common stuff) and
WEB-INF/lib, but now all applications complain giving a
java.lang.ClassNotFoundException, just like if things weren't in
Tomcat's classpath anymore. Apps and Tomcat restarts have been done
several times.

Is there anything in web.xml, server.xml, etc that needs to be set?
What
are we possibly missing? Tomcat docs are pretty straightforward about
it
and everything seems right.

Once again, thanks in advance.
Ivan.

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


  


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


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



RE: Classloading problem

2004-08-31 Thread Ivan Vasquez
Thanks for your answer, that explains it all. 

Yes, we were trying to clean server.xml and to avoid server restarts
every time something changes (e.g. db connection pool info). Context was
directly cut and pasted into the local META-INF/context.xml. 

But Tomcat gets it only when you create a .war and then deploy it. If
you have a deployed application, create META-INF/context.xml and delete
its context entry from server.xml, the context is lost. The only way to
make the app work again is to place context.xml in
conf/Catalina/localhost/ (that must be part of Tomcat's auto deployment
feature).

Hope that helps, let me know if that doesn't work for you.
Thanks!
Ivan.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 3:10 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

Also, since you appear to be trying to follow the documenation, have you

ever gotten a Context XML file placed within the META-INF directory of 
your web app to work? I can't get this to work (I have gotten them to 
work when placed in the conf directory -- though I had to learn the hard

way to take write permissions away from Tomcat after it very rudely 
deleted one). The documentation is confusing, and the example web app 
mysteriously does not include a Context XML file at all, despite that 
pretty much any serious web app is going to need one (unless you declare

everything in server.xml).

If you have an example of this working, please share it with me.

Erik


Ivan Vasquez wrote:

Sure, in common/lib it works well. But from Tomcat docs:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html

The following rules cover about 95% of the decisions that application
developers and deployers must make about where to place class and
resource files to make them available to web applications:

* For classes and resources specific to a particular web
application, place unpacked classes and resources under
/WEB-INF/classes
of your web application archive, or place JAR files containing those
classes and resources under /WEB-INF/lib of your web application
archive.
* For classes and resources that must be shared across all web
applications, place unpacked classes and resources under
$CATALINA_BASE/shared/classes, or place JAR files containing those
classes and resources under $CATALINA_BASE/shared/lib.

--Then goes on...---

Common - This class loader contains additional classes that are made
visible to both Tomcat internal classes and to all web applications.
Normally, application classes should NOT  be placed here. All unpacked
classes and resources in $CATALINA_HOME/common/classes, as well as
classes and resources in JAR files under the
$CATALINA_HOME/commons/endorsed and $CATALINA_HOME/common/lib
directories, are made visible through this class loader.

Shared - This class loader is the place to put classes and resources
that you wish to share across ALL  web applications (unless Tomcat
internal classes also need access, in which case you should put them in
the Common  class loader instead). All unpacked classes and resources
in
$CATALINA_BASE/shared/classes, as well as classes and resources in JAR
files under $CATALINA_BASE/shared/lib, are made visible through this
class loader.



In our case we want to share jars common to all applications, but none
of them are required by Tomcat.

Ivan.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 12:52 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

I have been using 5.0.27, putting my JDBC drivers in common/lib, and my

struts jars in WEB-INF/lib of each application, and haven't had any 
problems. Why do you say incorrectly?

Erik


Ivan Vasquez wrote:

  

We have Tomcat 5.0.16 and were incorrectly placing common jars (such
as
JDBC drivers) in /common/lib. 

Now we just moved them to /shared/lib (for truly common stuff) and
WEB-INF/lib, but now all applications complain giving a
java.lang.ClassNotFoundException, just like if things weren't in
Tomcat's classpath anymore. Apps and Tomcat restarts have been done
several times.

Is there anything in web.xml, server.xml, etc that needs to be set?


What
  

are we possibly missing? Tomcat docs are pretty straightforward about


it
  

and everything seems right.

Once again, thanks in advance.
Ivan.

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


 




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


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

RE: Classloading problem

2004-08-31 Thread Ivan Vasquez
 it with me.

Erik


Ivan Vasquez wrote:

   



Sure, in common/lib it works well. But from Tomcat docs:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.
html

The following rules cover about 95% of the decisions that
application
developers and deployers must make about where to place class and
resource files to make them available to web applications:

  * For classes and resources specific to a particular web
application, place unpacked classes and resources under
/WEB-INF/classes
of your web application archive, or place JAR files containing
those
classes and resources under /WEB-INF/lib of your web application
archive.
  * For classes and resources that must be shared across all
web
applications, place unpacked classes and resources under
$CATALINA_BASE/shared/classes, or place JAR files containing those
classes and resources under $CATALINA_BASE/shared/lib.

--Then goes on...---

Common - This class loader contains additional classes that are
made
visible to both Tomcat internal classes and to all web
applications.
Normally, application classes should NOT  be placed here. All
unpacked
classes and resources in $CATALINA_HOME/common/classes, as well as
classes and resources in JAR files under the
$CATALINA_HOME/commons/endorsed and $CATALINA_HOME/common/lib
directories, are made visible through this class loader.

Shared - This class loader is the place to put classes and
resources
that you wish to share across ALL  web applications (unless Tomcat
internal classes also need access, in which case you should put
them in
the Common  class loader instead). All unpacked classes and
resources in
$CATALINA_BASE/shared/classes, as well as classes and resources in
JAR
files under $CATALINA_BASE/shared/lib, are made visible through
this
class loader.



In our case we want to share jars common to all applications, but
none
of them are required by Tomcat.

Ivan.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 12:52 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

I have been using 5.0.27, putting my JDBC drivers in common/lib,
and my 
struts jars in WEB-INF/lib of each application, and haven't had any

problems. Why do you say incorrectly?

Erik


Ivan Vasquez wrote:



 

  

We have Tomcat 5.0.16 and were incorrectly placing common jars
(such as
JDBC drivers) in /common/lib. 

Now we just moved them to /shared/lib (for truly common stuff) and
WEB-INF/lib, but now all applications complain giving a
java.lang.ClassNotFoundException, just like if things weren't in
Tomcat's classpath anymore. Apps and Tomcat restarts have been
done
several times.

Is there anything in web.xml, server.xml, etc that needs to be
set?
  

   



What


 

  

are we possibly missing? Tomcat docs are pretty straightforward
about
  

   



it


 

  

and everything seems right.

Once again, thanks in advance.
Ivan.



  


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


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



RE: Classloading problem

2004-08-31 Thread Ivan Vasquez
Yes. And I just deployed a war with my config to another server to
double-check.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 5:17 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

[eweber]$ jar tf $TOMCAT_HOME/webapps/Foo.war

. . .

META-INF/context.xml
META-INF/MANIFEST.MF

. . .

Right?

Erik


Ivan Vasquez wrote:

Erik, here goes my context.xml, Tomcat renames it the same as the app's
directory. I assume your Tomcat has autodeploy enabled.

!--By Ivan: WAR-contained Application Context--
!--Path defines the directory name created when war is deployed--
Context path=/nahrgisdev docBase=nahrgisdev debug=5
reloadable=true crossContext=true
   !--Development--
   Resource name=jdbc/orcl auth=Container
type=javax.sql.DataSource/
   
   ResourceParams name=jdbc/orcl
   parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
  namedriverClassName/name
  valueoracle.jdbc.driver.OracleDriver/value
   /parameter
   !--By Ivan: Parameters for RAC connection load balancing--
   parameter
  nameurl/name
   
valuejdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOC
O
L=TCP)(HOST=node1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=node2)(PORT=
1
521))(CONNECT_DATA=(SERVICE_NAME=orcl)))/value
   /parameter
   parameter
  nameusername/name
  value*/value
   /parameter
   parameter
  namepassword/name
  value*/value
   /parameter
   parameter
  namemaxActive/name
  value10/value
   /parameter
   parameter
  namemaxIdle/name
  value10/value
   /parameter
   parameter
  namemaxWait/name
  value-1/value
   /parameter
   parameter
  nameremoveAbandoned/name
  valuetrue/value
   /parameter
   parameter
  nameremoveAbandonedTimeout/name
  value60/value
   /parameter
   parameter
  namelogAbandoned/name
  valuetrue/value
   /parameter
   /ResourceParams
/Context

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 4:30 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

I have tried this repeatedly. I am using the same Foo.xml file that
does

work when placed in conf/Catalina/localhost/. I have tried with and 
without the path and docBase attributes to the Context element. I have 
renamed the file to context.xml and it is in META-INF in my war file. I

have also tried putting Foo.xml or context.xml within a 
META-INF/context.xml/ *directory* as the documentation suggests.

DBCP throws an Exception on startup that it cannot create a JDBC driver

of class '' for connect URL 'null'. I am supposing that the context
file

is never loaded. Also Tomcat creates a Foo.xml directory inside of 
conf/Catalina/localhost with nothing in it. If I try restarting the 
server, I also get a FileNotFoundException on Foo.xml, saying it is a 
directory (good grief). I have tried hot deploy and deploying via the 
manager web app as well.

I basically observed the same behavior that Ivan described.

I would love to see that example if you can find it.

Erik


Kris Schneider wrote:

  

Hang on, my bad - it should be /META-INF/context.xml. So, rename


Foo.xml to be
  

context.xml and place it in *META-INF*.

Quoting Erik Weber [EMAIL PROTECTED]:

 



Kris, this is from context.html in the Tomcat 5 docs:*

Please note that for tomcat 5.x, unlike tomcat 4.x, it is NOT 
recommended to place Context elements directly in the server.xml 
file.* Instead, put them in the META-INF/context.xml directory of
your
  


  

WAR file or the conf directory as described above.

So here I am, stupidly trying to put my Foo.xml file within 
/META-INF/context.xml/ (and various variations of that) of my web
app.

So should I rename Foo.xml to context.xml (I ask because in the conf 
directory I have been naming it Foo.xml, not context.xml), and put it
  

in 
  

*WEB-INF*?

Could you show me where you found how to do this in the docs? Am I
  

just 
  

completely misreading the above sentence?

Thanks for your help,
Erik


Kris Schneider wrote:

   

  

Can you provide some more detail on the problems you're running into


with
  

 



using
   

  

WEB-INF? I've got a simple one lying around here somewhere...

WEB-INF/context.xml:

Context path=/init
  Loader delegate=false/
  Manager pathname=/
/Context

Seems to work fine with TC 5...

Quoting Erik Weber [EMAIL PROTECTED]:



 



Also, since you appear to be trying to follow the documenation,
have
  

you 
  

ever gotten a Context XML file placed within the META-INF directory
  

of 
  

your web app to work? I can't get

RE: Classloading problem

2004-08-31 Thread Ivan Vasquez
Also, the name under which it gets to conf/Catalina/localhost is
app_name_folder.xml

Inside, path and docBase are untouched. No war extensions anywhere.

BTW, these are tomcat 5.0.16, just in case.

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 5:17 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

[eweber]$ jar tf $TOMCAT_HOME/webapps/Foo.war

. . .

META-INF/context.xml
META-INF/MANIFEST.MF

. . .

Right?

Erik


Ivan Vasquez wrote:

Erik, here goes my context.xml, Tomcat renames it the same as the app's
directory. I assume your Tomcat has autodeploy enabled.

!--By Ivan: WAR-contained Application Context--
!--Path defines the directory name created when war is deployed--
Context path=/nahrgisdev docBase=nahrgisdev debug=5
reloadable=true crossContext=true
   !--Development--
   Resource name=jdbc/orcl auth=Container
type=javax.sql.DataSource/
   
   ResourceParams name=jdbc/orcl
   parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
  namedriverClassName/name
  valueoracle.jdbc.driver.OracleDriver/value
   /parameter
   !--By Ivan: Parameters for RAC connection load balancing--
   parameter
  nameurl/name
   
valuejdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOC
O
L=TCP)(HOST=node1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=node2)(PORT=
1
521))(CONNECT_DATA=(SERVICE_NAME=orcl)))/value
   /parameter
   parameter
  nameusername/name
  value*/value
   /parameter
   parameter
  namepassword/name
  value*/value
   /parameter
   parameter
  namemaxActive/name
  value10/value
   /parameter
   parameter
  namemaxIdle/name
  value10/value
   /parameter
   parameter
  namemaxWait/name
  value-1/value
   /parameter
   parameter
  nameremoveAbandoned/name
  valuetrue/value
   /parameter
   parameter
  nameremoveAbandonedTimeout/name
  value60/value
   /parameter
   parameter
  namelogAbandoned/name
  valuetrue/value
   /parameter
   /ResourceParams
/Context

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 4:30 PM
To: Struts Users Mailing List
Subject: Re: Classloading problem

I have tried this repeatedly. I am using the same Foo.xml file that
does

work when placed in conf/Catalina/localhost/. I have tried with and 
without the path and docBase attributes to the Context element. I have 
renamed the file to context.xml and it is in META-INF in my war file. I

have also tried putting Foo.xml or context.xml within a 
META-INF/context.xml/ *directory* as the documentation suggests.

DBCP throws an Exception on startup that it cannot create a JDBC driver

of class '' for connect URL 'null'. I am supposing that the context
file

is never loaded. Also Tomcat creates a Foo.xml directory inside of 
conf/Catalina/localhost with nothing in it. If I try restarting the 
server, I also get a FileNotFoundException on Foo.xml, saying it is a 
directory (good grief). I have tried hot deploy and deploying via the 
manager web app as well.

I basically observed the same behavior that Ivan described.

I would love to see that example if you can find it.

Erik


Kris Schneider wrote:

  

Hang on, my bad - it should be /META-INF/context.xml. So, rename


Foo.xml to be
  

context.xml and place it in *META-INF*.

Quoting Erik Weber [EMAIL PROTECTED]:

 



Kris, this is from context.html in the Tomcat 5 docs:*

Please note that for tomcat 5.x, unlike tomcat 4.x, it is NOT 
recommended to place Context elements directly in the server.xml 
file.* Instead, put them in the META-INF/context.xml directory of
your
  


  

WAR file or the conf directory as described above.

So here I am, stupidly trying to put my Foo.xml file within 
/META-INF/context.xml/ (and various variations of that) of my web
app.

So should I rename Foo.xml to context.xml (I ask because in the conf 
directory I have been naming it Foo.xml, not context.xml), and put it
  

in 
  

*WEB-INF*?

Could you show me where you found how to do this in the docs? Am I
  

just 
  

completely misreading the above sentence?

Thanks for your help,
Erik


Kris Schneider wrote:

   

  

Can you provide some more detail on the problems you're running into


with
  

 



using
   

  

WEB-INF? I've got a simple one lying around here somewhere...

WEB-INF/context.xml:

Context path=/init
  Loader delegate=false/
  Manager pathname=/
/Context

Seems to work fine with TC 5...

Quoting Erik Weber [EMAIL PROTECTED]:



 



Also, since you appear to be trying to follow the documenation,
have
  

you 
  

ever

RE: [OT] Clustering

2004-08-27 Thread Ivan Vasquez
I assume you ask about an Oracle RAC database. 

In that case, the mode is kind-of ACTIVE/ACTIVE: What you get is a
single database mounted by as many instances as cluster nodes you have
configured. So every time your application establishes a db connection,
it may be served by either cluster node.

The data files can be in a clustered file system (like OCFS), in raw
partitions or even in NFS mounts.

There are a few guidelines to develop apps meant to run in a clustered
database:
http://www.cise.ufl.edu/help/database/oracle-docs/rac.920/a96598/design.
htm

Ivan.

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 27, 2004 7:35 AM
To: Struts Users Mailing List
Subject: [OT] Clustering

Hi All,

 

I am developing a J2EE application using Oracle 9iAS. I am looking for
clustering information.

 

I am looking for info on database side.

 

* Are Database servers clustered in an ACTIVE/ACTIVE or
ACTIVE/PASIVE mode?

 

* Is the Oracle database supposed to reside on a file system or
on a RAW partition?

 

TIA.

 

Regards,

Viral

 

 


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



Uploading files to a database

2004-08-20 Thread Ivan Vasquez
Hi,

What's the preferred way to upload files into a database in a J2EE Web
application? 

Is there any way to stream the file straight from the HttpServletRequest
to the database without staging it in the server's filesystem? 

Thank you,
Ivan.


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



RE: Not Logged in with the same loggin-password if it is already registered.

2004-07-28 Thread Ivan Vasquez
It may not be as easy as the current session (for the new login) and the session that 
you want to invalidate are different objects.

The main issue would be how to get a reference to all active sessions via some session 
id. Apache Axis, for example, keeps track of them with a list of ActiveSessions. 

Ivan Vasquez
(Compatriota :-)
 
-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 4:05 PM
To: Struts Users Mailing List
Subject: RE: Not Logged in with the same loggin-password if it is already registered.

Ricardo:

Not sure where you are having problems..? Why wouldn't something like this 
(pseudocode) work?

if (isLoggedIn(user)) {
session.invalidate();
}
//now proceed normally with login with un/pw...


Regards,
Geeta


 -Original Message-
 From: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 28, 2004 3:04 PM
 To: [EMAIL PROTECTED]
 Subject: Not Logged in with the same loggin-password if it is already
 registered.
 
 
 Hello Guys
 I need not to let users to login in my app simultaneosly.
 I mean if a login-password is actually logged in, i need to
 invalidatye that session and then let the new login-password 
 to work in, after invalidating the old session.
 
 Any ideas? and of course any examples?  
 
 --
 Ricardo Andrés Quintero R.
 Ubiquando Ltda.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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


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



RE: How to read display-name from web.xml?

2004-07-16 Thread Ivan Vasquez
Thanks Craig  Jason,

Yes, the string in display-name can be queried via

this.getServlet().getServletContext().getServletContextName()

from any Struts Action.

Thanks very much.
Ivan.

-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 12, 2004 5:09 PM
To: Struts Users Mailing List
Subject: Re: How to read display-name from web.xml?

Ivan Vasquez wrote:

Hi,
 
How can I read from web.xml, say, the application's display name? I've
tried several things, but no luck. This isn't really Struts-specific,
but I'm sure this is an easy one for many of you.
 
Thanks,
Ivan.

  

The web.xml file is available as a resource that can be accessed via the

ServletContext for your webapp.  For example, you can say something
like:

  ServletContext context = ...; // Get a reference to our servlet
context
  InputStream stream = context.getResourceAsStream(/WEB-INF/web.xml);

Now you've got an input stream to read the contents ... you'll probably 
want to use an XML parser to parse the contents -- google for JAXP to 
see the API that Java provides for this purpose.  Or, you might consider

using the Commons Digester package (included with Struts), which is what

Struts itself uses to parse this very resource, in order to figure out 
how the controller servlet is mapped.  Looking at the source code for 
ActionServlet should give you some useful clues.

Craig


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


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



Strange double-submissions

2004-07-07 Thread Ivan Vasquez
Hi, 

We have a form whose last two controls are an html:select and a submit
button. The form posts to an Action to insert records into a database.
Changing the select control causes a page refresh (posting to the same
Action) in order to display other options. 

We notice that, if the user submits the form immediately after changing
the select control (say, in less than 1sec), two records (instead of
one) are inserted into the database. The problem appears depending on
how fast the user hits the submit button after the form refreshes, if
you submit 5secs after refresh, there's no problem. 

The code has been checked and there is no possibility for an html:select
onchange to cause a database insert. Even though both trigger the same
Action, they are well differentiated.

To make things more confusing, even though it is a server-side problem,
we can reproduce it only using IE6.0! Besides the js for submitting the
form onchange, there's no client-side code.

Any clues?

Thanks in advance.
Ivan


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



RE: Strange double-submissions

2004-07-07 Thread Ivan Vasquez
Thanks Jim,

Yes, we found it to be an oddity in IE6 but mostly an error on our part.
The html:submit onchange method was actually submitting the form (as any
other control does). Doing this is wrong to begin with, and it turns out
that Mozilla and IE handle it differently.

Now the page contains a default value of submit in the hidden field
that onchange updates. That way submit does not have to call any js, and
the action is still able to determine what to do.

Thanks again.
Ivan

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 07, 2004 3:02 PM
To: Struts Users Mailing List
Subject: RE: Strange double-submissions


 -Original Message-
 From: Ivan Vasquez [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 07, 2004 11:31 AM
 To: [EMAIL PROTECTED]
 Subject: Strange double-submissions
 
 
 Hi, 
 
 We have a form whose last two controls are an html:select and a submit
 button. The form posts to an Action to insert records into a database.
 Changing the select control causes a page refresh (posting to the same
 Action) in order to display other options. 
 
 We notice that, if the user submits the form immediately 
 after changing
 the select control (say, in less than 1sec), two records (instead of
 one) are inserted into the database. The problem appears depending on
 how fast the user hits the submit button after the form refreshes, if
 you submit 5secs after refresh, there's no problem. 
 
 The code has been checked and there is no possibility for an 
 html:select
 onchange to cause a database insert. Even though both trigger the same
 Action, they are well differentiated.
 
 To make things more confusing, even though it is a 
 server-side problem,
 we can reproduce it only using IE6.0! Besides the js for 
 submitting the
 form onchange, there's no client-side code.
 
 Any clues?

Just the big one you provided, IE 6.  I would put some debugging code of
some sort in your JS and
see if IE6 is calling it even when it's not supposed to.  I've also
experienced some other oddities with IE 6 that don't happen elsewhere.

 
 Thanks in advance.
 Ivan
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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


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