RE: Using database tables for resource bundles

2004-02-02 Thread Johan Wasserman - CPX Mngd Services
Regarding using a database to provide resource bundles;
James Mitchell developed a nifty extention called 'OJBMessageResources'
that uses OJB and there where talk of a new version using Hibernate...


I'm also about to release another implementation that uses Hibernate for
those who don't want the required OJB internal tables.stay
tunedmore to come.


Does anyone know (James, if you're listening) if the Hibernate version
where made available or if there is something else available (that
doesn't use OJB)?

Thanks (and kudos to James for the OJB version),
Johan Wasserman 
For: Comparex Africa (Pty) Ltd 
+27 (0) 83 326 7339 (Mobile) 
+27 (0) 11 266 1110 (Tel) 
+27 (0) 11 266 1099 (Fax) 
Mailto:[EMAIL PROTECTED]
http://www.comparex.co.za/
Company Registration Number 1993/003683/07 
NOTICE: This message and any attachments are confidential and intended
solely for the addressee.  If you have received this message in error,
please notify Johan Wasserman at Comparex Africa (Pty) Ltd immediately,
telephone number +27 (0) 11 266 1110.  Any unauthorized use, alteration
or dissemination is prohibited.  Comparex Africa (Pty) Ltd accepts no
liability whatsoever for any loss whether it be direct, indirect or
consequential, arising from information made available and actions
resulting there from.



-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 25, 2003 6:17 PM
To: Struts Users Mailing List
Subject: Re: Using database tables for resource bundles


On Tue, 2003-03-25 at 10:30, Robert Leland wrote:
> Rahul wrote:
> > Hi,
> > 
> > We are developing a multilingual system using struts 1.1 and j2ee 
> > 1.3.
> > 
> > I need to know whether we can use backend database tables for 
> > providing all the messages i.e. whether the messages can be provided

> > by a set of java class rather than relying on resource files 
> > residing on the server.
> 
> James Mitchell developed a version of this.
> It is in the jakarta-commons-sandbox/resources.
> I haven't used this myself though. For 1.2 we plan
> on making the message resources in struts a wrapper
> around these classes. Until that point you'll need to
> provide your own glue.

Cool, I wasn't aware that it was added to commons-sandbox.  

I initially released this extension on http://sourceforge.net/struts
called 'OJBMessageResources'.  This particular implementation uses OJB
under the covers.  

It is very simple to use.  The best part is that you don't have to
change anything in your application that already uses MessageResources. 
You can even use both properties files and database in the same
application. (Props for some and db for others)

Complete details are available in the download, and I'm here (almost 24
X 7) if you need assistance with setting things up.

I'm also about to release another implementation that uses Hibernate for
those who don't want the required OJB internal tables.stay
tunedmore to come.

> 
> -Rob
> 
> 



-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




-
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: design suggestion

2004-01-12 Thread Johan Stuyts
Use one action for each step and its associated CRUD operations. The 
chaining of these steps shoud be done in struts-config.xml. This way you 
can change the workflow without having to change the actions.

Johan Stuyts

David Liles wrote:

I am currently in the design phase of a project and am struggling with which way to go
 
This is going to be a workflow application that allows the users to submit various request. There are several workflows that will share common functionality (list users, list organizations, etc).
 
I'm not sure if it would be better to create action classes for each complete workflow path that contain the necessary methods to support the workflow; or to create separate action classes for each specific step of the work flow that only have method calls for CRUD functions (create, read, update, delete) and chain them together to create the work flow path based on some type of work flow attribute.
 
Each work flow requires a "next step" and "previous step" button so the user can either continue with their request or navigate back to make changes to information in a previous step in the flow. Needing this type of functionality, I'm not sure which solution would be best
 
Any suggestions?
 
Thanks - Dave


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


RE: [Q]Tags: Lookforward to create the correct session name for bean?

2003-09-29 Thread Johan Wasserman - CPX Mngd Services
Are my questions real difficult, or s stupid?

No-one's ever answered any of 'em, if only I knew why.

{:(

-Original Message-----
From: Johan Wasserman - CPX Mngd Services 
Sent: Monday, September 29, 2003 8:17 AM
To: Struts Users Mailing List
Subject: [Q]Tags: Lookforward to create the correct session name for
bean?


Hi,
Is there a way for a formAction to look at the tag defined in the form
(especialy the "name" attribute) so that I can create a bean and save it
in the session as the same name as the "name" attribute even before the
tag needs it.

Thanks,
Johan.

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



[Q]Tags: Lookforward to create the correct session name for bean?

2003-09-28 Thread Johan Wasserman - CPX Mngd Services
Hi,
Is there a way for a formAction to look at the tag defined in the form
(especialy the "name" attribute) so that I can create a bean and save it
in the session as the same name as the "name" attribute even before the
tag needs it.

Thanks,
Johan.


Struts-menu or not, dynamic menu from bean.

2003-09-24 Thread Johan Wasserman - CPX Mngd Services
Is there a menu builder, like struts-menu, available that will build a
tree menu (and other menu types) from a bean?

Anyone got struts-menu converted to get its data from a bean?

Thanks in advance,
Johan


Re: [OT] jstl forEach problem

2003-08-31 Thread Johan
Solved.
I added instead of a workDocument the collection workDocuments to my 
Arraylist. Just a typo

Johan

Johan wrote:
Hi,
I have a JSTL question and the answers in the archives don't solve the 
problem. So maybe one of you run into the problem ones

I have an ArrayList containing Objects.




This gives me the following error

[ServletException in:/pages/sessie.jsp] An error occurred while 
evaluating custom action attribute "value" with value 
"${document.carBrand.name}": The "." operator was supplied with an index 
value of type "java.lang.String" to be applied to a List or array, but 
that value cannot be converted to an integer. (null)'

In an other page with different objects in a ArrayList it works perfect.
When I run




I get as output

[(this Collection)]

even when document isn't a List or array.

Has anyone of you a pointer where to search for an answer to this problem

Thanks

Johan



--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[OT] jstl forEach problem

2003-08-30 Thread Johan
Hi,
I have a JSTL question and the answers in the archives don't solve the 
problem. So maybe one of you run into the problem ones

I have an ArrayList containing Objects.




This gives me the following error

[ServletException in:/pages/sessie.jsp] An error occurred while 
evaluating custom action attribute "value" with value 
"${document.carBrand.name}": The "." operator was supplied with an index 
value of type "java.lang.String" to be applied to a List or array, but 
that value cannot be converted to an integer. (null)'

In an other page with different objects in a ArrayList it works perfect.
When I run




I get as output

[(this Collection)]

even when document isn't a List or array.

Has anyone of you a pointer where to search for an answer to this problem

Thanks

Johan

--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: HTTP 404 Not Found on Actions - SOLVED

2003-08-18 Thread Johan Wasserman - CPX Mngd Services
Nope, nothing to do with struts!  It's something to do with how Tomcat /
Apache is set up.  When I try via Tomcat only it works.  I'll have to
relook the Tomcat/Apache thing (mod_jk), if ANYBODY has a tried and
trusted way of setting this up, please let me know.

Tomcat v.  5.0.3
Apache v. 2.0.46

Sory for this "out of context".

Thanks,
Johan.

-Original Message-
From: Koni Roth [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 12:41 PM
To: Struts Users Mailing List
Subject: Re: HTTP 404 Not Found on Actions


Try struts 1.1 final version. Here it works ;-)

Johan Wasserman - CPX Mngd Services wrote:

> Hi.
> I'm running struts 1.1-rc2 and get a 404 when entering an unrecognized

> username & password on the logon page for struts-example (Mailreader 
> demo).  It goes to localhost/sruts-example/logon.do but with a 404 
> Page not found.  I've checked and double checked my web & 
> struts-config files, I mean they've not been changed from the 
> download.
> 
> Thanks,
> Johan Wasserman.
> 



-
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]



HTTP 404 Not Found on Actions

2003-08-18 Thread Johan Wasserman - CPX Mngd Services
Hi.
I'm running struts 1.1-rc2 and get a 404 when entering an unrecognized
username & password on the logon page for struts-example (Mailreader
demo).  It goes to localhost/sruts-example/logon.do but with a 404 Page
not found.  I've checked and double checked my web & struts-config
files, I mean they've not been changed from the download.

Thanks,
Johan Wasserman.


Re: site root going straight to a .do

2003-06-30 Thread Johan
In the default blank struts there is an index.html (or jsp) that 
forwards to a global welcome. But your welcome to forward it to your 
start action.

Johan

Simon Kelly wrote:
Hi all,

Sorry about the subject line, it's the best I can do in one sentance.

What I'm trying to do, is set up the wecome file, so that instead of having
to go via a html or jsp page, I can go straight to an action class! Any
ideas?
If someone types in htt://our.site.com/ourapp then it should go straight to
the welcome.do Action and not a html file.
I'm using struts1.1 and stxx.

Cheers

Simon

"I have often wondered how it is that every man loves himself more than all
the rest of men, but yet sets less value on his own opinion of himself than
on the opinion of others." -- Georg Christoph Lichtenberg
Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.
Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: java.util.ConcurrentModificationException at org.apache.struts.action.ActionMessages.add(ActionMessages.java:185)

2003-06-22 Thread Johan Kumps
I think there is a thread on your backend writing to the ArrayList at the
same time your action class is reading the sam ArrayList instance.

I also had this problem and I fixed it by synchronizing the Arraylist during
the write(add) process.

synchronized (this.myArrayList) {
this.myArrayList.add(someElement);
}

Hope this helps.

Kind regards,

-Oorspronkelijk bericht-
Van: Fedor Smirnoff [mailto:[EMAIL PROTECTED]
Verzonden: zondag 22 juni 2003 0:06
Aan: Struts Users Mailing List
Onderwerp: Re: java.util.ConcurrentModificationException at
org.apache.struts.action.ActionMessages.add(ActionMessages.java:185)


I am not using 2 threads, I was just saying than in
case of two threds being used, this Exception will be
thrown.  I can find whats the problem in my casei got
this:

 
   
 

 where colorSelected is a String with getter and
 setter in the orderEntry form bean, and colorOptions
is being returned by a getter in the same bean as an
 ArrayList.
 Something like this:

   public ArrayList getColorOptions() {
   colorOptions.add("red");
   colorOptions.add("green");
   return colorOptions;

Exception is being thrown when I am tryin to run it,
however if I return a String[] instead of ArrayList,
evetyhing works great.

Any ideas?

Thaks
Fedor
--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> You don't need two threads.
>
> If you are using an iterator and are removing from
> the
> collection you are iterating over - you will get
> this
> error.
>
> If you are using EJB CMP then you need to know how
> relationships work because it is easy to run into
> this.
>
> sandeep
> --- Fedor Smirnoff <[EMAIL PROTECTED]> wrote:
> > Hi I asked similar question and yet did not get an
> > answer, I dont know why its happening in my case,
> > however, I know that
> ConcurrentModificationException
> > is thrown when a thread is trying to modify a
> > collection while another thread is still iterating
> > it.
> > Dont know if it helps you or not sorry.
> >
> > Sincerely,
> > Fedor
> >
> > --- Michael Ruppin <[EMAIL PROTECTED]> wrote:
> > > I'm getting the following, using 1.1-rc1
> > > ActionMessages.add(ActionMessages messages):
> > >
> > > [6/20/03 11:15:23:344 CDT]  2d4fa5a WebGroup
>
> > E
> > > SRVE0026E: [Servlet Error]-[AxisPortalServlet]:
> > > java.util.ConcurrentModificationException
> > >   at
> > >
> >
>
java.util.AbstractList$Itr.checkForComodification(AbstractList.java(Inlined
> > > Compiled Code))
> > >   at
> > >
> >
>
java.util.AbstractList$Itr.next(AbstractList.java(Compiled
> > > Code))
> > >   at
> > >
> >
>
org.apache.struts.action.ActionMessages.add(ActionMessages.java:185)
> > >
> > > __
> > > Do you Yahoo!?
> > > SBC Yahoo! DSL - Now only $29.95 per month!
> > > http://sbc.yahoo.com
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
> > __
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> >
> >
>
-
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/06/2003


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



jstl parseDate question

2003-06-19 Thread Johan
Hi,
I read various threads in this newsgroup about getting a Date from a jsp 
page into a bean. Now I'm converting a String value into a Date value in 
an Action.

But there is a JSTL tag  that should be doing this. But 
nowhere in the documentation can I find a small example of how to do it.

Is it possible to parse user input to a date object using 
 or is it only for parsing Strings to date used in the 
page itself?

Johan
--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Transaction Safe Java Code

2003-06-12 Thread Johan
Just found something of interest
http://www.objectweb.org/jotm
http://www.objectweb.org/jotm/current/jotm/doc/howto-tomcat-jotm.html
A opensource transactionmanager which you can use to solve your problem.

Johan

Johan wrote:
Maybe to simple :-)
consider the following snippet
int x = 0;
try {
x=x+10;
x=x+10;
somethingMightThrowingAnException(x);
x=x+10;
} catch (Exception e) {
}
if somethingMightThrowingAnException(x) is not throwing an exception x 
would be 30 in the end. but if somethingMightThrowingAnException(x) is 
throwing an exception the value of x=20. For the transaction it should 
be 0.

I think you need a transactionmanager to solve this problem.

Johan

Erik Price wrote:



Navjot Singh wrote:

Hi List,

I have 2 methods that i am calling in same sequence.

+ txnMethod1()
+ txnMethod2()
I wish either both of them get _executed_ or none of them.

Can i rollback the state to what was before method1's _execution_ if 
method2 fails?

Is it possible or i should start thinking simple?


Think simple: throw an exception.



Erik

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





--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Transaction Safe Java Code

2003-06-12 Thread Johan
Maybe to simple :-)
consider the following snippet
int x = 0;
try {
x=x+10;
x=x+10;
somethingMightThrowingAnException(x);
x=x+10;
} catch (Exception e) {
}
if somethingMightThrowingAnException(x) is not throwing an exception x 
would be 30 in the end. but if somethingMightThrowingAnException(x) is 
throwing an exception the value of x=20. For the transaction it should 
be 0.

I think you need a transactionmanager to solve this problem.

Johan

Erik Price wrote:


Navjot Singh wrote:

Hi List,

I have 2 methods that i am calling in same sequence.

+ txnMethod1()
+ txnMethod2()
I wish either both of them get _executed_ or none of them.

Can i rollback the state to what was before method1's _execution_ if 
method2 fails?

Is it possible or i should start thinking simple?


Think simple: throw an exception.



Erik

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



--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: DynaActionForm

2003-06-02 Thread Johan
In java you can't extend AbstractWeekend and AbstractSelfEmployed at the 
same time. Not in Montana or anywhere else :-)

Johan

Brandon Goodin wrote:
weekend? I'm not familiar with that term since I became self-employed.
Things have gotten real thin here (Montana). I work 7 days a week. My work
centers around small clients who aren't willing to pay more than $2000 for a
website. Yet, they want Amazon.com. I've been looking for employment. But, I
have not been successful. AH! The joys of being a self-employed
Husband/Dad in a place where technology opportunities are thin.
Brandon Goodin

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 01, 2003 4:19 PM
To: Struts Users Mailing List
Subject: Re: DynaActionForm
its really none of my business..

but have you been working all through the weekend?

On Sunday, Jun 1, 2003, at 22:37 Europe/London, Brandon Goodin wrote:


:-)) I was hoping you would catch the humor :-D

Brandon Goodin

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 01, 2003 3:26 PM
To: Struts Users Mailing List
Subject: Re: DynaActionForm
Note to self.. "I must give clearer answers" .. and not mess up my
pronouns.. :o)
On Sunday, Jun 1, 2003, at 20:50 Europe/London, Brandon Goodin wrote:


Let me help mark...

1) You must have Struts 1.1 to use DynaActionForm.

2a) Go to the following link:
http://www.apache.org/dist/jakarta/struts/binaries/
or

2b)Click  one of the following:

Windows:
http://www.apache.org/dist/jakarta/struts/binaries/jakarta-struts-1.1-
rc1.zi
p
*nix:
http://www.apache.org/dist/jakarta/struts/binaries/jakarta-struts-1.1-
rc1.ta
r.gz
3)Unzip or Untar the binary distribution.

4)locate the /lib directory

5) In the lib directory exists a struts.jar. Replace your struts.jar
with
the lib/struts.jar.
6) Then you should have the functionality (DynaActionForm) you need
:-D
Brandon Goodin

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 01, 2003 1:12 PM
To: Struts Users Mailing List
Subject: Re: DynaActionForm
in 1.1



On Sunday, Jun 1, 2003, at 20:03 Europe/London, Giovanni Di Lembo
wrote:

Where I should find DynaActionform, maybe packed in struts.jar ? It
is
not there ; where  should I find it?
cheers
- Original Message -
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, June 01, 2003 8:17 PM
Subject: Re: DynaActionForm
I may find the Dyna form stuff wasn't part of struts 1.0

I'm not sure what version of 0.9 you must have been running to have
all
the dyna stuff running..
If you want to have your form bean generated without writing classes
then i thing you'll have to move to a 1.1 distribution of struts.
You could use a form bean class and have it map backed (see struts
user
guide docs for "map backed forms" or something).
cheers mark

On Sunday, Jun 1, 2003, at 16:55 Europe/London, Giovanni Di Lembo
wrote:

I'm using DynaActionForm. I've imported
org.apache.struts.action.DynaActionForm in my Action and I'm usin
Map map = ((DynaActionForm)form).getMap()  to retrieve the
values...but

on compile time javac does not find
org.apache.struts.action.DynaActionForm.
I'm using struts 1.02.I've used it with struts 0.9 and it works
fine.What's the problem§?

-
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]


-
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]


-
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]



--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nill

Re: [REMOVE THIS DUDE]!!!!! DELIVERY FAILURE: Error delivering toChetan Khimjee/Impfleet; Router: Database disk quota exceeded

2003-05-30 Thread Johan
I try to send a message to the postmaster. No luck, message bounced 
because you can't mail their postmaster :-(

Johan

Brandon Goodin wrote:
WOULD SOMEONE PLEASE REMOVE THIS FOOL!

Brandon Goodin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 6:38 AM
To: Brandon Goodin
Subject: DELIVERY FAILURE: Error delivering to Chetan Khimjee/Impfleet;
Router: Database disk quota exceeded
Your message

  Subject: RE: Justifying Struts

was not delivered to:

  [EMAIL PROTECTED]

because:

  Error delivering to Chetan Khimjee/Impfleet; Router: Database disk quota
exceeded




Reporting-MTA: dns;lotus_notes.impfleet.co.za

Final-Recipient: rfc822;[EMAIL PROTECTED]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Notes; Error delivering to Chetan Khimjee/Impfleet; Router: 
Database disk quota exceeded


Subject:
RE: Justifying Struts
From:
"Brandon Goodin" <[EMAIL PROTECTED]>
Date:
Thu, 29 May 2003 06:37:45 -0600
To:
"Struts Users Mailing List" <[EMAIL PROTECTED]>
Ya I just started coding a project in PHP. I love the spaghetti code and
complete lack of structural rules :-D
Other such loves...

1) I love how there are no namespaces
2) I love the mish-mash of procedural and object oriented principals.
3) I love the lack of scope to store objects or basic string data in general
(no application scope, weak request scope, and, from #2, a procedural/oo
page scope that makes you wanna scream)
4) Loose (obsurdly) typing that can and DOES encourage crappy programming.
5) I love how at every chance they attempt to borrow from java, but due to
their underpinnings always wind up seriously short and still find room to
cut down java.
My advice to PHP... MAKE UP YOUR MIND!!! :-))

Anyways, that's my .02,

Brandon Goodin

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 6:17 AM
To: 'Struts Users Mailing List'
Subject: RE: Justifying Struts
I'm with you, Mike!  That's why I stopped using this confounded framework
and returned to good ole ASP
Mark


I've heard about
Struts and have researched it over the last few hours.  The MVC
approach makes
sense, but I'm still not sold on it yet.  Here are some doubts I have.
1) I think the separation of presentation (view) from the model and
controller
has gone too far (or probably is not done well in Struts).  For
example, I like
to have my front end developers do form (field) validation.  These
developers
should not have to write beans to do this (all examples I've seen so
far do
form validation in Java beans).  This somewhat contradicts the J2EE
development
model where "application developers", who are basically scripters (not
OO
developers), do the front end work.
2) There is just too much junk to write to do a simple form.  The
samples I've
seen have involve too many files to do a simple form.  Plus, why
should I have
to write a new bean for each form.  Why can't the bean either be
generated
automatically or there be a general purpose bean (with properties that
are
created dynamically) that works for all forms?
3) We already separate business logic nicely, usually by encapsulating
the
logic in beans or EJBs.  By the time the "application developers" get
to work
writing JSP/HTML, they are not writing any business logic.  So why add
the
overhead of Struts (or any other framework)?
4) Because we separate out business logic into beans and EJBs, Java is
simply
used as a scripting langauge in our JSPs - in just the same way that
VBScript
is used in Active Server Pages.  We try not to confuse the object
oriented
language called Java, with the scripting language called Java that we
use in
JSPs.  We use a very small subset of Java in JSPs.
5) Based on #4, I don't particularly care for taglibs either.  Again,
we are
simply using Java to do simple scripting.  Loops are probably the most
complex
thing we do.  So why add the extra overhead of taglibs.  A loop is a
loop
whether it has the syntax of Java or a taglib.  Plus, if I want my
front-end
developers to get any experience with serious development, I'd rather
have them
dealing with Java as opposed to taglibs, which have no value in the
real world
of programming.
6) Performance is unknown.  I've looked through the mail archives and
have seen
requests for performance figures, but no answers (plenty of folks
pushing
Struts though).
Mike




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


---

Re: Why should I...?[Fwd: Não é possível entregar: Execute some method before tiles redering... HOW?]

2003-05-27 Thread Johan
I contacted the postmaster with instructions how to remove him/her of 
the list or to please check the diskquota

Johan

James Mitchell wrote:

You didn't receive that message from "mailling list service".  It came from
CKhimjee's mail server.

--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org


- Original Message -
From: "José Fortunato H. Tomás" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 27, 2003 4:07 AM
Subject: Why should I...?[Fwd: Não é possível entregar: Execute some method
before tiles redering... HOW?]


Why should I receive this error from mailling list service?
Thanks!
 Original Message 
From: - Tue May 27 09:05:19 2003
X-UIDL: AAArfpHohnbVy9K5ny03w16p2FH5
X-Mozilla-Status: 0001
X-Mozilla-Status2: 1000
Received: from ns.link.pt ([194.117.36.1]) by correio.link.pt with
Microsoft

SMTPSVC(5.0.2195.5329); Tue, 27 May 2003 08:58:47 +0100
Received: from smtp.imperialonline.co.za (outbound.impol.net
[196.25.56.132]

(may be forged)) by ns.link.pt (8.9.1/8.9.1) with ESMTP id IAA01072 for
<[EMAIL PROTECTED]>; Tue, 27 May 2003 08:58:35 +0100
Received: from [192.168.22.14] (helo=lotus_notes.impfleet.co.za) by
smtp.imperialonline.co.za with esmtp (Exim 3.36 #2) id 19KZJN-0007PW-00
for

[EMAIL PROTECTED]; Tue, 27 May 2003 09:55:57 +0200
MIME-Version: 1.0
Content-Type: multipart/report;
boundary="_=_NextPart_001_01C32425.CE446CE4";
report-type=delivery-status

Received: from smtp.imperialonline.co.za ([10.20.30.26])  by
impfleet.co.za (Lotus Domino Release 5.0.2c (Intl))  with ESMTP id
2003052709494341:2536 ;  Tue, 27 May 2003 09:49:43 +0200
Received: from [196.15.171.23] (helo=ns1.impol.net) by
smtp.imperialonline.co.za

with esmtp (Exim 3.36 #2) id 19KZIj-0006Gy-00 for [EMAIL PROTECTED];
Tue,

27 May 2003 09:55:17 +0200
X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0
Received: from [196.23.15.36] (helo=tanntjhb.bynx.com) by ns1.impol.net
with

esmtp (Exim 4.14) id 19KZ0u-0008CF-N1 for [EMAIL PROTECTED]; Tue, 27
May

2003 09:36:54 +0200
Received: by tanntjhb with Internet Mail Service (5.5.2653.19) id
;

Tue, 27 May 2003 09:52:45 +0200
Received: from apache.org (daedalus.apache.org [208.185.179.12]) by
tanntjhb.bynx.com with SMTP (Microsoft Exchange Internet Mail Service
Version

5.5.2653.13) id LXMPPVTB; Tue, 27 May 2003 09:52:38 +0200
Received: (qmail 70880 invoked by uid 500); 27 May 2003 07:55:57 -
Received: (qmail 70867 invoked from network); 27 May 2003 07:55:56 -
Received: from ns.link.pt (194.117.36.1)  by daedalus.apache.org with
SMTP; 27

May 2003 07:55:56 -
Received: from ns-in.link.pt (ns-in.link.pt [192.168.2.1]) by ns.link.pt
(8.9.1/8.9.1) with ESMTP id IAA01037 for <[EMAIL PROTECTED]>;
Tue,

27 May 2003 08:56:07 +0100
Received: from correio.link.pt (correio.link.pt [192.168.2.26]) by
ns-in.link.pt

(8.9.3/8.9.3) with SMTP id IAA06134 for <[EMAIL PROTECTED]>;
Tue,

27 May 2003 08:56:52 +0100
Received: from link.pt ([192.168.24.11]) by correio.link.pt with Microsoft
SMTPSVC(5.0.2195.5329); Tue, 27 May 2003 08:55:37 +0100
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Struts Users Mailing List" 
Delivered-To: mailing list [EMAIL PROTECTED]
Organization: Link Consulting
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a)
Gecko/20030401

X-Accept-Language: en-us, en, pt
X-OriginalArrivalTime: 27 May 2003 07:55:37.0201 (UTC)
FILETIME=[5BFA0E10:01C32425]

X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-MIMETrack: Itemize by SMTP Server on
Impnotes.impfleet.co.za/Impfleet(Release

5.0.2c (Intl)|2 February 2000) at 27/05/2003 09:49:43 AM,Serialize by
Router on

rtgnotes.impfleet.co.za/Impfleet(Release 5.0.8 |June 18, 2001) at
05/27/2003

10:04:01 AM,Serialize complete at 05/27/2003 10:04:01 AM
Return-Path:
content-class: urn:content-classes:dsn
Subject: Não é possível entregar: Execute some method before tiles
redering... HOW?

Date: Tue, 27 May 2003 08:58:48 +0100
Message-ID: <[EMAIL PROTECTED]>
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Thread-Topic: Execute some method before tiles redering... HOW?
Thread-Index: AcMkJc4/hzgiqU5tSB2+EIcsnfWp8wFr
List-Help: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
From: Administrador de sistema <[EMAIL PROTECTED]>
To: José Fortunato Henriques Tomás <[EMAIL PROTECTED]>
Your message

  To:  [EMAIL PROTECTED]
  Subject: Execute some method before tiles redering... HOW?
  Sent:Tue, 27 May 2003 08:55:42 +0100
did not reach the following recipient(s):

[EMAIL PROTECTED] on Tue, 27 May 2003 08:55:42 +0100
O sistema de correio electrónico não consegui entregar esta
mensagem, mas não comunicou uma razão específica. Verifiq

Re: [OT] I'm tired of restarting tomcat!

2003-05-27 Thread Johan
He Fabio,
For answering this question you included not enough data. Since this is 
a question quite of topic you can search the tomcat mailing lists. But 
you can also mail me the complete exception and of cource the server.xml 
of your tomcat installation. If you use tomcat in combination with 
apache be sure you compiled the connector stuff on the computer you're 
using.

I had a lot of trouble with connection reset when using a pre-compiled 
version of the mod_jk for apache. But I can't make up what you're using.

Feel free to mail your stuff.

Johan

Fabio Mancinelli wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello all,

this is somewhat off-topic but I don't know why I have this behaviour.
I deployed my struts application on tomcat 4.1.18 and randomly, it stops
serving requests (it waits forever on index.jsp).
In the log files I always notice an exception:
003-05-27 16:30:09 StandardWrapperValve[default]: Servlet.service() for servlet 
default threw exception
java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuff
...
The only way to restore the normal behaviour is to restart tomcat.

Does anyone know why I get this behaviour?

A presto,
Fabio
- -- 
- ---
 Fabio Mancinelli, PhD student   EMail : [EMAIL PROTECTED]
 Dipartimento di Informatica   WWW : http://www.di.univaq.it/~mancinel
 Universita' dell'Aquila
- ---

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6
iD8DBQE+04t76dsQbk2R3cMRAgHrAKCjXY+NqIChZrIhZsCNw7/923Fb+ACghEFq
+/DiCrnBlm2xQCZarq9gr+A=
=Yu0y
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Browser influence Session behavior

2003-04-04 Thread Johan Wasserman
LOG FILE:

 WHITH Mozilla 0.9.8 
Apr 4, 2003 1:04:57 PM jackrabit.com.dao.Table execute
INFO: select * from subscriptions where subsid='acme'
Apr 4, 2003 1:04:57 PM jackrabit.com.dao.Table execute
INFO: RETURNED 1
Apr 4, 2003 1:04:57 PM jackrabit.actions.StartAction execute
INFO: Subscriptions returned 1 entries
Apr 4, 2003 1:04:57 PM jackrabit.actions.StartAction execute
INFO: SAVING STATE UNDER SESSION 3C9CDA8EA0367A6B96C6854A509F8A8A
Apr 4, 2003 1:04:57 PM jackrabit.actions.StartAction execute
INFO: SUCCESS - FORWARD
Apr 4, 2003 1:04:58 PM jackrabit.actions.AppAction execute
INFO: INTO APP ACTION
Apr 4, 2003 1:04:58 PM jackrabit.actions.AppAction execute
INFO: SESSION FOUND AT B4E5EC78531786E823C3513990DF15CB
Apr 4, 2003 1:04:58 PM org.apache.struts.action.RequestProcessor
processException
WARNING: Unhandled Exception thrown: class
java.lang.NullPointerException
Apr 4, 2003 1:04:58 PM org.apache.jk.server.JkCoyoteHandler action
INFO: RESET 
 WHITH Netscape Navigator 
Apr 4, 2003 1:05:18 PM org.apache.jk.common.ChannelSocket
processConnection
INFO: connection timeout reached
Apr 4, 2003 1:05:19 PM org.apache.jk.common.ChannelSocket
processConnection
INFO: connection timeout reached
Apr 4, 2003 1:06:17 PM jackrabit.com.dao.Table execute
INFO: select * from subscriptions where subsid='acme'
Apr 4, 2003 1:06:17 PM jackrabit.com.dao.Table execute
INFO: RETURNED 1
Apr 4, 2003 1:06:17 PM jackrabit.actions.StartAction execute
INFO: Subscriptions returned 1 entries
Apr 4, 2003 1:06:17 PM jackrabit.actions.StartAction execute
INFO: SAVING STATE UNDER SESSION 719869CF5F6A58002D7335AEB735FEF2
Apr 4, 2003 1:06:17 PM jackrabit.actions.StartAction execute
INFO: SUCCESS - FORWARD
Apr 4, 2003 1:06:18 PM jackrabit.actions.AppAction execute
INFO: INTO APP ACTION
Apr 4, 2003 1:06:18 PM jackrabit.actions.AppAction execute
INFO: SESSION FOUND AT 719869CF5F6A58002D7335AEB735FEF2
Apr 4, 2003 1:06:18 PM jackrabit.actions.AppAction execute
INFO: STATE Acme Company
Apr 4, 2003 1:06:18 PM jackrabit.actions.AppAction execute
INFO: NOT LOGGED ON - GOING TO LOGON
Apr 4, 2003 1:06:18 PM jackrabit.actions.InitLogon execute
INFO: SUCCESS - FORWARDING
Apr 4, 2003 1:06:19 PM org.apache.struts.util.PropertyMessageResources

INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true
Apr 4, 2003 1:06:20 PM jackrabit.actions.AppAction execute
INFO: INTO APP ACTION
Apr 4, 2003 1:06:20 PM jackrabit.actions.AppAction execute
INFO: SESSION FOUND AT 719869CF5F6A58002D7335AEB735FEF2
Apr 4, 2003 1:06:20 PM jackrabit.actions.AppAction execute
INFO: STATE Acme Company
Apr 4, 2003 1:06:20 PM jackrabit.actions.AppAction execute
INFO: NOT LOGGED ON - GOING TO LOGON
Apr 4, 2003 1:06:20 PM jackrabit.actions.InitLogon execute
INFO: SUCCESS - FORWARDING

-----Original Message-
From: Johan Wasserman 
Sent: 04 April 2003 13:36
To: [EMAIL PROTECTED]
Subject: Browser influence Session behavior

Hi,
 
I have an initial page where the company name is entered and that
forwards to a main page (with 3 frames) that loads the header, sidebar
and logon page.  I save a State bean in the session after the company is
validated (against a db) and then use the company name from the State
bean on the logon page.  With Konqueror and Netscape I have no problems
in getting the bean back from the session, but with Mozilla a new
session is created and I get a nullpointer exception (the bean's not
found in the new session).
 
I have traced the session id and find that it remains the same for
Konqueror and Netscape but changes for Mozilla.
 
Anyone got any ideas?
 
Thanks in advance,
Johan.

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



Browser influence Session behavior

2003-04-04 Thread Johan Wasserman
Hi,
 
I have an initial page where the company name is entered and that
forwards to a main page (with 3 frames) that loads the header, sidebar
and logon page.  I save a State bean in the session after the company is
validated (against a db) and then use the company name from the State
bean on the logon page.  With Konqueror and Netscape I have no problems
in getting the bean back from the session, but with Mozilla a new
session is created and I get a nullpointer exception (the bean's not
found in the new session).
 
I have traced the session id and find that it remains the same for
Konqueror and Netscape but changes for Mozilla.
 
Anyone got any ideas?
 
Thanks in advance,
Johan.


RE: take over an existing HttpSession

2003-03-28 Thread Johan Wasserman
You might have found your solution already, but I just got the same type
of requirement.  I found, and is looking at, the
org.apache.catalina.session.PersistentManagerBase class (in
catalina.jar) and hopefully this will do the trick for me.  Also look at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/manager.html on
how to set up the manager and state store.  I'm thinking in the lines of
saving the session ID in the user's logon database. So if the user logs
on to another terminal and he already has an session id, then I'll try
to use the state store to retrieve the old session and loading its
contents into the new session before invalidating the old one.

If anyone has worked with the PersistentManagerBase before, helpful
hints will be appreciated.

Happy coding.
Johan Wasserman

-Original Message-
From: Dmitri Ilyin [mailto:[EMAIL PROTECTED] 
Sent: 24 March 2003 20:01
To: [EMAIL PROTECTED]
Subject: Re: take over an existing HttpSession


"Dan Tran" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> With this  design idea, I am sure you will need to place a collection
to
> store all active sessions. Vector collection type will to do job to
protect
> multi threaded situation.
>
> You will  need a SessionListener to remove the expired session from
servlet
> context.
>
> You will need to know what to copy from old session to new session.
This
is
> the hardest one I beleive since struts do lots of this stuff behind
the
> scene, you may need to know struts code to do this work.
>
> Are you sure you want to do this? sound like a mantainent nightmare
for me
> ;-)
Sure I don't. But i probably must ...
I'm not using Struts a lot, so the last issue must not be critical for
me.
My application will be ported to Struts later and then i will have to
see if
it will also work for Struts but later

>
> -D
> - Original Message -
> From: "Dmitri Ilyin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 24, 2003 9:23 AM
> Subject: Re: take over an existing HttpSession
>
>
> > Thank you Dan.
> >
> > I will try it this way. I don't see any problem with multithreading
here.
> I
> > will not change the "old" session i will invalidate it. What do you
> think??
> >
> > "Dan Tran" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > news:[EMAIL PROTECTED]
> > > Just an idea!!
> > >
> > > Store all your sessions's reference  in the servelt context and
when a
> new
> > > session is create, check against the session list in the servelt
> context,
> > > copy over data from old session to new session, and destroy the
old
> > session
> > >
> > > Then You have to deal with all kind of multithreaded  and
usibility
> > issues.
> > > Sound scary ;-)
> > >
> > > Good luck
> > >
> > > - Original Message -
> > > From: "Dmitri Ilyin" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, March 24, 2003 5:59 AM
> > > Subject: Re: take over an existing HttpSession
> > >
> > >
> > > >
> > > > "Stephen Smithstone" <[EMAIL PROTECTED]> schrieb im
> Newsbeitrag
> > > > news:[EMAIL PROTECTED]
> > > > > Use the servlet context to store the details in instead of the
> session
> > > > context
> > > > > and the label it via a the users username or something
> > > > Thank you Stephen, that's Ok but i also have to invalidate an
"old
> > > session",
> > > > so the user can only have one session at time.
> > > >
> > > > >
> > > > >
> > > > >
> > > > > On Monday 24 March 2003 12:40 pm, Dmitri Ilyin wrote:
> > > > > > Hi,
> > > > > >
> > > > > > i'm may be out of topic. But i think there are a lot of
gurus
here
> > > they
> > > > > > could help me.
> > > > > >
> > > > > > I have to implement one feature in my application for that
there
> is
> > > may
> > > > be
> > > > > > already a solution here.
> > > > > >
> > > > > > Szenario:
> > > > > > A user logged on in application. He dose some  work, dosn't
> logged
> > > out
> > > > and
> > > > > > goes to another workstation. In new workstation he logged in
> &g

RE: [newbie]dbcp pools with Struts... the saga continues

2003-03-26 Thread Johan Wasserman
Wooohooo, I think I got my solution;
Here's the code:

import java.sql.*;
import org.apache.commons.dbcp.*;
import org.apache.commons.pool.impl.*;

public class DBCPStest {
  public static void main(String[] args) 
  throws Exception {
  String url = "jdbc:postgresql://127.0.0.1:5432/mydb";
  String user = "username";
  String passwd = "password";

GenericObjectPool geoPool =
  new GenericObjectPool(null);
DriverManagerConnectionFactory cnnFactory =
  new DriverManagerConnectionFactory(url, user, passwd);

PoolableConnectionFactory poolableCnnFactory =
  new
PoolableConnectionFactory(cnnFactory,geoPool,null,null,false,true);

PoolingDataSource dataSource =
  new PoolingDataSource(geoPool);
Connection conn = dataSource.getConnection();
  }
 }

-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 16:44
To: Struts Users Mailing List
Subject: Re: [newbie]dbcp pools with Struts... the saga continues

Yikes.  With a big setup like that, I'm surprised there's no
automagically
configured clustered setup where the DB engine is handling all that load
sharing.  I give up... ;)

- Original Message -
From: "Johan Wasserman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 9:30 AM
Subject: RE: [newbie]dbcp pools with Struts... the saga continues


Oh, it get much more complicated than that, I have multiple physical db
servers, databases are created round-robin style on the different
servers, a new dbserver can be added and then databases are created
there until the load is equal to the others. When the load on one server
gets too high, a database can be moved to another server, and the
companies web app gets is informed of the move, that's where the
.properties file should do its work.

-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: 26 March 2003 16:19
To: Struts Users Mailing List
Subject: Re: [newbie]dbcp pools with Struts... the saga continues

Maybe have them share a database connection, but use different databases
within that database server.  I'm not that familiar with Postgres, but
here's the idea as applied to SQL Server (Oracle would be similar)

1)  They subscribe, and your app copies everything it needs to get
running.
A new database is created called "acme" (where do you store the
customer's
name, "acme" in this case?  I'm assuming it's available to the app
somehow).

2)  In your code to get an actual connection, you get the datasource via
JNDI, then the first statement executed is "use acmeDB"

3)  Proceed as before, and now they are using their own database.

Another option would be doing multitenancy in the tables, so everyone
shares
the same database (there are advantages and disadvantages to this; you
could
have *some* groups with access to other groups' data, if that's
appropriate)

Going the other direction philosophically, yet another option would be
creating a new DB login for each customer, and the DB specifies which
database they have access to (e.g. "acme" login has default database =
"acmeDB" and "widgetco" login has default database = "widgetcoDB").  You
would have to set the username and password in the datasource before
getting
the connections, and I'm not sure exactly how/if that would work, but it
would imply another layer of "security" in a way...

- Original Message -
From: "Johan Wasserman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 9:01 AM
Subject: RE: [newbie]dbcp pools with Struts... the saga continues


Problem is, as soon as a new company subscribes, I have automated
processes to copy the app from [example] http://myweb.com/template to
http://myweb.com/acme and create the relevant .propperties and .xml
files, etc... I even automate the creation of the new "acme" database
from a postgres template database.  I can automate the addition of a
datasource in server.xml, but then the server needs to restart and I
cannot automate the addition of another constant in my Constants class.

-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: 26 March 2003 15:48
To: Struts Users Mailing List
Subject: Re: [newbie]dbcp pools with Struts... the saga continues

You should be able to set up multiple database connections in
server.xml; I
don't see why there's a problem.  As long as you're using unique names
for
the resources, you should be OK.  BTW, a "standard" for naming such
things
would be "com.mycompany.myapp.Constants.DATABASE_KEY" -- not likely to
ever
step on someone else's resource name that way.

I have a Tomcat instance with two separate db

RE: [newbie]dbcp pools with Struts... the saga continues

2003-03-26 Thread Johan Wasserman
Oh, it get much more complicated than that, I have multiple physical db
servers, databases are created round-robin style on the different
servers, a new dbserver can be added and then databases are created
there until the load is equal to the others. When the load on one server
gets too high, a database can be moved to another server, and the
companies web app gets is informed of the move, that's where the
.properties file should do its work.

-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 16:19
To: Struts Users Mailing List
Subject: Re: [newbie]dbcp pools with Struts... the saga continues

Maybe have them share a database connection, but use different databases
within that database server.  I'm not that familiar with Postgres, but
here's the idea as applied to SQL Server (Oracle would be similar)

1)  They subscribe, and your app copies everything it needs to get
running.
A new database is created called "acme" (where do you store the
customer's
name, "acme" in this case?  I'm assuming it's available to the app
somehow).

2)  In your code to get an actual connection, you get the datasource via
JNDI, then the first statement executed is "use acmeDB"

3)  Proceed as before, and now they are using their own database.

Another option would be doing multitenancy in the tables, so everyone
shares
the same database (there are advantages and disadvantages to this; you
could
have *some* groups with access to other groups' data, if that's
appropriate)

Going the other direction philosophically, yet another option would be
creating a new DB login for each customer, and the DB specifies which
database they have access to (e.g. "acme" login has default database =
"acmeDB" and "widgetco" login has default database = "widgetcoDB").  You
would have to set the username and password in the datasource before
getting
the connections, and I'm not sure exactly how/if that would work, but it
would imply another layer of "security" in a way...

- Original Message -
From: "Johan Wasserman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 9:01 AM
Subject: RE: [newbie]dbcp pools with Struts... the saga continues


Problem is, as soon as a new company subscribes, I have automated
processes to copy the app from [example] http://myweb.com/template to
http://myweb.com/acme and create the relevant .propperties and .xml
files, etc... I even automate the creation of the new "acme" database
from a postgres template database.  I can automate the addition of a
datasource in server.xml, but then the server needs to restart and I
cannot automate the addition of another constant in my Constants class.

-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: 26 March 2003 15:48
To: Struts Users Mailing List
Subject: Re: [newbie]dbcp pools with Struts... the saga continues

You should be able to set up multiple database connections in
server.xml; I
don't see why there's a problem.  As long as you're using unique names
for
the resources, you should be OK.  BTW, a "standard" for naming such
things
would be "com.mycompany.myapp.Constants.DATABASE_KEY" -- not likely to
ever
step on someone else's resource name that way.

I have a Tomcat instance with two separate dbcp pools set up now, where
one
application uses one of them, the another uses the other, and everything
is
happy.

- Original Message -
From: "Johan Wasserman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 3:40 AM
Subject: [newbie]dbcp pools with Struts... the saga continues


Hi,
This might me out of context, but please be patient with me.

I am now building a DAO (thanks for putting me on the right track Mr.
Graham) and I'm trying to find a way for the DAO to establish it's own
connection to the database pool/s created by the ActionServlet.
Again, I must stress that I am very new to struts and dbcp.  I would
prefer not to pre-established connection (using getConnection) and
passing that to the DAO, and I believe the method I'm trying to use
below should be helpful in a lot of other circumstances as well.

I know that would be very easy if my pool/s where configured in
server.xml and then would be accessable through initialContext.  But
being configured in strust-config (servlet context) I cannot set up a
 for it in web.xml.  (in servlet and not container
context, because multiple companies share the same web-server, but have
their own app connecting to their unique db instance).


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



RE: [newbie]dbcp pools with Struts... the saga continues

2003-03-26 Thread Johan Wasserman
Problem is, as soon as a new company subscribes, I have automated
processes to copy the app from [example] http://myweb.com/template to
http://myweb.com/acme and create the relevant .propperties and .xml
files, etc... I even automate the creation of the new "acme" database
from a postgres template database.  I can automate the addition of a
datasource in server.xml, but then the server needs to restart and I
cannot automate the addition of another constant in my Constants class.

-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED] 
Sent: 26 March 2003 15:48
To: Struts Users Mailing List
Subject: Re: [newbie]dbcp pools with Struts... the saga continues

You should be able to set up multiple database connections in
server.xml; I
don't see why there's a problem.  As long as you're using unique names
for
the resources, you should be OK.  BTW, a "standard" for naming such
things
would be "com.mycompany.myapp.Constants.DATABASE_KEY" -- not likely to
ever
step on someone else's resource name that way.

I have a Tomcat instance with two separate dbcp pools set up now, where
one
application uses one of them, the another uses the other, and everything
is
happy.

- Original Message -
From: "Johan Wasserman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 3:40 AM
Subject: [newbie]dbcp pools with Struts... the saga continues


Hi,
This might me out of context, but please be patient with me.

I am now building a DAO (thanks for putting me on the right track Mr.
Graham) and I'm trying to find a way for the DAO to establish it's own
connection to the database pool/s created by the ActionServlet.
Again, I must stress that I am very new to struts and dbcp.  I would
prefer not to pre-established connection (using getConnection) and
passing that to the DAO, and I believe the method I'm trying to use
below should be helpful in a lot of other circumstances as well.

I know that would be very easy if my pool/s where configured in
server.xml and then would be accessable through initialContext.  But
being configured in strust-config (servlet context) I cannot set up a
 for it in web.xml.  (in servlet and not container
context, because multiple companies share the same web-server, but have
their own app connecting to their unique db instance).


-
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]



[newbie]dbcp pools with Struts... the saga continues

2003-03-26 Thread Johan Wasserman
Hi,
This might me out of context, but please be patient with me.
 
I am now building a DAO (thanks for putting me on the right track Mr.
Graham) and I'm trying to find a way for the DAO to establish it's own
connection to the database pool/s created by the ActionServlet.
Again, I must stress that I am very new to struts and dbcp.  I would
prefer not to pre-established connection (using getConnection) and
passing that to the DAO, and I believe the method I'm trying to use
below should be helpful in a lot of other circumstances as well.
 
I know that would be very easy if my pool/s where configured in
server.xml and then would be accessable through initialContext.  But
being configured in strust-config (servlet context) I cannot set up a
 for it in web.xml.  (in servlet and not container
context, because multiple companies share the same web-server, but have
their own app connecting to their unique db instance).
 
So I tried to get the running instance of the action servlet by using
Class.forName() but that doesn't work (if someone could tell me why I'd
appreciate it)
Now I'm trying to access the pool by using the following:
Data Source configured in struts-config (some class paths shortened for
readability);
 

  
 
  ...other properties...
 
  
 
  ..more properties..
 

 
...more datasources...
 
Now I'm trying to "find" the pool in the following way:
 
GenericObjectPool cnnPool new GenericObjectPool(null);
PoolingDriver pooldr = new PoolingDriver();
Pooldr.registerPool("logindb", cnnPool);
Connection cnn =
DriverManager.getConnection("jdbc:apache:commons:dbcp:logindb");
.
 
I get the following error:
 
Javax.servlet.ServletException: No pool found for
jdbc:apache:commons:dbcp:logindb.
 
Could anyone help?
 
Thanks in advance.
Johan Wasserman.


RE: [newbie] findDataSource deprecated?

2003-03-24 Thread Johan Wasserman
Yep! My mistake, I've been brainbusting so much about getting a database
connection it seems there's not much left to get the versions right ;-)

I'm on Struts 1.1-rc1, downloaded last Friday.

Nope, I haven't yet got a connection.  Thank you for the other REALY
VALUBLE information, I was clearly way off the "best practice" road.

If it's at all possible for you to help, here's my situation.

I'm running postgresql.
Datapool configured in struts-config:


  

... lotsa more properties ...
  
  

... lotsa more properties ...
  


Now for the life of me! I just cannot (or will not? Lng hours), get
any code written to connect to one of the pools. 

Any help will do.

Thanks again for your previous reply David.
Regards,
Johan Wasserman

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED] 
Sent: 24 March 2003 16:52
To: [EMAIL PROTECTED]
Subject: Re: [newbie] findDataSource deprecated?

Well, there is no 1.1 RC3 so you must be referring to 1.1 beta 3.  It
looks 
like others have answered your original question but I wanted to talk
about 
your Database class.  You should never return a ResultSet into your
Action 
or form classes as it maintains an open database connection.  You need
to 
copy the results into a class like ResultSetDynaClass
http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanu
tils/RowSetDynaClass.html

so the db connection can be closed.  Also, exposing SQL to your actions 
tightly couples them to any changes you make to your database schema.  A

useful pattern used to prevent this is called Data Access Object
http://developer.java.sun.com/developer/restricted/patterns/DataAccessOb
ject.html

David


>Hi,
>Im just now converting to rc1.3 and find that findDataSource is
>deprecated.  How do you find one of many datasources?
>
>FYI:
>--
>I have a separate class called Database with method runQuery that
>returns a resultset to my ActionForm class, I only pass DBName and
>QueryString as parameters.  So my previous code where:
>In ActionForm:
>ResultSet rs = Database.runQuery("logondb", "select username, password
>from users where username = '" + uname + "'");
>
>Many thanks in advance.
>Johan Wasserman.


_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


-
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: [newbie] Finding datasource from pool in struts-config

2003-03-24 Thread Johan Wasserman
Sorry, that's in Struts 1.1 rc3 that I found
ActionServlet.findDataSource deprecated
 
-Original Message-
From: Johan Wasserman 
Sent: 24 March 2003 14:58
To: '[EMAIL PROTECTED]'
Subject: [newbie] Finding datasource from pool in struts-config
 
Hi,
How do you connect to a specific datasource pool (as configured in
strusts-config).
 
I have two pools specified;
key="logindb"
key="userdb"
 
ActionServlet.findDataSource is depreciated in rc 1.3
 
Thanks in advance.
Johan Wasserman


[newbie] Finding datasource from pool in struts-config

2003-03-24 Thread Johan Wasserman
Hi,
How do you connect to a specific datasource pool (as configured in
strusts-config).
 
I have two pools specified;
key="logindb"
key="userdb"
 
ActionServlet.findDataSource is depreciated in rc 1.3
 
Thanks in advance.
Johan Wasserman


[newbie] findDataSource deprecated?

2003-03-24 Thread Johan Wasserman
Hi,
Im just now converting to rc1.3 and find that findDataSource is
deprecated.  How do you find one of many datasources?
 
FYI:
--
I have a separate class called Database with method runQuery that
returns a resultset to my ActionForm class, I only pass DBName and
QueryString as parameters.  So my previous code where:
In ActionForm:
ResultSet rs = Database.runQuery("logondb", "select username, password
from users where username = '" + uname + "'");
 
Many thanks in advance.
Johan Wasserman.


problem converting resultset to RowsetDynaClass

2003-03-19 Thread VAN DEN BROEK, Johan
Hello,

I 'm experiencing problems with RowSetDynaClass. When I try to convert a
resultset containing a tinyint, I get the following errormessage:

org.apache.jasper.JasperException: Cannot assign value of type
'java.lang.Short' to property 'btTaal_ID' of type 'java.lang.Integer'

Everything else is working fine. 

I'm using Struts 1.1 rc1, tomcat 4.18, mysql jdbc 3.06, mysql 3.23.52

Johan


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



RE: Retrieving Request Values After Validation (DynaValidatorForm)

2003-03-19 Thread Johan Wasserman
Hi, 

> Thanks to
> Rick Reumann's tutorials I have been able to figure out
DynaValidatorForms
> and Validator.

where can I find these tutorials?

Thanks,
Johan Wasserman

-Original Message-
From: Vinh Tran [mailto:[EMAIL PROTECTED] 
Sent: 13 March 2003 21:12
To: Struts Users Mailing List
Subject: RE: Retrieving Request Values After Validation
(DynaValidatorForm)

I may try that...for now i decided to put the attributes in session and
remove them after CRUD.  I don't like clogging up the session if I don't
have to so I may try your approach.

Thanks.

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 1:57 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Retrieving Request Values After Validation
(DynaValidatorForm)


One solution is to assign the URI of SetupMyFormAction as the
input instead of the .jsp page. By doing this, Struts will
forward the user to SetupMyFormAction if validation error occurs
which will prepopulate the form accordingly but will also retain
the users input.

robert

> -Original Message-
> From: Vinh Tran [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 13, 2003 1:37 PM
> To: [EMAIL PROTECTED]
> Subject: Retrieving Request Values After Validation
(DynaValidatorForm)
>
>
> I finally have the time to experiment with DynaValidatorForm.  Thanks
to
> Rick Reumann's tutorials I have been able to figure out
DynaValidatorForms
> and Validator.  Unfortunately I've encountered a problem with
retrieving
> request parameters after validation has occurred.
>
> Like lesson 3 in Rick's tutorial, I have a SetupMyFormAction in which
I
> prepopulate the form.  In this class I also set some supporting
request
> values, request.setAttribute("myattr", somevalue),  for the
corresponding
> JSP form page.  After validation I am forwarded back to my form but my
> supporting request parameters are no longer available.  I understand
why
> they would no longer exist but I am unsure as to where to reset these
> request values after validation.
>
> Vinh
>



-
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]



[newbie] Prepopulating a form

2003-03-19 Thread Johan Wasserman
Hi,
I need to populate a form from a StateBean (session) before displaying
it.
I cannot find anything to do it when using a FormBean (request) since
the bean is initialised when loading the form and no methods are
available to read the StateBean from the session (or so I think), any
suggestions will be welcome.
 
Thanks in advance.
 
Johan Wasserman
 


Populating FormBean at Get time?

2003-03-18 Thread Johan Wasserman
Hi,
Here's my situation;
I have a StateBean that keeps track of values for a certain JSP sequence
in my app.  The Actions of these JSP's populates the StateBean as part
of their workflow.
Question:
How do I get data back from the StateBean (session) into the FormBean
(request) when I GET the JSP.  In other words, one.jsp saved CompanyName
to the StateBean, in ten.jsp, I need to get the CompanyName from the
StateBean into TenFormBean and display it on ten.jsp
 
Thanks in advance,
Johan Wasserman
 


htm:checkbox default value

2003-03-13 Thread Johan Kumps
Hi all,

I would like to use a checkbox on one of my pages. Default it should be
checked.

Please consider following :

ActionForm :

...
private boolean addToMailingList = true;
...
public boolean isAddToMailingList() {
return addToMailingList;
}

public void setAddToMailingList(boolean addToMailingList) {
this.addToMailingList = addToMailingList;
}
...
public void reset (ActionMapping mapping, HttpServletRequest request){
this.addToMailingList = false;
}

Code above works fine but how can I specify the default value is checked.
Using the code above the default value is false.

Any ideas what I'm doing wrong?

Please help me as soon.

Kind regards,
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003


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



JSP's behind WEB-INF no access to img/scripts

2003-03-13 Thread Johan Wasserman
Hi, I have my JSP's behind WEB-INF, is there a way of mapping other
directories behind WEB-INF so that the images and scripts included on my
JSP's can be accessed from there as well.  It's OK having the JSP's
there to stop external forces from accessing them directly but now they
can still access my images and scripts directly.
 
Regards,
Johan Wasserman


java.lang.IllegalArgumentException: No bean specified

2003-03-09 Thread Johan Kumps
Hi all,

I have following problem :

java.lang.IllegalArgumentException: No bean specified
at
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUti
ls.java:816)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:846)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:978)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:779)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:246)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)

Any ideas of what is going wrong here?

Kind regards and thanks in advance,
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003


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



RE: Validation problem

2003-02-20 Thread Johan Kumps
no app did not complain

-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:55
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem


Did the  tag cause your app to complain about not having
the resources loaded?

- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:51 PM
Subject: RE: Validation problem


> I implemented your second option.
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:35
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?
>
> 1)  If you changed your JSP to  or
> something, keep this in mind: I use a class called "Constants" for each
web
> app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
> sure that my JSP has the correct text.  What is the name of the
property/key
> you're assigning the error to?
>
> 2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale is
> right and your Resource bundle has the appropriate text key?
>
> Try throwing this code in your JSP:
>
>  scope="application">
>   
> ERROR:  Language independent messages not loaded -- contact
> administrator
> for assistance.
>   
> 
>
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:25 PM
> Subject: RE: Validation problem
>
>
> > Thanks for your help.
> >
> > My jsp is displaying : ???nl_BE.error.invalid.email???
> >
> > Still something wrong. It seems my key is not found.
> >
> > Can you help me again please?
> >
> > Kind regards,
> >
> > -Oorspronkelijk bericht-
> > Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> > Verzonden: donderdag 20 februari 2003 22:15
> > Aan: Struts Users Mailing List
> > Onderwerp: Re: Validation problem
> >
> >
> > When you add your error message to the errors object, you are specifying
> > Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have
to
> do
> > something like
> >
> >  to get that SPECIFIC error.  If you
> > switch to ActionErrors.GLOBAL_ERROR it will display all of them with
just
> > 
> >
> >
> > - Original Message -
> > From: "Johan Kumps" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 20, 2003 4:02 PM
> > Subject: Validation problem
> >
> >
> > > Hi all,
> > >
> > > I have a problem displaying error messages. Why is my message not
> > displayed?
> > > Am I doing somthing wrong?
> > >
> > > Please help me, I'm loosing time with this one...
> > >
> > > Please consider following code :
> > >
> > > Form class :
> > >
> > > ...
> > >
> > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > > request) {
> > > ActionErrors errors = new ActionErrors();
> > >
> > > if(email == null || !checkEmail(email)) {
> > > errors.add(Action.ERROR_KEY, new
> > > ActionError("error.invalid.email"));
> > > }
> > > return errors;
> > > }
> > >
> >
> > > JSP :
> > >
> > > 
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---
> > Incoming mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
> >
> > ---
> > This mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe

RE: Validation problem

2003-02-20 Thread Johan Kumps
I implemented your second option.

-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:35
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem


Did you switch to ActionErrors.GLOBAL_KEY or change your JSP code?

1)  If you changed your JSP to  or
something, keep this in mind: I use a class called "Constants" for each web
app and refer to Constants.LOGINERROR_KEY in my code, but I have to make
sure that my JSP has the correct text.  What is the name of the property/key
you're assigning the error to?

2)  If you shifted to ActionErrors.GLOBAL_KEY, are you sure your locale is
right and your Resource bundle has the appropriate text key?

Try throwing this code in your JSP:


  
ERROR:  Language independent messages not loaded -- contact
administrator
for assistance.
  



- Original Message -----
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:25 PM
Subject: RE: Validation problem


> Thanks for your help.
>
> My jsp is displaying : ???nl_BE.error.invalid.email???
>
> Still something wrong. It seems my key is not found.
>
> Can you help me again please?
>
> Kind regards,
>
> -Oorspronkelijk bericht-
> Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
> Verzonden: donderdag 20 februari 2003 22:15
> Aan: Struts Users Mailing List
> Onderwerp: Re: Validation problem
>
>
> When you add your error message to the errors object, you are specifying
> Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to
do
> something like
>
>  to get that SPECIFIC error.  If you
> switch to ActionErrors.GLOBAL_ERROR it will display all of them with just
> 
>
>
> - Original Message -
> From: "Johan Kumps" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 20, 2003 4:02 PM
> Subject: Validation problem
>
>
> > Hi all,
> >
> > I have a problem displaying error messages. Why is my message not
> displayed?
> > Am I doing somthing wrong?
> >
> > Please help me, I'm loosing time with this one...
> >
> > Please consider following code :
> >
> > Form class :
> >
> > ...
> >
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> > ActionErrors errors = new ActionErrors();
> >
> > if(email == null || !checkEmail(email)) {
> > errors.add(Action.ERROR_KEY, new
> > ActionError("error.invalid.email"));
> > }
> > return errors;
> > }
> >
>
> > JSP :
> >
> > 
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
> ---
> This mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003
>
>
> -
> 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]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




RE: Validation problem

2003-02-20 Thread Johan Kumps
Thanks for your help.

My jsp is displaying : ???nl_BE.error.invalid.email???

Still something wrong. It seems my key is not found.

Can you help me again please?

Kind regards,

-Oorspronkelijk bericht-
Van: Ian Hunter [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 februari 2003 22:15
Aan: Struts Users Mailing List
Onderwerp: Re: Validation problem


When you add your error message to the errors object, you are specifying
Action.ERROR_KEY instead of ActionErrors.GLOBAL_ERROR -- so you'd have to do
something like

 to get that SPECIFIC error.  If you
switch to ActionErrors.GLOBAL_ERROR it will display all of them with just



- Original Message -
From: "Johan Kumps" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 4:02 PM
Subject: Validation problem


> Hi all,
>
> I have a problem displaying error messages. Why is my message not
displayed?
> Am I doing somthing wrong?
>
> Please help me, I'm loosing time with this one...
>
> Please consider following code :
>
> Form class :
>
> ...
>
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
> ActionErrors errors = new ActionErrors();
>
> if(email == null || !checkEmail(email)) {
> errors.add(Action.ERROR_KEY, new
> ActionError("error.invalid.email"));
> }
> return errors;
> }
>

> JSP :
>
> 


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




Validation problem

2003-02-20 Thread Johan Kumps
Hi all,

I have a problem displaying error messages. Why is my message not displayed?
Am I doing somthing wrong?

Please help me, I'm loosing time with this one...

Please consider following code :

struts-config.xml :

...


...

  

...

Form class :

...

public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();

if(email == null || !checkEmail(email)) {
errors.add(Action.ERROR_KEY, new
ActionError("error.invalid.email"));
}
return errors;
}

private boolean checkEmail (String email) {
if ((email != null) && (email.trim().length() != 0)){
String stukNaAt = null;
if (email.indexOf("@") != -1){
stukNaAt = email.substring(email.indexOf("@"));
} else {
return false;
}
if ((email.indexOf("@") != email.lastIndexOf("@")) ||
(email.indexOf(" ") != -1) ||
(stukNaAt.indexOf(".") == -1)
(stukNaAt.indexOf(".") == stukNaAt.length() -1) ||
(email.trim().charAt(email.trim().length()-1) =='.') ) {
return false;
}
} else {
return false;
}
return true;
}

...

ApplicationResources.properties in /WEB-INF/classes

error.invalid.email=Please provide us with a valid e-mail address.

JSP :




---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




Email validation example (Struts newbie)

2003-02-19 Thread Johan Kumps
Hi all,

I'm having problems with validation of an field.

Can you give me an example of how to use ? Please give me a
code snippet of the form, the action, jsp, properties file and
struts-config.

Thanks in advance,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




RE: HELP! get request parameter from a custom tag

2003-02-14 Thread Johan Kumps
This code snippet should do the job.

String value = pageContext.getRequest().getParameter("paramname");

Kind regards

-Oorspronkelijk bericht-
Van: Kevin Williams [mailto:[EMAIL PROTECTED]]
Verzonden: zaterdag 15 februari 2003 0:23
Aan: [EMAIL PROTECTED]
Onderwerp: HELP! get request parameter from a custom tag


 Hi,

I apologize if this already was posted...I posted this earlier today, but
did not get see it posted...

If anyone can help me with this, it's stopping me from finishing key
portions of my applicaiton!

 I'm new to struts, and I am trying to retrieve a parameter that is in
 the request scope from a tag library.  Currently, I can print out the
 parameter on my jsp page using request.getParameter(name), but in my
 pageContext object in my tag library, I don't have the same list or
 request paramters, all I have are the Struts Form object, Bean object,
 and Error object.

 Somewhere Struts has overriden the default request object, and
 implemented it's own before my custom tag is called.  Would someone
 please tell me how I can retrieve the JSP page's request attributes in my
custom tag?

 Thanks in advance,

 Kevin Williams




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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




Tag question

2003-02-12 Thread Johan Kumps
Title: Gletsjer



Hi all,
I'm using the jakarta mailer taglib. But I 
have a problem with specifiying the path to the file to be attached to the 
e-mail I send.
Please consider following code :
<%String path = "data/myapp" + "/myFile.txt";%>
    to="you@mydomain.be" from="me@mydomain.be" 
subject="mail taglib" server="mailhost"> 
MyMessage 
 
file='<%=path%>'/> 
    
Kind regards,


RE: no selection (Struts 1.1b2)

2003-01-31 Thread Johan Kumps
Thanks for your help.

It's working fine now.

Kind regards

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 23:03
Aan: [EMAIL PROTECTED]
Onderwerp: RE:  no selection (Struts 1.1b2)


You override the reset method to set unchecked value.

1. You know how many elements in your array, so instantiates your array.
2. You know the unchecked value of each element, so do a loop and set
default value to each element.



Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:58 PM
To: Struts Users Mailing List
Subject: RE:  no selection (Struts 1.1b2)

Sorry,

Can you give an example?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:57
Aan: [EMAIL PROTECTED]
Onderwerp: RE:  no selection (Struts 1.1b2)


Then set unchecked value.

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:53 PM
To: Struts Users Mailing List
Subject: RE:  no selection (Struts 1.1b2)

I do not have a default value. The user can choose between two options. He
can select both checkboxes, one of both or none.

What is going wrong?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:49
Aan: [EMAIL PROTECTED]
Onderwerp: RE:  no selection (Struts 1.1b2)


In reset method of your ActionForm, set default value of checkbox.

Regards,


PQ

"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]]
Sent: January 31, 2003 4:47 PM
To: Struts mailing
Subject:  no selection (Struts 1.1b2)

Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...




...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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




RE: no selection (Struts 1.1b2)

2003-01-31 Thread Johan Kumps
Sorry,

Can you give an example?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:57
Aan: [EMAIL PROTECTED]
Onderwerp: RE:  no selection (Struts 1.1b2)


Then set unchecked value.

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]] 
Sent: January 31, 2003 4:53 PM
To: Struts Users Mailing List
Subject: RE:  no selection (Struts 1.1b2)

I do not have a default value. The user can choose between two options. He
can select both checkboxes, one of both or none.

What is going wrong?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:49
Aan: [EMAIL PROTECTED]
Onderwerp: RE:  no selection (Struts 1.1b2)


In reset method of your ActionForm, set default value of checkbox.

Regards,


PQ

"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]]
Sent: January 31, 2003 4:47 PM
To: Struts mailing
Subject:  no selection (Struts 1.1b2)

Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...




...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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




RE: no selection (Struts 1.1b2)

2003-01-31 Thread Johan Kumps
I do not have a default value. The user can choose between two options. He
can select both checkboxes, one of both or none.

What is going wrong?

Johan

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 31 januari 2003 22:49
Aan: [EMAIL PROTECTED]
Onderwerp: RE:  no selection (Struts 1.1b2)


In reset method of your ActionForm, set default value of checkbox.

Regards,


PQ

"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Johan Kumps [mailto:[EMAIL PROTECTED]]
Sent: January 31, 2003 4:47 PM
To: Struts mailing
Subject:  no selection (Struts 1.1b2)

Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...




...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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




no selection (Struts 1.1b2)

2003-01-31 Thread Johan Kumps
Hi all,

It seems that my setXxx method in my form bean is not called when I do not
check any checkboxes in the multibox.

Please consider following code :

...




...


...
private String[] myHandlers = {};
...
public void setMyHandlers (String[] myHandlers) {
this.myHandlers = myHandlers;
}

public String[] getMyHandlers() {
return this.myHandlers;
}
...

Am I doing somthis wrong here?

Please help me with this one.

Kind regards,
Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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




RE: DispatchAction error handling how to?

2003-01-26 Thread Johan Kumps
Could you please help me with an example of error handling using a
dispatchAction using the declarative exception handling?

Many thanks in advance,

Kind regards

-Oorspronkelijk bericht-
Van: Johan Kumps [mailto:[EMAIL PROTECTED]]
Verzonden: zondag 26 januari 2003 22:29
Aan: Struts Users Mailing List
Onderwerp: RE: DispatchAction error handling how to?


Hi,

No I'm using beta 2 of Struts. I'll try to use beta 3

I keep you in touch.

Kind regards,

-Oorspronkelijk bericht-
Van: Rick Reumann [mailto:[EMAIL PROTECTED]]
Verzonden: zondag 26 januari 2003 22:27
Aan: Struts Users Mailing List
Onderwerp: Re: DispatchAction error handling how to?


On Sun, Jan 26,'03 (09:43 PM GMT+0100), Johan wrote:

> Hi all,
>
> Can somebody please trow a light on error handling using a
> DispatchAction. The class org.apache.struts.actions.DispatchAction in
> Struts  1.1b2 is catching an InvocationTargetException. So when the
> 'dispatchMethod' invokes a method that throws an exception, it's
> catched here.
>
> How can I do some specific error handling? I don't want to code any
> catches in my action classes. How can I catch an exception in my
> DispatchAction?
>
> Why is org.apache.struts.actions.DispatchAction catching an
> InvocationTargetException?

Are you using beta3 of struts1.1? If so you could use declarative
exception handling in your config.xml just like you would for any other
action. It works perfectly. Let me know if you have any more questions.


--
Rick

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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




RE: DispatchAction error handling how to?

2003-01-26 Thread Johan Kumps
Hi,

No I'm using beta 2 of Struts. I'll try to use beta 3

I keep you in touch.

Kind regards,

-Oorspronkelijk bericht-
Van: Rick Reumann [mailto:[EMAIL PROTECTED]]
Verzonden: zondag 26 januari 2003 22:27
Aan: Struts Users Mailing List
Onderwerp: Re: DispatchAction error handling how to?


On Sun, Jan 26,'03 (09:43 PM GMT+0100), Johan wrote:

> Hi all,
>
> Can somebody please trow a light on error handling using a
> DispatchAction. The class org.apache.struts.actions.DispatchAction in
> Struts  1.1b2 is catching an InvocationTargetException. So when the
> 'dispatchMethod' invokes a method that throws an exception, it's
> catched here.
>
> How can I do some specific error handling? I don't want to code any
> catches in my action classes. How can I catch an exception in my
> DispatchAction?
>
> Why is org.apache.struts.actions.DispatchAction catching an
> InvocationTargetException?

Are you using beta3 of struts1.1? If so you could use declarative
exception handling in your config.xml just like you would for any other
action. It works perfectly. Let me know if you have any more questions.


--
Rick

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


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




DispatchAction error handling how to?

2003-01-26 Thread Johan Kumps
Hi all,

Can somebody please trow a light on error handling using a  DispatchAction.
The class org.apache.struts.actions.DispatchAction in Struts  1.1b2 is
catching an InvocationTargetException. So when the 'dispatchMethod' invokes
a method that throws an exception, it's catched here.

How can I do some specific error handling? I don't want to code any catches
in my action classes. How can I catch an exception in my DispatchAction?

Why is org.apache.struts.actions.DispatchAction catching an
InvocationTargetException?

Kind regards,
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 21/01/2003


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to send a html form from an action

2003-01-24 Thread Johan
Thanx,
But I was just trying to outsmart myself and I was pretty successfull in 
it to.

Since people need to choose what paymentmethode they prefer (it was 
about sending a form to a payment system) I still need an extra page 
where the can choose and I put the hidden fields in a form.

So I run into a new problem which I have solved using basic html tags is 
that the value of the action inside an  or  is 
changed when parsed. my action should be 
action="https://www.e-gold.com/sci_asp/payment.asp"; but struts start 
complaining about it can not find 
"/https://www.e-gold.com/sci_asp/payment";. It removes .asp from the 
action but in the web.xml I only send *.do to the strutsservlet???

But as I said i now just use basic html tags to solve this little 
shortcomming.

Johan

Pani, Gourav wrote:
I don't see why not.  The Form object/DynaValidatorForm will capture the
data, the Action object can do the update to your database and then you can
set up a global-mapping to go to the ne page with hidden values in the
request.  Then it is up to the other page to get values out of your request.

-Original Message-
From: Johan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003 6:48 AM
To: [EMAIL PROTECTED]
Subject: How to send a html form from an action


I try to submit a HTML FORM to an external site. I would like an Action 
to create the FORM Fields and send this form to the external site. I 
don't want de jsp-page send the form since I need to store the data from 
that form in a database before sending the data to the external site.

Is it posible to populate a Form and send it to an URL using a form?

Johan

---
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
e: mailto:[EMAIL PROTECTED]


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

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






--
---
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
e: mailto:[EMAIL PROTECTED]


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




How to send a html form from an action

2003-01-24 Thread Johan
I try to submit a HTML FORM to an external site. I would like an Action 
to create the FORM Fields and send this form to the external site. I 
don't want de jsp-page send the form since I need to store the data from 
that form in a database before sending the data to the external site.

Is it posible to populate a Form and send it to an URL using a form?

Johan

---
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
e: mailto:[EMAIL PROTECTED]


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



Exception handling - DispatchAction

2003-01-23 Thread Johan Kumps
Hi all,

I have following problem.

In my Action class I'm calling a bussiness method that can throws a checked
exception. I want to display this exception to the user on a user friendly
page without the stacktrace. Because I have many action classes I don't want
to code try catch blocks in all these action classes to catch the checked
exception. I'm using a dispatch action so I can code several bussiness
actions in one action class.

Any ideas to solve my problem?

Kind regards,

Johan
---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003


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




Re: Struts Productivity Survey

2003-01-10 Thread Johan
Greg,
You have a big problem. The hardest thing is not learning new stuff but 
estimating the learning curve for others. Personally it took me about 2 
weeks to grasp the concepts and getting up to speed. Why two weeks, 
because people are banging on my door waiting for me when I have 
finished the product. So I have to. When I try to learn something just 
to learn something it takes months.

What you can do is take a few ( max 4 ) people and ask them to build a 
struts application within 4 weeks max. Changing you should do in small 
steps. And watch their progress. Next you can add another 4 to that 
small team and let them start building the first part. See how it's 
going and you can make a more relaible estimate. Tell your boss that you 
can only estimate by trying in small. If he agree at this point you have 
already 8 people who have used the framework. And since your program 
isn't only about struts, but also on java and more start with those who 
know java. Then those who know C++.

And those who only know VB there is some bad news. For me it took about 
two years of studing the java architecture and language before I was 
comfortable in programming java. And I had only MS Access and some VB 
experience

Hope it's helpfull

Johan

[EMAIL PROTECTED] wrote:
Well, the question was somewhat, but not entirely hypothetical.  The 50 is probably more like 30.  The problem is really another "my framework is better than yours" debate and we're pushing to use a Struts-based framework going forward instead of a home-grown.  One of my tasks is to quantify how long it will take developers to get up to speed on Struts to estimate the cost of moving over.

I learned Java, JSP/Servlets, and Struts pretty much all at the same time, and it clicked easily for me.  But I learn new things easily and am not intimidated by new things.  Others seem to have had varying levels of difficulty picking it up.  The team that I worked on back then had little trouble with it.



-Original Message-
From: Haseltine, Celeste [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 10, 2003 10:04 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts Productivity Survey


Greg, 

Wow, I don't envy your assignment.  There is one thing that I 
have learned
over the years as both a developer and project manager, 
people learn at
different rates, and pick up new skills very differently.

In the case of the people who only know C++, the transition 
to Java will not
be difficult.  If they have had no exposure to HTML and web 
development,
then the transition to JSP's will take them a little longer.  
I've know some
really good low level C++ programmers who just cannot get the 
hang of HTML,
much less the tag library underlying struts.  These guys are 
better suited
for the server side and EJB side of development.

As for the VB programmer, your job is going to much more 
difficult.  Many of
the VB programmers I have meet over the past 2 years have had 
no exposure or
training in Object Oriented Programming (OO).  Many have 
moved to VB from
mainframe jobs that they started back in the 70's and 80's.  
For those on
your staff who have had exposure to C++ in college, the move 
to Java will
probably be easier than for those on your staff you have come from a
mainframe background.

As to Struts, JSP's and the tag libraries.  You are looking 
at training
these people in ALL three of these concepts/technology.  I 
would strongly
suggest that you start out your training class in JSP's using 
the Model 1
concept the first few days, and then introduce Struts and the JSP tag
libraries for the duration of the training course.

In all, my experience in training people in a combination of 
on the job and
classes has been as follows:

For those with heavy C++ experience, moving to 
Java/JSP/Servlets/HMTL took
about month before these people were productive.

For those with some exposure to C++ and OO, but no work 
experience, it took
about 2 months for these people to be productive.

For those with no exposure to C++ and OO (mainframe 
background), it took
anywhere from 4 months to 9 months before these people were 
really useful
and productive in the work environment.  A lot depended on 
the attitude of
the person, and their willingness to learn new programming 
skills AND new
programming/software concepts, particularly OO.  If you can 
get over the
hurdle of the OO concepts, then you are 2/3 of the way there.

If you add struts and HTML to the equation, I would add an 
extra 2 to 4
weeks, before the staff is really productive and useful in the work
environment.  

Keep in mind again that people learn at different rates, and 
that they learn
in different ways.  The approach you take to exposing and 
training these
people may not work for the entire group, and you may need to 
take extra
time and try different approaches with some in the group.

Good luck, this is one assig

Re: XSLT Struts

2003-01-08 Thread Johan
ROSSEL Olivier wrote:

That would be the past IMO. Apache HTTP and Cocon and similar 
are PITA.

... you can publish static text from Struts like this:
- Store XML content in a db field. (from user input or RSS feed).
- XSLT it and cache HTML cache in a db field.
Or many variations such as Styxx browser side.

You can now approve it, secure it, WIKI it, RSS feed it, 
count clicks, 
find matching advertisements to display, display it in a struts tile 
that users can move around like my.netscape.com.

I would say it is a good practice to use Struts with XML for 
delivery of 
static and dynamic content.


Cocoon is great if your input is already XML.
Cocoon is a fully-XML framework.
And its cache management can't be beat.



The problem I'm facing is that I don't want to put xml documents inside 
a database. This because the fact that there are a lot of documents in 
various formats. So we want to convert those documents to XML. And use 
cocoon to publish those documents. Plus those documents are written by 
people using their average wordprocessor or in the futere a 
wordprocessor which can do XML. We don't want them to feed a Database.

But another part of the website is an application which will be written 
with struts. Now I don't think it is a solution to XML the output from 
struts (I just understant the struts-tag libraries and the struts-layout 
library, I don't want to learn XSP/XForms etc yet) and render it with 
cocoon.

What is wrong with using struts and cocoon mixed together. For me it's 
just a few extra steps to forward an struts action to JSP page that 
produces XML output which will be forwarded to cocoon. Especially when 
it is an form where users have to provide input which needs to be 
processed by a struts action.

On the other side I think it's worthwile when a result of a struts 
action is a XML document, is to render that document with cocoon. So 
levering the power of both frameworks.

Question is if it is possible to render part's of a page with struts and 
 another part with cocoon which are combined within a tiles-definition.

Johan
---
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
w: http://www.nilling.nl
e: mailto:[EMAIL PROTECTED]




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



Re: XSLT Struts

2003-01-07 Thread Johan
[EMAIL PROTECTED] wrote:

here we go
http://www.javaworld.com/javaworld/jw-02-2002/strutsxslt/jw-0201-strutsxslt.
zip
http://www.oroad.com/opencode/stxx/download.html

these are two custom approachs (both with java sources), but if I can tell
my feeling on the question, I suggest -if your app is "large"- that you feed
cocoon with you're serialized XML ... but I don't own such an example.




I agree on using cocoon for publishing XML data. But IMHO we shouldn't 
mix two parts of the universe to much. Struts for webapplications and 
cocoon as a publishing framework.

I just started developing webapplications with struts. It's great for 
the application-part of the website, but for the publishing of static 
text I don't see much advantage using struts. For that I see a great 
advantage in using cocoon.

Now I didn't use cocoon yet. But for me the ideal combination would be 
that I could insert into a tiles-definition a jsp-page, a struts-action, 
a tiles-definition or a xml page. The first three would be handled by 
struts and the xml-page by cocoon.

Have anyone experience with this kind of use with cocoon and struts?

Johan

---
Nilling Software Design
Postbus 43
2280 AA  Rijswijk ZH
www: http://www.nilling.nl
epost: mailto:[EMAIL PROTECTED]


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



Re: Learning Struts

2002-11-26 Thread Johan
Eric,
I'm facing the same problem. I just started a week ago and found a few
pages on O'Reilly very usefull. As we speak I am one part 3 and building
my first Strtuts application

Check out the following urls
http://www.oreillynet.com/pub/a/onjava/2001/09/11/jsp_servlets.html

It's part one of a 3 part piece and there are 2 more about struts 1.1

Have fun

Johan

Eric Tse wrote:
> Dear all,
> 
> I am interested in learning struts framework and tried to search some articles and 
>kick-start my journey. However, it seems to me that all of the tutorial gave me much 
>information for the MVC architecture which I know already.
> 
> Do you have any simple war/jar file for my learning? I read through the 
>struts-example.war already. It does not give me guidance to me to learn. Anyone can 
>help?
> 
> Thanks a lot.
> 
> Eric




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




Re: J2EE-compliant class loading

2002-11-26 Thread Johan Eltes
This is going slightly OT :-)
Maybe I should switch to J2EE-INTEREST...

And I was responding to your statement on having multiple versions of the
same library in the same ear (i.e. In different modules of an ear). I would
say that the J2EE spec clearly advices component providers not to rely upon
this to work in all J2EE app servers. From your comments, this restriction
seem to be un-necessary for web modules.

Bottom line is that the class loader problem is fixed in struts 1.1. It
seems to be a general policy of the different apache projects (noticed that
log4j has also switched to using the thread context class loader for loading
resources).

We'll live with the patched 1.0.2 until 1.1. is released.

/Johan

 

Den 02-11-26 19.32, skrev "Craig R. McClanahan" <[EMAIL PROTECTED]>:

> 
> 
> On Tue, 26 Nov 2002, Johan Eltes wrote:
> 
>> Date: Tue, 26 Nov 2002 18:48:33 +0100 (CET)
>> From: Johan Eltes <[EMAIL PROTECTED]>
>> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>>  Johan Eltes <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>> Subject: Re: J2EE-compliant class loading
>> 
>> My understanding of the J2EE spec is that it may add restrictions /
>> requirements on top of the bundled specification. An application server
>> (including its containers) must implement restrictions imposed by the
>> J2EE spec to be compliant. It is not necessarily enough to fully
>> implement all bundled specs.
>> 
> 
> I'm quite familiar with these requirements (my "day job" is web layer
> architect for the J2EE platform at Sun :-).
> 
>> There are several examples of restrictions following this pattern. JDBC
>> 2.0 is another bundles specification of J2EE 1.3. The JDBC spec does
>> not mandate support for batch update. The J2EE specification requires
>> (J2EE compliant) JDBC drivers to support batch update.
>> 
> 
> I was responding to your concern that J2EE apps could not make the
> assumption that there was a separate class loader per web application,
> when in fact there must be one in all J2EE-compliant app servers (as well
> as any stand-alone servlet container that is tested against the servlet
> TCK tests).
> 
> For EJBs and other J2EE components, there are definitely fewer assumptions
> you can make.  But webapps wouldn't work at all according to the servlet
> spec if they were loaded from a single class loader.
> 
>>  /Johan
>> 
> 
> Craig
> 
> 
>> citerar "Craig R. McClanahan" <[EMAIL PROTECTED]>:
>> 
>>> 
>>> 
>>> On Tue, 26 Nov 2002, Johan Eltes wrote:
>>> 
>>>> Date: Tue, 26 Nov 2002 07:15:14 +0100
>>>> From: Johan Eltes <[EMAIL PROTECTED]>
>>>> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
>>>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>>>> Subject: Re: J2EE-compliant class loading
>>>> 
>>>> Den 02-11-26 00.47, skrev "Craig R. McClanahan"
>> <[EMAIL PROTECTED]>:
>>>> 
>>>>> 
>>>>> IMHO, however, sharing JAR files has a very serious drawback,
>> IMHO --
>>> it
>>>>> *forces* a cross dependency between webapps that is not otherwise
>>>>> necessary.  Web appliations should be designed to be as completely
>>>>> independent of each other as possible, so that you can do things
>> like
>>>>> upgrade the Struts version in a suite of apps one application at a
>>> time,
>>>>> without forcing them to *all* be upgraded at once.
>>>>> 
>>>> 
>>>> I'm not sure it is valid to assume that multiple wars within an ear
>> could
>>>> use different versions of struts on their respective WEB-INF/lib.
>> The
>>> J2EE
>>>> spec (1.3) states:
>>>> 
>>>> "There must be only one version of each class in an application. If
>> one
>>>> component depends on one version of an optional package, and another
>>>> component depends on another version, it may not be possible to
>> deploy an
>>>> Application Assembly application containing both components. A J2EE
>>>> application should not assume that each component is loaded in a
>> separate
>>>> class loader and has a separate namespace."
>>>> 
>>> 
>>> You might want to review section 9 of the Servlet Spec, which (among
>> other
>>> things) specifically describes the class loader that a servlet
>> container
>>> (in a J2EE server or not doesn't matter) is required to provide to
>> each
>>> web application.
>>> 
>>>> /johan
>>> 
>>> Craig
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <mailto:[EMAIL PROTECTED]>
>>> For additional commands, e-mail:
>>> <mailto:[EMAIL PROTECTED]>
>>> 
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>> 
>> 
> 


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




Re: J2EE-compliant class loading

2002-11-26 Thread Johan Eltes
My understanding of the J2EE spec is that it may add restrictions / 
requirements on top of the bundled specification. An application server 
(including its containers) must implement restrictions imposed by the 
J2EE spec to be compliant. It is not necessarily enough to fully 
implement all bundled specs.

There are several examples of restrictions following this pattern. JDBC 
2.0 is another bundles specification of J2EE 1.3. The JDBC spec does 
not mandate support for batch update. The J2EE specification requires 
(J2EE compliant) JDBC drivers to support batch update.

 /Johan

citerar "Craig R. McClanahan" <[EMAIL PROTECTED]>:

>
>
> On Tue, 26 Nov 2002, Johan Eltes wrote:
>
> > Date: Tue, 26 Nov 2002 07:15:14 +0100
> > From: Johan Eltes <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: Re: J2EE-compliant class loading
> >
> > Den 02-11-26 00.47, skrev "Craig R. McClanahan" 
<[EMAIL PROTECTED]>:
> >
> > >
> > > IMHO, however, sharing JAR files has a very serious drawback, 
IMHO --
> it
> > > *forces* a cross dependency between webapps that is not otherwise
> > > necessary.  Web appliations should be designed to be as completely
> > > independent of each other as possible, so that you can do things 
like
> > > upgrade the Struts version in a suite of apps one application at a
> time,
> > > without forcing them to *all* be upgraded at once.
> > >
> >
> > I'm not sure it is valid to assume that multiple wars within an ear 
could
> > use different versions of struts on their respective WEB-INF/lib. 
The
> J2EE
> > spec (1.3) states:
> >
> > "There must be only one version of each class in an application. If 
one
> > component depends on one version of an optional package, and another
> > component depends on another version, it may not be possible to 
deploy an
> > Application Assembly application containing both components. A J2EE
> > application should not assume that each component is loaded in a 
separate
> > class loader and has a separate namespace."
> >
>
> You might want to review section 9 of the Servlet Spec, which (among 
other
> things) specifically describes the class loader that a servlet 
container
> (in a J2EE server or not doesn't matter) is required to provide to 
each
> web application.
>
> > /johan
>
> Craig
>
>
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> 


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




Re: J2EE-compliant class loading

2002-11-25 Thread Johan Eltes
Den 02-11-26 00.47, skrev "Craig R. McClanahan" <[EMAIL PROTECTED]>:

> 
> IMHO, however, sharing JAR files has a very serious drawback, IMHO -- it
> *forces* a cross dependency between webapps that is not otherwise
> necessary.  Web appliations should be designed to be as completely
> independent of each other as possible, so that you can do things like
> upgrade the Struts version in a suite of apps one application at a time,
> without forcing them to *all* be upgraded at once.
>

I'm not sure it is valid to assume that multiple wars within an ear could
use different versions of struts on their respective WEB-INF/lib. The J2EE
spec (1.3) states:

"There must be only one version of each class in an application. If one
component depends on one version of an optional package, and another
component depends on another version, it may not be possible to deploy an
Application Assembly application containing both components. A J2EE
application should not assume that each component is loaded in a separate
class loader and has a separate namespace."

/johan


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




Re: J2EE-kompliant class loading

2002-11-25 Thread Johan Eltes
Thanks.
I'm looking forward to start using 1.1.

> 
> If I were the admin of an app server like this, you'd have to seriously
> twist my arm to put struts.jar in a shared repository.  To me, the pain is
> not worth the gain.
>

To me, there is a significan't differense in putting struts.jar in a shared
repository on the app server level versus having it as a dependent jar
within an enterprise application archive. The concept of dependent jars
within the J2EE spec was specifically designed to remove the need for
complex build scripts that copies all shared jars into every j2ee component
and yet keeps autonomicity at the enterprise archive level. My intention was
not to argue about the validity of this mechanism. It's there and should be
supported by frameworks intended to be used in J2EE environment. Although I
can see the point in keeping autonomicity at the war level, many, many
developers are happy keeping it at the ear level.

/Johan 


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




J2EE-kompliant class loading

2002-11-25 Thread Johan Eltes
Hi!

Are there any plans to change the class loading (or more generally, loading
resources through class loaders) in struts to be J2EE compliant?
I here the frustration from many developers getting the infamous
ClassNotFoundException when they use standard J2EE deployment of classes.

The only supported scenario for Struts seem to be:

Ear>
...War1>WEB-INF>lib>struts.jar
..>classes>my.subclass.of.struts.action.class
...War2>WEB-INF>lib>struts.jar
..>classes>my.subclass.of.struts.action.class

Typically, an enterprise application uses dependent jars, to avoid multiple
copies of the same library. In addition, there is often a need to implement
a generic, but yet application specific abstract subclass of the struts
Action class. Such generic application classes used to be deployed in a
dedeicated dependent jar, referenced (e.g. by inheritence) from various
UI-specif classes hosted in various Web-apps:

Ear>
struts.jar (dep. jar)
myframwork_with_myactionbase.jar (dep. jar)
War1>WEB-INF>classes>my.first.subclass.of.MyActionBase.class
>META-INF>MANIFEST.MF (with Class-Path entry referencing dep.jars)
War2>WEB-INF>classes>my.second.subclass.of.MyActionBase.class
>META-INF>MANIFEST.MF (with Class-Path entry referencing dep.jars)

However, Struts can not be deployed as a dependent jar, since struts loads
classes (Action-classes and Actionform classes) through the application
class loader instead of the thread context class loader. The J2EE spec
indicates that the thread context class loader should be used for class
loading. 

I patched struts to use the thread context class loader - and voala - all
class loading issues where gone. The scenario above ran like a charm, as
expected. 

I often use Tomcat for development and various J2EE servers for deployment.
It seems that Tomcat (when run standalone) does not set up a proper thread
context class loader. For struts to run well in Both Tomcat and in a J2EE
environment, Struts could use a strategy to first load resources through the
thread context class loader and then try the application class loader as a
fallback, in case resources are not found. It used the following helper
class to patch struts. The patched version runs well in both J2EE servers
and Tomcat standalone. I replaced all calls to

Class.forName(String name)
with a call to
ClassLoaderHelper.classForName(String name)

I didn't (but should) patch the class to resource bundles.

Is this planned to be fixed in struts 1.1?

/johan

public class ClassLoaderHelper {
  public static Class classForName(String className) throws
ClassNotFoundException {
try {
  return Class.forName(className,true,getThreadContextClassLoader());
}
catch (ClassNotFoundException cnfe) {
  return Class.forName(className,true,getClassLoader());
}
  }

  public static InputStream getResource(String name) {
InputStream resource =
getThreadContextClassLoader().getResourceAsStream(name);
if (resource == null) {
  return getClassLoader().getResourceAsStream(name);
} else return resource;
  }

  public static ClassLoader getThreadContextClassLoader() {
return Thread.currentThread().getContextClassLoader();
  }

  public static ClassLoader getClassLoader() {
return ClassLoaderHelper.class.getClassLoader();
  }
}


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




RE: template and I18N

2001-05-30 Thread Johan Compagner

look at the bean:message tag:



johan


> -Original Message-
> From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 2:12 PM
> To: [EMAIL PROTECTED]
> Subject: template and I18N
> 
> 
> Hi all, 
> 
> I've just started to use Struts and I have some questions:
> 
> 
> 1. How can I use the I18N features in the template tags?
> 
> In my template.jsp I've got the following tag:
> 
> 
> 
> In the page using this teplate the following:
> 
> 
> 
> I'd like to replace the German text 'Kalkulation' with its
> key e.g. 'app.title.calculation' Is there a nice way to do this?
> 
> 
> 
> 2. How can I use use the I18N features in Struts directly
> in Java Scriplets? 
> 
> Sometimes I need the translated texts in scriplets. What is 
> the best way to access them?
> 
> Now I am using this aproach:
> 
> <%
> 
>   MessageResources resources =
> (MessageResources) pageContext.getAttribute(
> Action.MESSAGES_KEY, PageContext.APPLICATION_SCOPE);
> 
>   Locale locale = 
> (Locale) pageContext.getAttribute(
>Action.LOCALE_KEY, PageContext.SESSION_SCOPE);
> 
>   if (null == locale) {
> locale = request.getLocale();
>   }
> 
>   String myText = resources.getMessage(locale, "app.the.text,key");
> 
> %>
> 
> Thanks for an answer
> 
> --
> gR
> 
> 
> 
> 
> 



Re: VAJ 3.5.3 and WTE "cant remove Attributes from request scope"

2001-05-21 Thread Johan Compagner



Yes this is a bug in the WTE (and also in 
Tomcat3.1, IBM hasn't upgraded some classes)
If you want to be able to run them change the 
pageContext.x(REQUEST_SCOPE) calls
to do it directy to the request is 
self.
 
johan
 

  - Original Message - 
  From: 
  Kenneth Petersen 
  
  To: [EMAIL PROTECTED] 
  
  Sent: Sunday, May 20, 2001 6:40 PM
  Subject: VAJ 3.5.3 and WTE "cant remove 
  Attributes from request scope"
  After finally being able to run the HelloWorld from the 
  Bluestone Software's "Welcome to the Struts Framework" trail, I get the 
  following error message when trying to use ActionMapping as described in step 
  4 of the same trail:Message: Server caught unhandled 
  exception from servlet [jsp]: cant remove Attributes from request 
  scopeThe full path of the Exception is at the bottom. The 
  Exception is thrown with in the FormTag.doEndTag() method. To be more specific 
  the commands that are not processed succesfully 
  are:pageContext.removeAttribute(Constants.BEAN_KEY,   
  PageContext.REQUEST_SCOPE);pageContext.removeAttribute(Constants.FORM_KEY,    
  PageContext.REQUEST_SCOPE);Have anyone have simular problems? Any 
  ideas on a solution to the problem would be 
  welcomed.RegardsKPRoot Error-1: cant remove 
  Attributes from request scopejava.lang.IllegalArgumentException: cant 
  remove Attributes from request scope java.lang.Throwable(java.lang.String) 
  java.lang.Exception(java.lang.String) 
  java.lang.RuntimeException(java.lang.String) 
  java.lang.IllegalArgumentException(java.lang.String) void 
  org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String, 
  int) int org.apache.struts.taglib.html.FormTag.doEndTag() void 
  _input_xjsp._jspService(javax.servlet.http.HttpServletRequest, 
  javax.servlet.http.HttpServletResponse) void 
  org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest, 
  javax.servlet.http.HttpServletResponse) void 
  javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse) void 
  org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest, 
  javax.servlet.http.HttpServletResponse, boolean) void 
  org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest, 
  javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, 
  boolean) void 
  org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest, 
  javax.servlet.http.HttpServletResponse) void 
  javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse) void 
  com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse) void 
  com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse) void 
  com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engine.webapp.StrictLifecycleServlet, 
  javax.servlet.ServletRequest, javax.servlet.ServletResponse) void 
  com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse) void 
  com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse, 
  com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void 
  com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.servlet.engine.webapp.ServletInstanceReference, 
  javax.servlet.ServletRequest, javax.servlet.ServletResponse, 
  com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void 
  com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse, 
  com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent) void 
  com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(com.ibm.servlet.engine.webapp.WebAppRequest, 
  javax.servlet.http.HttpServletResponse, boolean) void 
  com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse, boolean) void 
  com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet.ServletRequest, 
  javax.servlet.ServletResponse) void 
  com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Object) 
  void 
  com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lang.Object) 
  void 
  com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.String, 
  com.ibm.servlet.engine.srp.ISRPConnection) void 
  com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(com.ibm.servlet.engine.oselistener.api.IOSEConnection) 
  void 
  com.ibm.servlet.engine.http_transport.HttpTra

RE: connection pool problem (with Beta release)

2001-05-16 Thread Johan Compagner

Debug through it and look what kind of rows are really selected from the db
the first time.
I have seen this behaviour many times but it was always a caching problem at
the browser site. Because the selected data was right the first time.

johan


> -Original Message-
> From: Gogineni, Pratima [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 16, 2001 2:11 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: connection pool problem (with Beta release)
>
>
>
> Okay another symptom - the problem persists even when i set the
> isolation to
> read_uncommitted.
>
> -Original Message-
> From: Gogineni, Pratima
> Sent: Tuesday, May 15, 2001 3:35 PM
> To: '[EMAIL PROTECTED]'
> Subject: connection pool problem (with Beta release)
>
>
> I have a very odd problem - I was hoping the symptoms sound familiar to
> someone on the list...
>
> I display a database table to the user in the jsp page
> the user can insert/delete or update into this table - this is sent to an
> action class that uses the struts connection pool and executes the
> appropriate sql statement
> After executing the sql statement I go back to jsp page that displays the
> data in the table.
>
> my problem is that I need to query the database twice before the
> new data is
> shown (for example if I add row#11). I see only 10 rows the first time I
> query the database after the insert statemetn is executed. The
> second time I
> query the database I get all 11 rows.
>
> I have autoCommit set to false. I call the commit() method on the
> connection
> after the insert statement is executed and I have the transaction
> isolation
> set to TRANSACTION_READ_COMMITTED.
>
> Another symptom is that I dont always see this problem - only in
> some runs,
> which leads me to suspect that this is a threading issue?
>
> Does anyone know what the problem could be / what I should check/lookout
> for?
>
> Thanks
> Pratima
>
> -Original Message-
> From: Roy Truelove [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 14, 2001 7:51 PM
> To: [EMAIL PROTECTED]
> Subject: Web design forum / listserv
>
>
> Hey guys,
>
> I'd like to know if anyone knows of a listserv / forum /
> newsgroup that
> deals solely with web application design philosophies, and not necessarily
> with their implementations.  I read several lists (this one, Turbine, JSP,
> barracuda,) and most of the traffic is geared toward problems *using* the
> framework.  A place where people could go and discuss things like MVCm2,
> push/pull etc. I believe would be very beneficial.  If someone knows of a
> forum like this, please let me know.
>
> Thanks!
> -Roy




Re: Where are the TLD's?

2001-05-14 Thread Johan Compagner

hmmm

that's why i don't get them, i don't use the build process.
I use VAJ so i just import all the java files to get a complete build.

I shall download the binary and src then

johan

- Original Message - 
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 13, 2001 11:13 PM
Subject: Re: Where are the TLD's?


> The tlds are generated during the build process. For example,
> struts-bean.xml is processed with tld.xsl to create struts-bean.tld. The
> same XML document is processed with a different stylesheet to generate the
> taglib documentation. This means that only the one XML file has to be
> updated when a tag is added or changed.
> 
> --
> Martin Cooper
> 
> 
> - Original Message -
> From: "Johan Compagner" <[EMAIL PROTECTED]>
> To: "Struts" <[EMAIL PROTECTED]>
> Sent: Saturday, May 12, 2001 1:24 AM
> Subject: Where are the TLD's?
> 
> 
> > Now the sources are not in the binary's anymore (i didn't check this but i
> think it is true)
> > I download only the sources, because that is what i really need.
> >
> > But i see that the sources don't contain the tld's!
> > Now i still have to download the binary's also, of course you can say, why
> do you care?
> > But if the binary's don't contain the sources anymore, i would love to
> have the
> > sources contain all the resources files that is needed for struts.
> >
> > johan
> >
> >
> 
> 




Where are the TLD's?

2001-05-12 Thread Johan Compagner

Now the sources are not in the binary's anymore (i didn't check this but i think it is 
true)
I download only the sources, because that is what i really need.

But i see that the sources don't contain the tld's!
Now i still have to download the binary's also, of course you can say, why do you care?
But if the binary's don't contain the sources anymore, i would love to have the
sources contain all the resources files that is needed for struts.

johan





Re: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)

2001-05-11 Thread Johan Compagner

That i already have of course!
but it would be nice to have this in the basic. without altering Struts all the time 
when a new version arrives.

johan

- Original Message - 
From: "Nanduri, Amarnath" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 8:14 PM
Subject: RE: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)


> Its opensource. you can always modify it for your needs.
> 
> cheers,
> Amar..
> 
> -Original Message-
> From: Johan Compagner [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 1:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Constants.TOKEN_KEY value proposed change (doesn't work
> with javascript!!)
> 
> 
> It would be nicer to have a name for this that is a bit better suited for
> javascript!
> 
> johan
> 
> - Original Message - 
> From: "David Winterfeldt" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 11, 2001 5:56 PM
> Subject: Re: Constants.TOKEN_KEY value proposed change (doesn't work with
> javascript!!)
> 
> 
> > You can do this.
> > 
> > document.nextpage["org.apache.struts.taglib.html.TOKEN"].value=themakey;
> > 
> > David
> > 
> > --- Johan Compagner <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > 
> > > I use the token_key for transaction support.
> > > But the value of the TOKEN_KEY =
> > > org.apache.struts.taglib.html.TOKEN
> > > 
> > > This is a very odd value to have as a hidden input
> > > field on your form.
> > > Which is generated by the FormTag:
> > >  > > name="org.apache.struts.taglib.html.TOKEN"
> > > value="">
> > > 
> > > Because you want to use that hidden field in some
> > > javascript:
> > > function submitNextpage(themakey)
> > > {
> > > 
> > >
> > document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
> > > document.nextpage.submit();
> > > }
> > > 
> > > You get a javascript error!
> > > Because javascript sees all names between points as
> > > an object.
> > > 
> > > Please change the TOKEN_KEY value in "TOKEN_KEY" or
> > > something like that!!
> > > 
> > > Johan Compagner
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great prices
> > http://auctions.yahoo.com/




Re: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)

2001-05-11 Thread Johan Compagner

It would be nicer to have a name for this that is a bit better suited for javascript!

johan

- Original Message - 
From: "David Winterfeldt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 5:56 PM
Subject: Re: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)


> You can do this.
> 
> document.nextpage["org.apache.struts.taglib.html.TOKEN"].value=themakey;
> 
> David
> 
> --- Johan Compagner <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > I use the token_key for transaction support.
> > But the value of the TOKEN_KEY =
> > org.apache.struts.taglib.html.TOKEN
> > 
> > This is a very odd value to have as a hidden input
> > field on your form.
> > Which is generated by the FormTag:
> >  > name="org.apache.struts.taglib.html.TOKEN"
> > value="">
> > 
> > Because you want to use that hidden field in some
> > javascript:
> > function submitNextpage(themakey)
> > {
> > 
> >
> document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
> > document.nextpage.submit();
> > }
> > 
> > You get a javascript error!
> > Because javascript sees all names between points as
> > an object.
> > 
> > Please change the TOKEN_KEY value in "TOKEN_KEY" or
> > something like that!!
> > 
> > Johan Compagner
> > 
> > 
> > 
> > 
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/




Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)

2001-05-11 Thread Johan Compagner

Hi,

I use the token_key for transaction support.
But the value of the TOKEN_KEY = org.apache.struts.taglib.html.TOKEN

This is a very odd value to have as a hidden input field on your form.
Which is generated by the FormTag:


Because you want to use that hidden field in some javascript:
function submitNextpage(themakey)
{
document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
document.nextpage.submit();
}

You get a javascript error!
Because javascript sees all names between points as an object.

Please change the TOKEN_KEY value in "TOKEN_KEY" or something like that!!

Johan Compagner








Re: please help...this doesn't want to display the exception, is this correct?

2001-05-09 Thread Johan Compagner

ActionError constructor wants a message key. not just a string.
you could do:

errors.add("beanErr",new ActionError("general.exception",ex.toString()));

and then have a general.exception in youre resouce bundle:
general.exception="An exception occured: {0}"

johan

- Original Message -
From: "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 10:55 AM
Subject: please help...this doesn't want to display the exception, is this
correct?


> } catch (Exception ex) {
>   ex.printStackTrace();
>   errors = new ActionErrors();
>   errors.add("beanErr",new ActionError(ex.toString()));
> }
>




Re: Antwort: RE: Visual Age 3.5.3 & Tomcat with Struts

2001-05-01 Thread Johan Compagner

Here you have 2 versions of Tomcat 3.2.2b3 Test Environments
one one stripped version: www.techfo.nl/jcom/tomcatstripped.zip
and full src version: www.techfo.nl/jcom/tomcatfullsrc.zip
(for the full src you need JAXP/Parser also in the workspace)

Johan Compagner

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 01, 2001 5:14 AM
Subject: Re: Antwort: RE: Visual Age 3.5.3 & Tomcat with Struts



> 1.) Install Tomcat 3.1 Test Environment & look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to
> find IVJJavaCompiler.java

Tomcat Test Environment won't install on top of VA 3.5.3.  It says that the
correct version
of VisualAge is not installed, and exits the installer application.  Any
ideas on how to
trick the Tomcat Test Environment installer?  It says it expects VisualAge
3.5, but
apparently doesn't recognize 3.5.3 :<

- Darren

P.S.
Thanks for the very detailed message on how to get things going with VA and
Tomcat.




Juergen.Walter
@hrmcon.deTo:
[EMAIL PROTECTED]
  cc:
04/27/01 04:49Subject: Antwort: RE: Visual
Age 3.5.3 & Tomcat with Struts
AM
Please respond
to struts-user









Hi Darren,

we're using VAJ 3.5.2 Enterprise with Tomcat and Struts. First we tried to
run Struts 1.0b1 with Tomcat Test Env 3.1 but unfortunately Struts does not
work with Tomcat 3.1's XML-Parser. If you want you can make a XML
(javax.xml.*) & SQL (javax.sql.*) package and put it into Tomcats ./lib
directory and add it to VAJ's classpath. But if you use Tomcat 3.2.1,
struts works out of the box - but not that comfortable as the Tomcat Test
Env does, e.g. you can't debug JSP and Servlet Code anymore :(((
I did a hack (in Tomcats WebReaderXML.java to enable "jspPageCompiler"
again) and added "com.ibm.ivj.tomcat.IJVJavaCompiler" again to re-enable
in-workspace JSP and Servlet Debugging.

Running Tomcat 3.2.1 in VAJ 3.5.x
~~~
In short:
0.) Prerequisites:
  * latest jakarta-servlet-api _source_
  * tomcat 3.2.1 binary distribution (includes ./src already)
  * Tomcat 3.1 Test Environment from www.ibm.com/vadd (to get
"com.ibm.ivj.tomcat.IVJJavaCompiler.java")
  * struts 1.0b1 source distribution
1.) Install Tomcat 3.1 Test Environment & look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to find
IVJJavaCompiler.java
2.) Start VAJ, do _not_ "Add feature Apache Test Env 3.1"!!!
3.) Create new Package, e.g. Apache_Tomcat_321
4.) Import all source from jakarta-servlet-api (do _not_ use servlet-api
from VAJ or other precompiled javax.servlet.* - classes; they _must_ be
compiled within VAJ Workspace to enable debugging of your own servlets and
JSPs) into your Project
5.) import following --> compiled classes (not source!) <- from jasper.jar
and webserver.jar  (both in tomcat-3.2.1/lib/)
jasper: all .class
webserver: org.apache.tomcat.logging.Logger,
org.apache.tomcat.logging.LogHelper, org.apache.tomcat.util.SimplePool
If VAJ still complains about missing classes (you see this in "All
Problems" - Tab) import compiled .class files from ./lib/*.jar until VAJ is
happy.
6.) create two classes: StartTomcat & StopTomcat (code is the same for
both!)

public class StartTomcat {
/**
 * StartTomcat constructor comment.
 */
public StartTomcat() {
 super();
}
/**
 * Starts the application.
 * @param args an array of command-line arguments
 */
public static void main(java.lang.String[] args) {
 // Insert code to start the application here.
 try {
  Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
  java.lang.reflect.Method method = null;
  Class[] argsClass = new Class[] { String[].class };
  method = aClass.getMethod("main", argsClass);
  Object object = null;
  Object[] arguments = new Object[] { args };
  method.invoke(object, arguments);
 } catch (Exception e) {
  System.out.println("Exception occured: " + e.getMessage());
  e.printStackTrace();

 }
}
}

Right click StartTomcat in VAJ and goto "Properties-Classpath": have
follwing files and dirs in classpath:

.;
..\Apache_Struts;
..\IBM IDE Utility class libraries;
..\JSP Page Compile Generated Code;
.\;
.\conf\;
.\src\;
.\lib\jaxp.jar;
.\lib\parser.jar;
.\lib\webserver.jar;
.\lib\jasper.jar;
.\webapps\;
.\webapps\admin\;
.\webapps\admin\WEB-INF\classes\;
.\webapps\examples\;
.\webapps\examples\WEB-INF\classes\;
..\IBM IDE Utility local implementation\;

And in Properties-Programm have no arguments for StartTomcat and "-stop"
for StopTomcat. Also have "tomcat.home=." in "(java)Properties window"

7.) 

i want the jsp pages to be updateable (from internet,browser)

2001-04-17 Thread Johan Compagner



Hi,
 
When i include my jsp inside a war file i really 
don't know where those files are unpacked (if they are unpacked)
But if i want my jsp's to be updateable from the 
internet (uploading)
where must i put my jsp's?
 
Can i for example put my jsp's inside a DB and then 
have some common class
that will supply a jsp pages for a Container (like 
tomcat but others must also be possible)
I don't think this is caputered in an interface of 
jsp/servlet isn't it?
This is left to the container builder?
 
How do you guy's do it?
 
Don't use a war file?
But a normal directory so that i know where 
everything is and i know where to save the uploaded jsp's?
 
any idee's?
 
johan
 


Re: Data Connection Pool, solution?

2001-04-17 Thread Johan Compagner

there should be another attribute  in the datasource like this:

testSql="select * from test"

and GenericConnection has a setTestSql(String) method 
and that test method is executed right before the connections is given to the
request in getConnection()
When it fails it closed and tries another one (or opens another one)
So anyone can decide there own test method/sql statement, because
i don't think there is a common one.

Only some rules must be set:
Must the testSQL string return a result set and must it have one result
if not it is the same as failing?

This would be a nice addition to struts 1.0!

Johan Compagner



>  
>   autoCommit="false"
>description="Interbase Data Source"
>driverClass="interbase.interclient.Driver"
>maxCount="4"
>minCount="0"
>url="jdbc:interbase://path/to/database"
>user="username"
>password="password"
>   />
>  
> 
> Anthony
> 
> It is by caffeine alone I set my mind in motion.
> It is by the Beans of Java that thoughts acquire speed,
> the hands acquire shaking, the shaking becomes a warning.
> It is by caffeine alone I set my mind in motion.
> 




Re: vs.

2001-04-13 Thread Johan Compagner

form taglib is depricated everthing is in the html package now.

- Original Message - 
From: "Stanley Tan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 13, 2001 9:33 AM
Subject:  vs. 


> What's the difference between  and  ?
> 
> The documentation does not even mention of a "form" taglib!
> 
> 




Re:

2001-04-12 Thread Johan Compagner

Now i think of it is it possible to supply only a hashmap to 
and that the key's are the property (the keys) and the value the labels?

now i always have 3 methods to fill in a combo:

getXxxxId
getXxxxIds
getXxxxLabels

johan

- Original Message -
From: "Jim Crossley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2001 7:03 AM
Subject: Re: 


> If you change staffIds to a Collection, i.e. staffIds.entrySet(), I
> *think* this will work:
>
> <% Set set = staffIds.entrySet(); %>
> 
>   
> 
>
> Anthony Martin wrote:
> >
> > I can't figure out the struts way to do this:
> >
> >
> >  > scope="request">
> >   > />">
> > 
> >
> >
> > The staffIds bean property is a hashtable.  I wanted to use
 or
> > even  but the syntax eludes me.  I can change the
hashtable to
> > some type of collection, but this way the screen looks right.  The
> > functionality of repopulate is missing, though because I'm not allowing
> > struts to render the .  Any ideas?
> >
> > Anthony
> >
> > It is by caffeine alone I set my mind in motion.
> > It is by the Beans of Java that thoughts acquire speed,
> > the hands acquire shaking, the shaking becomes a warning.
> > It is by caffeine alone I set my mind in motion.
>




RE: Is Struts with Websphere that slow ? - any other problems?

2001-04-09 Thread Johan Compagner

3.5.2 is not the right version i believe (maybe it works maybe it doesnt)
because websphere only supports jsp1.1/servlet2.2 with 3.5.3 (tag support)

johan


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 4:48 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Is Struts with Websphere that slow ? - any other problems?
> 
> 
> hi,
> 
> are there any major problems with websphere and struts?
> I am especially interested in known problems with WAS AE 3.5.2 on
> Solaris.
> 
> Thanks,
> 
> -hendrik
> 



Re: troubles with Tomcat

2001-04-06 Thread Johan Compagner

Seet mod_jk 
many articles on the jakarata site

johan

- Original Message - 
From: "ntrgiang" <[EMAIL PROTECTED]>
To: "Struts-User" <[EMAIL PROTECTED]>
Sent: Friday, April 06, 2001 5:17 PM
Subject: troubles with Tomcat


> Hi, thanks for reading my message
> 
> When I test some JSP pages, I use Tomcat as my JSP container (without
> Apache)and everything is OK. But in the real world if I want to deploy my
> application on the web, how can I use Tomcat with Apache? Are there any
> differences between Tomcat Standalone version and Tomcat runs with Apache?
> Thanks for your guides
> Giang Nguyen
> 
> 
> 
> 




Re: Bug in tomcat or the JDK (testing it on 1.2.2)

2001-03-28 Thread Johan Compagner

ahh but if that is the case. how much data must be send to the client
before it does noticed it?
Because at this time the it is bufferd to a 8Kb buffer before it sends out
but if the client can figure it out with say 1Kb then why wait for a buffer of 8KB to
be read before sending it?

I tracked it already down to the BufferedServletOutputStream.write(byte[],int,int)
and the the reallyFlush() method can't be called twice. now i know why

Johan


- Original Message - 
From: "Szlapa, Michael" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 4:51 PM
Subject: RE: Bug in tomcat or the JDK (testing it on 1.2.2)


> That is not the bug. It's a feature ;-). 
> 
> When your browser realizes that it already has a copy of given file in
> browser cache, it abruptly closes the connection in order not to waste time
> and bandwidth. This causes exception on the server (tomcat) side of the
> connection. It is plainly cosmetic nuisance.
> 
> There is plenty of information on this on the web if you run the search on
> "tomcat socket write error"
> 
> Hope it helps,
> 
> Michael Szlapa
> [EMAIL PROTECTED]
> 
> -Original Message-
> From: Johan Compagner [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 28, 2001 9:49 AM
> To: Struts
> Subject: Bug in tomcat or the JDK (testing it on
> 1.2.2)
> 
> Hi,
> 
> If i use Tomcat as a static (gifs) and dynamic (jsp) server,
> that is mostly
> used inside a debugging evironment or maybe if it is
> specified that everything
> in the webapp\app dir must be served by tomcat (still find
> this a very bad idee),
> then i noticed that i get socket exceptions on specifiek
> files those files have
> something in common they are the larger files in my app:
> 31290 and 23281 bytes
> 
> this is the error:
> 2001-03-28 04:40:07 - Ctx( /financialtools ): IOException
> in: R( /financialtools + /overlib.js + null) socket write error
> (code=10053)
> 
> Then i went testing in the source code of
> org.apache.tomcat.request.FileHandler where it is thrown.
> And after sometesting i found out that a picture can't be
> larger then 16383 because if it is 16384
> then an exception will be thrown. I tested this with the
> read in buffer:
> byte[] buf = new byte[16383];
> 
> if that number is larger then 16383 i wil get a exception
> when i write it.
> so if i keept it 16383 then the first write to
> out.write(buf, 0, read); will pass
> but the next bloc will fail. And if i make it 16384,
> out.write(buf, 0, read); will fail the first time!
> 
> As far as i can see now it comes from the jdk it self:
> 
> java.net.SocketException: socket write error (code=10053)
> java.lang.Throwable(java.lang.String)
> java.lang.Exception(java.lang.String)
> java.io.IOException(java.lang.String)
> java.net.SocketException(java.lang.String)
> void java.net.SocketOutputStream.socketWrite(byte [], int,
> int, java.io.FileDescriptor) <---
> void java.net.SocketOutputStream.write(byte [], int, int)
> void
> org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int,
> int)
> void
> org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int,
> int)
> void
> org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush()
> void
> org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int)
> void
> org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Reque
> st, org.apache.tomcat.core.Response)
> 
> 
> So is this a bug of Tomcat or the JDK it self? But can't
> send more then 16K? that is a bit strange.
> 
> I know this is not a tomcat list but when developing with
> struts i came accross this and i don't want
> to have another list that i have to monitor and i know there
> are a few tomcat developers here.
> 
> Johan
> 
> 




Bug in tomcat or the JDK (testing it on 1.2.2)

2001-03-28 Thread Johan Compagner

Hi,

If i use Tomcat as a static (gifs) and dynamic (jsp) server, that is mostly
used inside a debugging evironment or maybe if it is specified that everything
in the webapp\app dir must be served by tomcat (still find this a very bad idee),
then i noticed that i get socket exceptions on specifiek files those files have
something in common they are the larger files in my app: 31290 and 23281 bytes

this is the error:
2001-03-28 04:40:07 - Ctx( /financialtools ): IOException in: R( /financialtools + 
/overlib.js + null) socket write error
(code=10053)

Then i went testing in the source code of org.apache.tomcat.request.FileHandler where 
it is thrown.
And after sometesting i found out that a picture can't be larger then 16383 because if 
it is 16384
then an exception will be thrown. I tested this with the read in buffer:
byte[] buf = new byte[16383];

if that number is larger then 16383 i wil get a exception when i write it.
so if i keept it 16383 then the first write to out.write(buf, 0, read); will pass
but the next bloc will fail. And if i make it 16384, out.write(buf, 0, read); will 
fail the first time!

As far as i can see now it comes from the jdk it self:

java.net.SocketException: socket write error (code=10053)
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 java.io.IOException(java.lang.String)
 java.net.SocketException(java.lang.String)
 void java.net.SocketOutputStream.socketWrite(byte [], int, int, 
java.io.FileDescriptor) <---
 void java.net.SocketOutputStream.write(byte [], int, int)
 void org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte [], int, int)
 void org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte [], int, int)
 void org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush()
 void org.apache.tomcat.core.BufferedServletOutputStream.write(byte [], int, int)
 void org.apache.tomcat.request.FileHandler.doService(org.apache.tomcat.core.Request, 
org.apache.tomcat.core.Response)


So is this a bug of Tomcat or the JDK it self? But can't send more then 16K? that is a 
bit strange.

I know this is not a tomcat list but when developing with struts i came accross this 
and i don't want
to have another list that i have to monitor and i know there are a few tomcat 
developers here.

Johan





Re: Performance of struts

2001-03-22 Thread Johan Compagner

What the compiler of IBM does is that it also imports the generated java code
inside the ide, so that you can debug is. Therefore does ibm has it's own compiler.

Johan



- Original Message -
From: "Tom Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 22, 2001 7:30 PM
Subject: Re: Performance of struts


> Does anyone know how IBM VisualAge for Java's JSP compiler compares? Those using the 
>Tomcat Test Environment supplied by IBM have
the option to substitute com.ibm.ivj.tomcat.IVJJavaCompiler for the jspCompilerPlugin 
in Tomcat's conf/web.xml file.
>
> Actually, I'm using VAJ, and have experimented switching back and forth between 
>Jasper and the IBM compiler. Not sure I can see
great differences, but I haven't done any benchmarked comparison.
>
> So I'm wondering if anyone knows how these compare from an architectural point of 
>view, a look "under the covers", etc.
>
> --
> Tom Miller
> Miller Associates, Inc.
> [EMAIL PROTECTED]
> 641.469.3535 Phone
> 413.581.6326 FAX
>
>
>




Tomcat question

2001-03-21 Thread Johan Compagner

Hi,

One tomcat question for this list (i know there are some tomcat developers here)
Why can't i find changes.html or something like that for the tomcat versions?

You got now a 
3.1.x branch (doesn't seem to be in development anymore)
3.2.x branch (still development 3.2.2 beta 1 as latest mile stonde)
3.3.x branch (the latest in 3.x)

And you got 4.0

I know the differences between 3.x (servlet 2.2 / jsp 1.1) and 4.x (servlet 2.3 / jsp 
1.2)

But why all those 3.x branches and why are there even 2 in development?

Johan






BeanMessage Tag proposal

2001-03-16 Thread Johan Compagner

Hi,

When setting the args (arg0,arg1,arg2,arg3,arg4)
you must do this:


But i think it is very rare that you know exactly at design time of the jsp
what value there must be. Because if you do then why not set it directly in
the message it self?

So it is almost any time a runtime expression.
But then i must do things like this:







I must define

because i can't do this:
"

I find this a bug of the Tomcat parser if you ask me. Because if he sees
that it is a reqexpr (<%=)
then it should first find the %> before looking at the closing "!!

Because if these problems i wanted to find a solution
Why is is not possible that i get the Object[] from a name/property???
Then the BeanTag is also not limmited to only 5 args

My example for the above one:



and the insurance.getWacascoObjects() does return the Object[] for that
string:
object[0] = insurance.getProperty("totalautotheft");
object[1] = insurance.getProperty("autotheft");
return object;

Johan Compagner














Re: DefineTag.value question (proposal)

2001-03-13 Thread Johan Compagner

> > so not:
> > 
> >  // Retrieve the required property value
> >  Object value = this.value;
> 
> This will return null if you did not specify a "value" attribute, so the
> effect is the same as your desired result -- setting the new bean based on
> the name/property combination.


This is not my desired result because i want it to be a default value.
It should not ignore the name and property attributes if they are specified.


> >  // Retrieve the required property value
> >  Object value = null;
> > if(name != null)
> > value = RequestUtils.lookup(pageContext, name, property, scope);
> >  if (value == null)
> >   value = this.value;
> > 
> 
> This would reverse the priority of lookups, and make the string you
> specified for the "value" essentially a default if the specified property
> returns null.  That is different from the current behavior, and different
> from what is documented, but makes a certain kind of sense.

But the behaviour is not changed for all the application build today 
because None in using a name, value combo because at this time
that combo doesn't make any sense because it doesn't do a thing.

 
> What do people think about changing this?

You got my vote!

johan





DefineTag.value question (proposal)

2001-03-13 Thread Johan Compagner

Hi,

If i specify the value in the DefineTag then the name/property is ignored!!
But when i also specify the name/property then i want the value to be filled in when
name/property seems to be null!

so not:

 // Retrieve the required property value
 Object value = this.value;
 if (value == null)
  value = RequestUtils.lookup(pageContext, name, property, scope);

but:

 // Retrieve the required property value
 Object value = null;
if(name != null)
value = RequestUtils.lookup(pageContext, name, property, scope);
 if (value == null)
  value = this.value;

johan





Tomcat (servlet2.2 spec question)

2001-03-12 Thread Johan Compagner

Hi all,

Is it really true that everything that is in the webapp context must be served by the 
webapp?

Here our discussion with the support of ServletExec:

--
Hi,

Who has made that specification??
Because it it stupid.

Apache/IIS must do  the things they are goed at and that is serving static content.
ServletExec/Tomcat/JRun to name a few must do things they are good at and that is 
serving jsp/servlets

And saying that i must keep the images, static html ect ect in an other place is an 
enormous maintenance
and development problem. I want everything to getter what belongs to each other.

Apache with tomcat works perfectly the way i want.

Je specify a Alias in apache:

Alias /myprogram c:/tomcat/webapps/myprogram

And in the conf files of apache that is included in the httpd.conf of apache you say 
this;

JkMount /*.jsp ajp13
JkMount /*.do ajp13

That is the way it should work
Only the JSP's and the .do (struts framework redirects) are handled by tomcat the rest 
by tomcat.

And if i want to do the same with ServletExec then i must put the jsp ect in the
webapps/myprogram
and the rest in
/myprogramstatic?

And i must switch in both constantly pointing to each other?
What happens if
webapps/myprogram changes in
webapps/myprogram2 ?

Everything in /myprogramstatic my also change?
Because i can't use relative url's anymore??

Not to mention that in development you must do the same but there i use Tomcat as http 
server and app server.
And for every project i must have 2 context in tomcat. And they must be exactly the 
way be configured as the
deployment server! Horrible

Johan Compagner

- Original Message -
From: Unify Support
To: [EMAIL PROTECTED]
Sent: Friday, March 09, 2001 8:58 PM
Subject: Re: Information about coupling IIS and servletexec


Per the servlet 2.2 specification (see the last sentence of the first paragraph in 
section 9), all requests to a web application
context are directed to the servlet/JSP container. If you need objects to be served by 
the HTTP server, they will need to be outside
the web application (there is no reason why URLs in the web application cannot refer 
to objects outside said web application).


  Unify Support   [EMAIL PROTECTED]
  Support FAQhttp://www.servletexec.com/support/support-faq.jsp



-Original Message-
From: Albert Schreuder [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 11:10 AM
To: [EMAIL PROTECTED]
Cc: Johan Compagner
Subject: Information about coupling IIS and servletexec


Dear reader,

Today we tried to couple Servletexec with IIS 5.0, after some compiliation problems, 
we succeeded int this.

The ServletExec dll was indeed included in the ISAPI filter of the website.

But when we started testing, we got the idea, that all the information voor the 
webapplication was done by ServletExec. To our opion
also information like for example html and gif was done by ServletExec.

Now were we wondering if there is a way to configure the coupling between IIS and 
ServletExec, that only .jsp and .do files are
handled by ServletExec?

We hope we can get response from you soon, because this is a major item for us to go 
using ServletExec.

With kind regards,


Albert Schreuder
Topicus BV
Deventer, The Netherlands




RE: Business Object Bean Persistence Strategies

2001-03-09 Thread Johan Compagner

Hi,

Because i want Database Objects to control them self completely (like Enity
beans)
I must have a way to get Transaction support and make sure that in on thread
the same connection is being used. For example:

class Person
{
private String name;
private Country country;

public static Person findByPrimaryKey(int i)
{
Connection connection = datasource.getConnection();
// Select
Person person = new Person();
person.setName(rs.getString(1));
person.setCountry(Countr.findByPrimaryKey(rs.getInt(2)));
connection.close();
}
}

class Country
{
privatge String name

public static Country findByPrimaryKey(int i)
{
// Now another connection is being taken from the datasource
// if max == 2 then another call in this thread to the datasource
// will present a deadlock!!
Connection connection = datasource.getConnection();
// Select
Country country = new Country ();
/// Filling
connection.close()
return country;
}
}

So i want a datasource to return a connection that is already attached to
the
current thread.

Same goes for updating or inserting of data for example a new Person with a
new Country object that i want to insert into the database

person clas:
{
public void store()
{
Connection connection = datasource.getConnection();
// Before storing the country id the country must first be stored:
country.store();
// if all goes well:
// Store the person (insert into person values(?,?,?,?)
ps.setInt(2,country.getPrimaryKey());
// if not all goes well the connection.rollback must be called.
// but one problem the country was stored under a different connection
// so it will not be rolledback!!
}
}
country class
{
public void store()
{
// Another connection is taken so if it goes bad then you can't 
rollback
// everything!!
Connection connection = datasource.getConnection();
// Store the country (insert into person values(?,?,?,?)
}
}

To get around those above problems i am building a Transaction class.
This wraps around the Datasource
it has a static method:

public static Transaction startTransaction() // Only starts a transaction
onces for the current thread.

and the Transaction object has methods:

public Connection getConnection()
public void setRollbackOnly() // Error occured somewhere so only a rollback
allowed.
public int getStatus() // Must rollback, Healty.
public void rollback()
public void commit() // Can only do this if mustRollback == false else throw
exception
public void stopTransaction()

In the above examples i don't do
datasource.getConnection()
but
Transaction transaction = Transaction.startTransaction();
Connection connection = transaction.getConnection();
// Cannot call connection.close() , connection.rollback(),
connection.commit() directly!!!
transaction.stopTransaction();

If anyone is interrested or has some comments i am happy to hear it.

Johan

> -Original Message-
> From: Michael McCallister [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 08, 2001 11:19 PM
> To: [EMAIL PROTECTED]
> Subject: Business Object Bean Persistence Strategies
>
>
> What strategies or patterns do people use to manage persistence
> of business
> object data in a Struts application when there is no EJB layer
> and there is
> a desire to keep the business objects as independent of the web
> portion of
> the application as possible?  Do you use the Struts DataSource and pass
> either it or a Connection as a parameter to bean methods that take
> responsibility for managing persistence?  Do you follow the J2EE
> blueprint
> and create separate Data Access Objects to support persistence?  Are you
> using an open-source framework to manage persistence?  This seems like a
> common problem, but I haven't seen much talk about common solutions.
>
>
> Mike
>
>




Datasource proposal

2001-03-08 Thread Johan Compagner

Using another one is very difficult because how the properties are set.
(I want to use the org.apache.struts.sql one but this one has many more options
and totally different method names to set the properties (like url ect)

And also the open en close methods aren't called automaticly.

So i propose a new interface:

interface StrutsDataSource extends DataSource
{
open()
close()
setProperty(String str,String)
}

those property can be everything: url,driver class ect ect
exactly the things that can be specified in the struts-config.xml

Then the implementor must map the string "url" to it's own method.

Then struts must use this and handle this a bit different then now (it must
detect that the object is a StrutsDataSource and then not trying to set the properties
through PropertyUtil (or BeanUtil) but calling the setProperty method.

Johan




RE: Populating a Form

2001-03-07 Thread Johan Compagner

Mostly at my place this is nothing more then setting one id!!
I would love to have the abillity that i didn't need any action for this.

johan


> -Original Message-
> From: Michael McCallister [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2001 4:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Populating a Form
> 
> 
> I am strongly in favor of using two actions, one to pre-populate 
> the form, 
> the other to receive the user's input.  My rationale is that in 
> substantial 
> forms, there is enough logic involved in each of these activities that 
> lumping them together makes for an overly large and confusing Action.
> 
> 
> Mike
> 
> At 07:55 AM 3/7/2001, you wrote:
> >I guess my question is, how do most people handle the pre-population of 
> >data entry forms.
> 
> 



RE: Database pooling code

2001-03-07 Thread Johan Compagner

Do you just test the isClosed() method?
My plan was to execute a small sql code that has a very little overhead
and alway's returns normal for every db if the connection is still good.

But i don't know what kind of sql statement works for every db.

johan


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Matthias Bauer
> Sent: Wednesday, March 07, 2001 4:02 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Database pooling code
>
>
> Database pooling works pretty well for me. But there are some
> pitfalls, when a
> connection times out or the database server is restarted. As the
> framework does
> not check if a connection is still valid before returning it to
> the application
> you will run into an exception when trying to use a connection
> which has timed
> out or was closed due to some other reason on the server side.
>
> I know there was some discussion going on about this on the list
> in the past.
> There were some pros and cons about whether the framework should check the
> validity of a connection before returning it to the application.
> I patched the
> struts code in order to do this check and always return a valid connection
> (requires the jdbc driver Connection.isClosed() method to work
> correctly - some
> have a bug in their implementation). If you are interested in
> this little patch,
> please let me know.
>
> --- Matthias
>
>
> I patched
>
> Jim Richards wrote:
> >
> > Has anyone got the database pooling code/DataSource to work or
> specifically
> > had it fail?
> >
> > I've been having problems (documented previously) and I've read
> about a few others
> > who can't seem to get the pooling to work as well, and I want
> to get an idea
> > of specifically where the problem might lie in order to fix it.
> >
> > 
> > You are the simulacrum of my dreams
> >  and the signifier of my desires
> >
> > Mr Grumpy ... come and visit his home!
> > http://www.cyber4.org/members/grumpy/index.html
>




RE: Populating a Form (a proposal)

2001-03-07 Thread Johan Compagner

The last (using 2 actions) is how it is done in the struts example
(last time i checked) with registering or changing user data.

But i also would like to have a popuplate without going through a action.

Then i could request this:

userdata.jsp?userid=1

instead of this:

userdata.do?userid=1

The form has a setUserId(int i)

and populates itself from a database.

The problem with populating from a database is that if the form
is not created or accessed through a action the servlet variable is not
set!!
So i can't get the datasource!!

I have made my own Form tag that extends the Struts formtag.

public int doStartTag() throws JspException {
int iReturn = super.doStartTag();
Object bean = pageContext.getAttribute(Constants.BEAN_KEY);
if (bean instanceof ServletContextActionForm)
{
((ServletContextActionForm)
bean).setServletContext(pageContext.getServletContext());
}
/*
 maybe popuplate like this??
 RequestUtils.populate(((ServletContextActionForm) bean),
mapping.getPrefix(),
mapping.getSuffix(),
*/  pageContext.getRequest());
return iReturn;
}

As you can see i have implemented my own doStartTag() and if it is a special
actionform
i will set the servlet context so that ( if it works ) i can access
everything i want.

also calling populate is not implemented yet but it should work.

I would like to see this in Struts it self. Because for a very simple thing
like
filling a form that mostly is decided by a parameter like userid=X through
another
action object is very boring.

Johan

> -Original Message-
> From: James Howe [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2001 2:54 PM
> To: [EMAIL PROTECTED]
> Subject: Populating a Form
>
>
> I have what may be a stupid question regarding the usage of forms in
> Struts.  I have a web application which has a page displaying a list of
> items.  When the user clicks on one of the items I want to bring
> up a form
> which allows the user to edit the items.  Nothing too hard.  My
> question is
> about what the best way is to go about populating the form within the
> Struts framework.  If I were just displaying information, I would simply
> create an Action for the page which would populate a bean which
> would then
> be referenced by the corresponding JSP page.  However, since this is a
> form, I want to make use of Struts form handling capabilities.
> If I use a
> form action, the action occurs on submission.  How do I control
> the initial
> values of the form?
>
> One way that I can think of is to use some sort of "action"
> parameter.  If
> the action parameter is missing, the form action populates the bean
> properties, otherwise it saves the bean properties back to the
> system.  The
> problem I have with this approach is that I have to have a hidden
> field on
> the page which is used to store the "action" value.  It's not a big deal,
> but it seems clumsy.  The other approach I can think of is to have a
> regular action defined which is used to populate the page and a
> form action
> which is used for form submission.  This requires two actions for
> the same
> JSP but eliminates some of the funny business with hidden fields.
>
> I guess my question is, how do most people handle the pre-population of
> data entry forms.
>
> Thanks.
>
>




Re: VA Java and Struts without Tomcat / WebSphere

2001-03-05 Thread Johan Compagner



It doesn't work on the Websphere test environment 
in VAJ yet.
Because the websphere inside VAJ doesn't support 
JSP1.1 yet (only the real websphere does that)
you must wait for Fixpack3 that will get the test 
environment to the same level of Websphere 3.5.3
 
johan
 

  - Original Message - 
  From: 
  Don 
  Elliott 
  To: [EMAIL PROTECTED] 
  
  Sent: Monday, March 05, 2001 8:06 
AM
  Subject: VA Java and Struts without 
  Tomcat / WebSphere
  
  Hi Struts Users,
   
  Has anyone been able to install and use Struts 
  within the cut-down servlet engine shipped with VA Java ?  ie. without 
  installing Tomcat or Websphere ?  Does this work ?
   
  I understand the servlet engine shipped with VA 
  Java is a cut-down version of Websphere, and looking at all the feedback on 
  getting Websphere working I'm wondering if it is worth my while attempting to 
  do this.
   
  Regards,
  Don Elliott


Re: Admin actions

2001-03-03 Thread Johan Compagner



This would be very nice but remember that the 
struts-config.xml sits inside the war file
And you don't have any control over it then. Some 
containers extract it (like tomcat)
others work directly in it. And maybe other extract 
it to a internal database.
 
So what to update?
 
Maybe if struts build in functions that you store 
every setting to a database souce that is specified
and struts wants (a) specifiek table(s) for it and 
that are updated when you do addForm ect ect.
 
johan
 

  - Original Message - 
  From: 
  Dan Miser 
  To: [EMAIL PROTECTED] 
  
  Sent: Saturday, March 03, 2001 7:42 
  AM
  Subject: Admin actions
  
  I used the default 
  org.apache.struts.actions.AddFormBeanAction action (and others) from 
  1.0b1 with success. However, it appears that this just makes the added 
  FormBean available for the lifetime of the application. In other words, 
  struts-config.xml is not updated to reflect the dynamic actions you can take 
  in the actions package.
   
  I almost have a graphical interface to the admin 
  actions done, but in order to make it truly useful, I think automatic update 
  of the config file needs to happen on unload (or even before). Is there a 
  technical reason preventing this from happening, or is it just implemented 
  this way for now? If it turns out to be an omission, I'll implement that as 
  well to support the admin application.
   
  One other thing: I noticed that with Tomcat it's 
  possible to get a list of webapps defined for the engine. It appears that this 
  is not a J2EE standard. Is that correct? If so, the admin classes and config 
  file changes would need to happen on a per-webapp basis. I'd prefer to 
  walk through the webapps and have a "struts-admin.war" file to do all of 
  the administration. I just don't think that will be feasible in a portable 
  manner. Any opinions or advice?
   
  Thanks.
  --
  Dan Miser


Re: Class reloading?

2001-03-02 Thread Johan Compagner

> Tomcat 3.1 and 3.2 seem to reliably detect cases where the servlet class
> you are actually calling has been changed, but they do not always seem
> to catch the fact that other classes have been changed.
> 
> Tomcat 4.0 uses a different mechanism that reliably catches *all*
> changes to classes found in WEB-INF/classes.

But that is not needed. 
It is nice in a development environment but what happens if i update de war file
Is that detected and is it automaticly being extracted ect ect?

That is what's needed if you use tomcat for deployment also (in combo with apache)

johan





Re: Still need help with VAJ & Struts

2001-02-26 Thread Johan Compagner

> Have you heard about expected the time frame for patch3? That would be a
> nice thing to have.


The last thing i heard: Late februari (so that is pretty soon!)

johan





Re: Still need help with VAJ & Struts

2001-02-24 Thread Johan Compagner
Title: RE: Still need help with VAJ & Struts



The tomcat test environment of IBM for VAJ is still 
version 3.1.
I heard that after the release of patch3 (which 
also brings the internal Websphere TE to JSP1.1/Servlet2.2)
the will release another one with i presume the 
latest final (3.2.1)
 
Struts works perfectly well in VAJ. I work with it 
every day and it is very easy.
 
You have 4 projects and a updated Java Lib 
Classes one (or another seperate project for javax.sql.Datasource)
 
1> Tomcat Test Environment
2> Struts project (imported source of binary's, 
i preffer source)
3> You're project (with the \Web 
inf)
4> JAXP the XML parser ect.
 
5 or The updated Java Lib Classes in which i have 
the javax.sql and all the transaction pacakages.
 
Then alter the Tomcat Runner class in the Tomcat 
Test Environment classpath so that i uses all
those projects.
 
I have the struts.jar also in the \WEB-INF\lib dir 
but i don't think VAJ or Tomcat uses that because
i bug through the struts in internal the 
project.
 
I do think struts get's loaded with the system 
classloader. But why is that a bad thing in a development 
environment?
 
Johan
 

  - Original Message - 
  From: 
  Brugge, John 
  
  To: '[EMAIL PROTECTED]' 
  ; '[EMAIL PROTECTED]' 
  Sent: Friday, February 23, 2001 10:56 
  PM
  Subject: RE: Still need help with VAJ 
  & Struts 
  
  Tom, 
  We have Struts (Jan 16 build) and VAJ 
  3.5.2 working with the Tomcat Test Environment from IBM. It took a little 
  while to figure out, but we seem to have a repeatable process now. We started 
  with the "Mini-HOWTO" contributed by Nikolaus Rumm (http://kephera.dhs.org/services/vaj_jonas_struts_howto.htm) 
  and tweaked it a bit, since we weren't using Jonas. I'll attach our notes that 
  we kept on it if they provides any new insights for you.
  Note that we're not using vanilla 
  Tomcat 3.2.1, but rather whatever version IBM packaged in their "Tomcat Test 
  Environment" (which appears to be 3.2.x?). The installation of the TTE is much 
  simpler than the process described by Sheldon Wosnick in his VAJ & Tomcat 
  articles.
  Let me know if you still have any 
  problems, or if the Word doc doesn't come through, and maybe I can 
  help. 
  John Brugge Senior Specialist, e-Commerce Solutions Compuware Corporation Madison, Wisconsin 608-223-3800 [EMAIL PROTECTED] <> 
  
-Original Message- From:   Tom 
Miller [SMTP:[EMAIL PROTECTED]] Sent:   Friday, February 
23, 2001 2:43 PM To: struts-user Subject:    Still need help with VAJ & Struts 
Struts Amigos 
I am still trying to work out a way to develop 
Struts applications within Visual Age for 
Java. (Feb. 19 Struts build, Tomcat 3.2.1, VAJ 3.5.2, see 'Problem w/ Struts and VA for Java' last Tuesday). I got 
some suggestions but have been unable to 
reproduce the results. 
I believe the problem has to do with the custom 
class loader mechanism of Tomcat which is 
used for individual web apps. Craig explained in "Classpaths and the "struts.jar" file (Feb. 13th (#4566)) why it is 
that struts.jar must be in WEB-INF/lib 
and NOT on the classpath at execution time. Classes visible on the CLASSPATH are loaded on by the 
system loader, and cannot find class for 
classes which are loaded earlier by the 
custom class loaders of the web apps. 
In trying to use VAJ, one would want all code (at 
least all Struts code (contents of 
struts.jar plus your application code)) in the IDE instead of in WEB-INF/lib. But that seems to put it effectively on 
the CLASSPATH, and thus loaded by the 
system loader (the IDE environment). 
It is not that hard to get Tomcat running from 
within VAJ, but when one trys to access a 
Struts web app, say the struts-example, the first bean:message tag throws a JSP exception, presumeably 
because it is looking for 
WEB-INF/lib/struts.jar, instead of the Struts code within the IDE. 
I'm not sure, but I have a feeling that the 
custom class loaders for web apps may 
pose a significant challenge to developing with Struts inside 
VAJ. I know my understanding and/or my VAJ setup 
are hosed somehow or other, and that is 
why I'm asking for help. 
-- Tom 
Miller Miller Associates, Inc. 
[EMAIL PROTECTED] 641.469.3535 Phone 413.581.6326 
FAX 


How does Struts compare to Barracuda?

2001-02-20 Thread Johan Compagner

Here is the link:
http://barracuda.enhydra.org/Barracuda/

Can we learn something from it?
Is it better or worse?

Johan





Re: which development tool to use?

2001-02-05 Thread Johan Compagner

I use VAJ 3.5 with Tomcat and struts.

works perfectly can debug throught the jsp's (not really jsp's but the
generated servlets)
Can change code on the fly without restarting anything.

johan






Re: which development tool to use?

2001-02-05 Thread Johan Compagner

Are you developing in java? :-)

Why?

You don't like it if i look at your list.
Every IDE that is written in Java has this as a negative 'feature'

johan





PreparedStatement pool.

2001-02-03 Thread Johan Compagner

Hi,

I implement a PreparedStatement pool in the GenericConnection.

I only have one problem, I get a exception:

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Function
sequence error
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 java.sql.SQLException(java.lang.String, java.lang.String, int)
 java.sql.SQLException sun.jdbc.odbc.JdbcOdbc.createSQLException(int, int,
int)
 void sun.jdbc.odbc.JdbcOdbc.standardError(short, int, int, int)
 boolean sun.jdbc.odbc.JdbcOdbc.SQLExecute(int)
 boolean sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute()
 java.sql.ResultSet sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery()
 java.sql.ResultSet
org.apache.struts.util.GenericPreparedStatement.executeQuery()

After i get a pooled prepared statement. and use that one.

Now i have boiled it down to this in the close method of GenericConnection

try
 {
  conn.setCatalog(this.catalog);
 }
 catch (SQLException e)
 {
  ;
 }

If i exclude this then everyting works,
Is this common behaviour?
How do you do this?

Johan Compagner







  1   2   >