Flash Flex w/ Struts article

2003-12-17 Thread Vic Cekvenich
http://www.macromedia.com/devnet/flex/articles/struts.html

Is this for real? YES!

Point of Struts is MVC, so some people do JSP, Velocity... other do 
Hibrenate or iBatis... one thing remains.
(note how they did not support Spring, or WebWork or XYZ).

Flex is XML like, used to be Royale ( and my guess the product that 
resulted when MacroMedia rummored to break of from JSF).

(This is diffrent than PetStore http://blueprints.macromedia.com , I 
also realy like the Components from Flash Pro 2004 such as Tree, Grid, 
Calendar that bind to any SOAP like source)

If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of 
loads UI rendering to each client thus giving scalability!
If you are bidding projects, and your bid shows clients the richer UI, 
guess who wins the gig?
And it's Struts, something you know.

.V



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


RE: Modules with Tiles Problem

2003-12-17 Thread Patrick Cheng
HI All,
I found a way to get it working.

%org.apache.struts.util.RequestUtils.selectModule(,request,applicatio
n);%
html:form action=/Layout.do

I have to do this for every html:form item. 
This works, but it is ugly. It's even worse since this method is
deprecated in struts1.2.
I'm suspecting there must be a better way round right?
Can someone tell me if this is the way? Or there're smarter ways?

Rgds,
Patrick.
-Original Message-
From: Patrick Cheng 
Sent: Wednesday, December 17, 2003 10:12 AM
To: Struts Users Mailing List
Subject: Modules with Tiles Problem


Hi All,

I have a question on Tiles when using Modules(multiple
struts-config.xml's). As far as I know, switching between modules
requires more than providing different URLs. Either we use
ContextRelative forwards or using the struts Swiching Action class. But
in the situation of tiles, if the layout includes two jsp pages and they
are from different modules, say, the top part is a generic search
function, used everywhere for every module, what can I do about this?

Here's my situation.
2 struts configs : struts-config.xml, struts-module1-config.xml
Struts-config.xml has an action called 'layout'. Struts-module1-config
has an action called 'ViewMultiSelect'. So when I go:
http://localhost:7001/RootContext/module1/ViewMultiSelect.do
I got my ViewMultiSelect working, but in the tile 'layout', I got:

[ServletException in:/layout/Header.jsp] Cannot retrieve mapping for
action /Layout' 

My understanding is, when the current module is in Module1, struts won't
care anything in struts-config.xml, therefore it doesn't know about a
Layout action. How can I get it to work?

Thanks a lot.

Rgds.
Patrick.

-
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: Flash Flex w/ Struts article

2003-12-17 Thread Daniel Joshua
is there a sample Flash Flex w/ Strut application on the web?

currious what a RIA looks like...


Regards,
Daniel


-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
Sent: Wednesday, 17 December, 2003 3:07 PM
To: [EMAIL PROTECTED]
Subject: Flash Flex w/ Struts article


http://www.macromedia.com/devnet/flex/articles/struts.html

Is this for real? YES!

Point of Struts is MVC, so some people do JSP, Velocity... other do 
Hibrenate or iBatis... one thing remains.
(note how they did not support Spring, or WebWork or XYZ).

Flex is XML like, used to be Royale ( and my guess the product that 
resulted when MacroMedia rummored to break of from JSF).

(This is diffrent than PetStore http://blueprints.macromedia.com , I 
also realy like the Components from Flash Pro 2004 such as Tree, Grid, 
Calendar that bind to any SOAP like source)

If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of 
loads UI rendering to each client thus giving scalability!
If you are bidding projects, and your bid shows clients the richer UI, 
guess who wins the gig?
And it's Struts, something you know.


.V



-
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: Flash Flex w/ Struts article

2003-12-17 Thread Vic Cekvenich
I usually show the Flash PetStore, but there are dozens of Flash Data 
Entery applications out there.
I am a MacroMedia parter, and I could get you more links, but check out 
the Flash PetStore first (from http://blueprints.macromedia.com ) and 
then if you want more, let me know.
(the only VERY anoying thing is the they like to show the splash page, 
which makes me sick, but then they show the app. )

I plan to conver to Flash as View but it will take me at least months to 
get the current workload done.

.V

Daniel Joshua wrote:
is there a sample Flash Flex w/ Strut application on the web?

currious what a RIA looks like...

Regards,
Daniel
-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
Sent: Wednesday, 17 December, 2003 3:07 PM
To: [EMAIL PROTECTED]
Subject: Flash Flex w/ Struts article
http://www.macromedia.com/devnet/flex/articles/struts.html

Is this for real? YES!

Point of Struts is MVC, so some people do JSP, Velocity... other do 
Hibrenate or iBatis... one thing remains.
(note how they did not support Spring, or WebWork or XYZ).

Flex is XML like, used to be Royale ( and my guess the product that 
resulted when MacroMedia rummored to break of from JSF).

(This is diffrent than PetStore http://blueprints.macromedia.com , I 
also realy like the Components from Flash Pro 2004 such as Tree, Grid, 
Calendar that bind to any SOAP like source)

If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of 
loads UI rendering to each client thus giving scalability!
If you are bidding projects, and your bid shows clients the richer UI, 
guess who wins the gig?
And it's Struts, something you know.

.V



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


html:img is not getting recognised.

2003-12-17 Thread Amit Kumar Sharma
Dear friends,

I am substituting the normal HTML image tag 
img src=%=contextPath%/images/cal.gif
onClick=popUpCalendar(this, ParameterEditForm.endDate,
'dd-mmm-',46,735) 
with the shown below but is not getting recognised, can somebody guide me
out how to use it, I am new to struts.
html:img src=%=contextPath%/images/cal.gif
onClick=popUpCalendar(this, ParameterEditForm.endDate,
'dd-mmm-',46,735) /

Regards,
Amit Kumar Sharma
SysArris Software Pvt Ltd
120A, Elephant Rock Road,
3rd Block, Jayanagar, 
Bangalore - 560011
Tel.: 91-80-665 4965 / 665 5052
[EMAIL PROTECTED]
  
 


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

Re: Re: How to digest a customized struts configuration

2003-12-17 Thread Sebastian Linz
Hi Joe,

thank you for your usefull hint. Now it flies :) Of
course I was quite close. I even tried out different
addSetNext methods. Following your hint I knew I had
to change something else. But I missed to add a
corresponding add-method to my ActionMapping
sub-class.

Once again: thank you for your advise.

If anybody is interessted to the solution I would post
it under this thread. Otherwise I won't looking at the
traffic of this thread.

Regards,

Sebastian


 --- Joe Germuska [EMAIL PROTECTED] schrieb:  At
9:33 PM +0100 12/16/03, Sebastian Linz wrote:
 I added my sample rule set using the init parameter
 within the web
 deployment descriptor. But I didn't find the way
 how
 to tell the
 digester to
 add the
 SecurityConstraint bean to my sample action
 mapping.
 
 Impatiently waiting for your answers
 
 You've gotten quite close; it just seems to me that
 you need to add a 
 setNext rule at the path 

struts-config/action-mappings/action/security-constraint
 -- and 
 then guarantee that you only use
 security-constraint elements 
 nested inside of action elements that specify a
 subclass of 
 ActionMapping which would accept a
 security-constraint object.
 
 Joe
 
 -- 
 Joe Germuska
 [EMAIL PROTECTED]  
 http://blog.germuska.com
   We want beef in dessert if we can get it there.
-- Betty Hogan, Director of New Product
 Development, National 
 Cattlemen's Beef Association
 
 

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

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de

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



Problem with requiredIf validation

2003-12-17 Thread Markus
Hi,

we try to concat more than two conditions with requiredIf.
Something like (selectionOne==1 || selectionOne==2)  value ==2
The problem is that it is not clear how the validator evaluates the
expression.
Does anyone having experiences with that.


TIA,
Markus


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



RE: html:img is not getting recognised.

2003-12-17 Thread Yves Sy
Struts already appends the context path.

html:img src=./images/cal.gif
onClick=popUpCalendar(this, ParameterEditForm.endDate,
'dd-mmm-',46,735) /

...should be enough

-Yves-

-Original Message-
From: Amit Kumar Sharma [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 4:33 PM
To: Struts Users Mailing List
Subject: html:img is not getting recognised.

Dear friends,

I am substituting the normal HTML image tag 
img src=%=contextPath%/images/cal.gif
onClick=popUpCalendar(this, ParameterEditForm.endDate,
'dd-mmm-',46,735) 
with the shown below but is not getting recognised, can somebody guide
me
out how to use it, I am new to struts.
html:img src=%=contextPath%/images/cal.gif
onClick=popUpCalendar(this, ParameterEditForm.endDate,
'dd-mmm-',46,735) /

Regards,
Amit Kumar Sharma
SysArris Software Pvt Ltd
120A, Elephant Rock Road,
3rd Block, Jayanagar, 
Bangalore - 560011
Tel.: 91-80-665 4965 / 665 5052
[EMAIL PROTECTED]
  
 





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



Re: How To Output the Value Of a Hidden Field?

2003-12-17 Thread Koni Roth
You cannot have two properties with the same name in a form.
Try:
html:hidden property=creator_1/
input type=text name=creator vlaue=bean:write name=beanName 
property=creator_1/ size=82 maxlength=25 tabindex=1/

cheers
Koni
Caroline Jen wrote:

My JSP #2 receives a hidden field passed from JSP #1:
html:hidden property=creator/
In the JSP #2, I have a text field:
html:text property=creator size=82 maxlength=25
tabindex=1/
and I want the value of the hidden field to be the
text in the text field of the JSP #2.  Please advise
how to do it?
__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/


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


BUG!!! FormFile

2003-12-17 Thread Ben Janes
Hi


Further to my other mail I have tracked the source of my problem here
org.apache.commons.beanutils.PropertyUtils#setSimpleProperty

The problem is that when you submit a form, with a file element and the user has left 
the file
elemet blank, it crashes The altered code below from line 1773 in PropertyUtils 
gives the
following output just before the error

descriptor.getWriteMethod():1:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.struts.upload.FormFile)
descriptor.getWriteMethod():2:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.struts.upload.FormFile)
params:interface org.apache.struts.upload.FormFile,value.getClass():class 
java.lang.String

So as you can see, the program expects a FormFile parameter, but gets a String  
Major error I
think


// Retrieve the property setter method for the specified property
PropertyDescriptor descriptor =
getPropertyDescriptor(bean, name);
if (descriptor == null) {
throw new NoSuchMethodException(Unknown property ' +
name + ');
}

System.out.println(descriptor.getWriteMethod():1:+descriptor.getWriteMethod().toString());
Method writeMethod = getWriteMethod(descriptor);

System.out.println(descriptor.getWriteMethod():2:+descriptor.getWriteMethod().toString());

if (writeMethod == null) {
throw new NoSuchMethodException(Property ' + name +
' has no setter method);
}
System.out.print(params:);
Class [] cls=writeMethod.getParameterTypes();
for (int i=0;icls.length;i++) {
System.out.print(cls[i].toString()+,);
}
System.out.println();
// Call the property setter method
Object values[] = new Object[1];
values[0] = value;
System.out.println(value.getClass():+value.getClass());
writeMethod.invoke(bean, values);
}

[EMAIL PROTECTED]
Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



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



BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Jitesh Sinha
Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource  create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


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



RE: BUG!!! FormFile

2003-12-17 Thread Andrew Hill
Did you remember to make it a multipart form???
(And use input type=file in the page?)


-Original Message-
From: Ben Janes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 December 2003 17:28
To: [EMAIL PROTECTED]
Subject: BUG!!! FormFile


Hi


Further to my other mail I have tracked the source of my problem here
org.apache.commons.beanutils.PropertyUtils#setSimpleProperty

The problem is that when you submit a form, with a file element and the user
has left the file
elemet blank, it crashes The altered code below from line 1773 in
PropertyUtils gives the
following output just before the error

descriptor.getWriteMethod():1:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.s
truts.upload.FormFile)
descriptor.getWriteMethod():2:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.s
truts.upload.FormFile)
params:interface org.apache.struts.upload.FormFile,value.getClass():class
java.lang.String

So as you can see, the program expects a FormFile parameter, but gets a
String  Major error I
think


// Retrieve the property setter method for the specified property
PropertyDescriptor descriptor =
getPropertyDescriptor(bean, name);
if (descriptor == null) {
throw new NoSuchMethodException(Unknown property ' +
name + ');
}

System.out.println(descriptor.getWriteMethod():1:+descriptor.getWriteMetho
d().toString());
Method writeMethod = getWriteMethod(descriptor);

System.out.println(descriptor.getWriteMethod():2:+descriptor.getWriteMetho
d().toString());

if (writeMethod == null) {
throw new NoSuchMethodException(Property ' + name +
' has no setter method);
}
System.out.print(params:);
Class [] cls=writeMethod.getParameterTypes();
for (int i=0;icls.length;i++) {
System.out.print(cls[i].toString()+,);
}
System.out.println();
// Call the property setter method
Object values[] = new Object[1];
values[0] = value;
System.out.println(value.getClass():+value.getClass());
writeMethod.invoke(bean, values);
}

[EMAIL PROTECTED]
Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



-
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: BUG!!! FormFile

2003-12-17 Thread Ben Janes

Yes,

as it works perfecrtly as long as someone enters a file in the html input field



Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden


|-+
| |   Andrew Hill|
| |   [EMAIL PROTECTED]|
| |   idnode.com  |
| ||
| |   2003-12-17 10:31 |
| |   Please respond to|
| |   Struts Users Mailing|
| |   List|
| ||
|-+
  
--|
  |
  |
  |   To:   Struts Users Mailing List [EMAIL PROTECTED]
 |
  |   cc:  
  |
  |   Subject:  RE: BUG!!! FormFile
  |
  
--|




Did you remember to make it a multipart form???
(And use input type=file in the page?)


-Original Message-
From: Ben Janes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 December 2003 17:28
To: [EMAIL PROTECTED]
Subject: BUG!!! FormFile


Hi


Further to my other mail I have tracked the source of my problem here
org.apache.commons.beanutils.PropertyUtils#setSimpleProperty

The problem is that when you submit a form, with a file element and the user
has left the file
elemet blank, it crashes The altered code below from line 1773 in
PropertyUtils gives the
following output just before the error

descriptor.getWriteMethod():1:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.s
truts.upload.FormFile)
descriptor.getWriteMethod():2:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.s
truts.upload.FormFile)
params:interface org.apache.struts.upload.FormFile,value.getClass():class
java.lang.String

So as you can see, the program expects a FormFile parameter, but gets a
String  Major error I
think


// Retrieve the property setter method for the specified property
PropertyDescriptor descriptor =
getPropertyDescriptor(bean, name);
if (descriptor == null) {
throw new NoSuchMethodException(Unknown property ' +
name + ');
}

System.out.println(descriptor.getWriteMethod():1:+descriptor.getWriteMetho
d().toString());
Method writeMethod = getWriteMethod(descriptor);

System.out.println(descriptor.getWriteMethod():2:+descriptor.getWriteMetho
d().toString());

if (writeMethod == null) {
throw new NoSuchMethodException(Property ' + name +
' has no setter method);
}
System.out.print(params:);
Class [] cls=writeMethod.getParameterTypes();
for (int i=0;icls.length;i++) {
System.out.print(cls[i].toString()+,);
}
System.out.println();
// Call the property setter method
Object values[] = new Object[1];
values[0] = value;
System.out.println(value.getClass():+value.getClass());
writeMethod.invoke(bean, values);
}

[EMAIL PROTECTED]
Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



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



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







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



RE: BUG!!! FormFile

2003-12-17 Thread Andrew Hill
Hmmm. Strange.
I dont get that problem in my apps.
What struts version are you using?

-Original Message-
From: Ben Janes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 December 2003 17:41
To: Struts Users Mailing List
Subject: RE: BUG!!! FormFile



Yes,

as it works perfecrtly as long as someone enters a file in the html input
field



Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden


|-+
| |   Andrew Hill|
| |   [EMAIL PROTECTED]|
| |   idnode.com  |
| ||
| |   2003-12-17 10:31 |
| |   Please respond to|
| |   Struts Users Mailing|
| |   List|
| ||
|-+

---

---|
  |
|
  |   To:   Struts Users Mailing List
[EMAIL PROTECTED]
|
  |   cc:
|
  |   Subject:  RE: BUG!!! FormFile
|

---

---|




Did you remember to make it a multipart form???
(And use input type=file in the page?)


-Original Message-
From: Ben Janes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 December 2003 17:28
To: [EMAIL PROTECTED]
Subject: BUG!!! FormFile


Hi


Further to my other mail I have tracked the source of my problem here
org.apache.commons.beanutils.PropertyUtils#setSimpleProperty

The problem is that when you submit a form, with a file element and the user
has left the file
elemet blank, it crashes The altered code below from line 1773 in
PropertyUtils gives the
following output just before the error

descriptor.getWriteMethod():1:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.s
truts.upload.FormFile)
descriptor.getWriteMethod():2:public void
com.meganexus.networking.struts.form.ChangeContactForm.setPhoto(org.apache.s
truts.upload.FormFile)
params:interface org.apache.struts.upload.FormFile,value.getClass():class
java.lang.String

So as you can see, the program expects a FormFile parameter, but gets a
String  Major error I
think


// Retrieve the property setter method for the specified property
PropertyDescriptor descriptor =
getPropertyDescriptor(bean, name);
if (descriptor == null) {
throw new NoSuchMethodException(Unknown property ' +
name + ');
}

System.out.println(descriptor.getWriteMethod():1:+descriptor.getWriteMetho
d().toString());
Method writeMethod = getWriteMethod(descriptor);

System.out.println(descriptor.getWriteMethod():2:+descriptor.getWriteMetho
d().toString());

if (writeMethod == null) {
throw new NoSuchMethodException(Property ' + name +
' has no setter method);
}
System.out.print(params:);
Class [] cls=writeMethod.getParameterTypes();
for (int i=0;icls.length;i++) {
System.out.print(cls[i].toString()+,);
}
System.out.println();
// Call the property setter method
Object values[] = new Object[1];
values[0] = value;
System.out.println(value.getClass():+value.getClass());
writeMethod.invoke(bean, values);
}

[EMAIL PROTECTED]
Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



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



ActionMapping - regexp pattern matching for path

2003-12-17 Thread Sergey Proskurnya
Hello to all,

In Struts-1.1 it is possible to bind Actions to static URL path,
but is it possible to bind Actions to the set of the paths,
described by Java regular expression?
For example:
action-mappings
action path=/users/.*
type=com.mysite.UserPageAction
scope=session
validate=false
/action
/action-mappings

I mean that in this case the requests for /users/John/,
/users/Mary/ and etc. will be handled by com.mysite.UserPageAction.

Thanks for attention,
  Sergey Proskurnya.

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



validation

2003-12-17 Thread struts
can the validator plugin be used for the following.

I have a delete button which deletes a user. Prior to the delete i want to show a 
warning : 'are you sure you want to delete? '

I can do it whith a javascript but can it be done using the validator as well ?

Thanks !

RE: BUG!!! FormFile

2003-12-17 Thread Ben Janes

Struts 1.1

Do you want more code, such as JSP /  ActionForm etc

Mvh
Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



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



AW: Flash Flex w/ Struts article

2003-12-17 Thread Oliver Thiel
Read the article ;)
http://blueprints.macromedia.com/PetMarket/flashstore.html


Doesn't look to bad ... 
Oliver


-Ursprüngliche Nachricht-
Von: Daniel Joshua [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 17. Dezember 2003 09:11
An: 'Struts Users Mailing List'
Betreff: RE: Flash Flex w/ Struts article

is there a sample Flash Flex w/ Strut application on the web?

currious what a RIA looks like...


Regards,
Daniel


-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
Sent: Wednesday, 17 December, 2003 3:07 PM
To: [EMAIL PROTECTED]
Subject: Flash Flex w/ Struts article


http://www.macromedia.com/devnet/flex/articles/struts.html

Is this for real? YES!

Point of Struts is MVC, so some people do JSP, Velocity... other do 
Hibrenate or iBatis... one thing remains.
(note how they did not support Spring, or WebWork or XYZ).

Flex is XML like, used to be Royale ( and my guess the product that 
resulted when MacroMedia rummored to break of from JSF).

(This is diffrent than PetStore http://blueprints.macromedia.com , I 
also realy like the Components from Flash Pro 2004 such as Tree, Grid, 
Calendar that bind to any SOAP like source)

If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of 
loads UI rendering to each client thus giving scalability!
If you are bidding projects, and your bid shows clients the richer UI, 
guess who wins the gig?
And it's Struts, something you know.


.V



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



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


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



RE: Please Help With This Error Message

2003-12-17 Thread fredatwork
Your statement is OK. It comes from the surrounding quote.

The only idea I have is to check double-quotes correctly.

Fred 

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED] 
Sent: mercredi 17 décembre 2003 07:41
To: [EMAIL PROTECTED]
Subject: Please Help With This Error Message

Please help me to figure out this error message that I
got in the browser: equal symbol expected.

The error complains about this statement in my JSP:
bean:define id=author name=creator
scope=session type=java.lang.String/

and the above statement is intended to retrieve the
string creator from a session object.



__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



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



Re: Please Help With This Error Message

2003-12-17 Thread Firat TIRYAKI
maybe you don't have a space character between creator and scope... try to
write the tag in one line, not multiple lines.

F.

- Original Message - 
From: fredatwork [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 8:53 AM
Subject: RE: Please Help With This Error Message


Your statement is OK. It comes from the surrounding quote.

The only idea I have is to check double-quotes correctly.

Fred

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: mercredi 17 décembre 2003 07:41
To: [EMAIL PROTECTED]
Subject: Please Help With This Error Message

Please help me to figure out this error message that I
got in the browser: equal symbol expected.

The error complains about this statement in my JSP:
bean:define id=author name=creator
scope=session type=java.lang.String/

and the above statement is intended to retrieve the
string creator from a session object.



__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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



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



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



RE: How To Output the Value Of a Hidden Field?

2003-12-17 Thread Robert Taylor
There are a couple (3) ways to do it.

1. Have both JSP#1 and 2 use the same form then have the action that
processes JSP#1 simply
forward to JSP#2 and Struts will auto-populate the field.

2. Have the action that processes JSP#1 forward or redirect to
   JSP#2 whose form has the same property name. Place the create property
   value in the query string and Struts will auto-populate the form
   in JSP#2.

3. Have the action that processes JSP#1 access and populate the form used
   in JSP#2 with the property then forward to JSP#2.

robert

 -Original Message-
 From: Caroline Jen [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 16, 2003 8:33 PM
 To: [EMAIL PROTECTED]
 Subject: How To Output the Value Of a Hidden Field?


 My JSP #2 receives a hidden field passed from JSP #1:
 html:hidden property=creator/

 In the JSP #2, I have a text field:
 html:text property=creator size=82 maxlength=25
 tabindex=1/

 and I want the value of the hidden field to be the
 text in the text field of the JSP #2.  Please advise
 how to do it?

 __
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing.
 http://photos.yahoo.com/

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



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



RE: BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Jitesh Sinha
No friends for me on this list ! :(

-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:12 PM
To: Struts Users Mailing List
Subject: BasicDataSource class of package org.apache.commons.dbcp


Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource  create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


-
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: BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Ben Janes

Hi,

I used a connection pool via JNDI,, the only issue was that it was possible for the 
system to check
out the same connection once, and if you return one, (close) then it closes for them 
all.. I wrote a
little item that added the hashcode to an arraylist, removeing it when then code 
released the
connection, when there where none in the arraylist it was safe to close

Benjamin A. Janes

BLUEWAVE SVERIGE

M. +46 (0)40-631 1068
F. +46 (0)40 -631 10 50
F. +46 (0)46-540 03 50
Drottninggatan 18,
S-211 49 Malmö,
Sweden



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



Help on form reset

2003-12-17 Thread vasudevrao gupta

Hi,

I am new to struts..
I understand that the validate method of the Action form can be called
based on the validate 
attribute in struts_config.xml.
Similarly, for the reset method, can we configure in the xml file.

Regards
VasudevRaoGupta


Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



RE: Help on form reset

2003-12-17 Thread Fullam, Jonathan
No, the reset method will automatically be called on a Session scoped
ActionForm upon each request.  Request scoped ActionForms are newly
instantiated upon each request so, with Request scoped ActionForms, the
reset method is irrelevant.
-Jonathan

-Original Message-
From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:06 AM
To: 'Struts Users Mailing List'
Subject: Help on form reset



Hi,

I am new to struts..
I understand that the validate method of the Action form can be called
based on the validate 
attribute in struts_config.xml.
Similarly, for the reset method, can we configure in the xml file.

Regards
VasudevRaoGupta


Confidentiality Notice 

The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


RE: [OT ]BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread chekuri raju
hello jitesh,
 
why do u need to bother about  BasicDataSource  code if u r running it on any server 
just configure  the configuration files and use JNDI lookup to get the connection and 
your close() on Connection object returns the con obj to pool
 
regards
srinivas

Jitesh Sinha [EMAIL PROTECTED] wrote:
No friends for me on this list ! :(

-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:12 PM
To: Struts Users Mailing List
Subject: BasicDataSource class of package org.apache.commons.dbcp


Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


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


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Help on setting multiple values in Action form from client side

2003-12-17 Thread vasudevrao gupta

Hi ,

I have a screen with number of records and each record has an associated
check-box.
User  clicks on single/multiple checkboxes to select the records and
clicks on delete button(same as in Yahoo mail).
I have an associated action form to this screen with one of the
attributes of String[] array type.When the used clicks on delete
button,I want to set all the record numbers in the action from attribute
and submit the form.

Can I do this in an easier way using struts when compared to a normal
javascript?

Regards
VasudevRaogupta


Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Error using Struts Validation on Weblogic 8.1 platform

2003-12-17 Thread Milon Krejca
Seems like you do not have DTD configured localy and the server is 
tryiing to access DTD from web server.  See beginning of  validation.xml 
file and look for DTD definition...

Milon

[EMAIL PROTECTED] wrote:

All,

The validation doesn't seem to work.Checking the Server logs displays the following stack trace.Any thoughts as to what needs to be done?

Thanks
Rahul
17 Dec 2003 10:20:01,806 INFO  ValidatorPlugIn []: Loading validation rules file from '/WEB-INF/validator-rules.xml'

17 Dec 2003 10:20:19,031 ERROR ValidatorPlugIn []: jakarta.apache.org
Throwable: java.net.UnknownHostException: jakarta.apache.org
Stack Trace:
java.net.UnknownHostException: jakarta.apache.org
at java.net.InetAddress.getAllByName0(InetAddress.java:1004)
at java.net.InetAddress.getAllByName0(InetAddress.java:969)
at java.net.InetAddress.getAllByName(InetAddress.java:963)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:228)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:292)
at weblogic.net.http.HttpClient.init(HttpClient.java:128)
at 
weblogic.net.http.HttpURLConnection.getHttpClient(HttpURLConnection.java:122)
at 
weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:321)
at java.net.URL.openStream(URL.java:960)
at 
weblogic.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:836)
at 
weblogic.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:796)
at 
weblogic.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:275)
at 
weblogic.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:841)
at 
weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at 
weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at 
weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at 
weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:138)
at org.apache.commons.digester.Digester.parse(Digester.java:1562)
at 
org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:256)
at 
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:224)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:167)
at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1105)
at 
com.bea.wlw.netui.pageflow.DynamicSubappActionServlet.registerModule(DynamicSubappActionServlet.java:346)
at 
com.bea.wlw.netui.pageflow.DynamicSubappActionServlet.ensureModuleRegistered(DynamicSubappActionServlet.java:520)
at 
com.bea.wlw.netui.pageflow.DynamicSubappActionServlet.getModuleConfig(DynamicSubappActionServlet.java:455)
at 
com.bea.wlw.netui.pageflow.DynamicSubappActionServlet.process(DynamicSubappActionServlet.java:389)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
at 
com.bea.wlw.netui.pageflow.scoping.ScopedServletUtils.strutsLookup(ScopedServletUtils.java:348)
at 
com.bea.wlw.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1196)
at com.bea.wlw.netui.pageflow.FlowController.lookup(FlowController.java:1615)
at 
com.bea.netuix.servlets.controls.content.PageflowContent.preRender(PageflowContent.java:343)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at 
com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:313)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at 
weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(RequestDispatcherImpl.java:385)
at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at 
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:286)
at 
com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(PageFlowRequestProcessor.java:1017)
at 

Re: Help on form reset

2003-12-17 Thread Martin Gainty
Any Form Bean which extends ActionForm can override the reset() method
http://www.fawcette.com/javapro/2002_07/online/kjones/default_pf.aspx
Is there something in particular you wish to accomplish?

Martin

- Original Message - 
From: Fullam, Jonathan [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:11 AM
Subject: RE: Help on form reset


 No, the reset method will automatically be called on a Session scoped
 ActionForm upon each request.  Request scoped ActionForms are newly
 instantiated upon each request so, with Request scoped ActionForms, the
 reset method is irrelevant.
 -Jonathan

 -Original Message-
 From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 9:06 AM
 To: 'Struts Users Mailing List'
 Subject: Help on form reset



 Hi,

 I am new to struts..
 I understand that the validate method of the Action form can be called
 based on the validate
 attribute in struts_config.xml.
 Similarly, for the reset method, can we configure in the xml file.

 Regards
 VasudevRaoGupta


 Confidentiality Notice

 The information contained in this electronic message and any attachments
to
 this message are intended
 for the exclusive use of the addressee(s) and may contain confidential or
 privileged information. If
 you are not the intended recipient, please notify the sender at Wipro or
 [EMAIL PROTECTED] immediately
 and destroy all copies of this message and any attachments.

 -
 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: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Engbers, ir. J.B.O.M.
Hi,

Both 'Struts in Action' and 'Programming Jakarta Struts' state that
ActionForms and DynaActionForms are nearly equivalent and the main advantage
of using DynaActionForms is that you don't have to declare all the getters
and setters.
In DynaAction Forms each property can be of a (array of a) primitive types.

Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
properties from a DynaActionForm on december 16), I partially succeeded in
solving the first problem which only confronted me with the next problem :-(
And while looking for a solution to that problem, I found a bugreport
(23355) in which Craig states that 

'Adding these (getInteger, getBoolean etc, Ben) would encourage a behavior
that Struts discourages -- using
non-String data types in a form bean.'

Maybe that this explains why I have only found examples that use
String-properties (which lead me to my first question: where can I find
examples that use non_string properties?) but it leaves me with the more
fundamental question:
Why do DynaActionForms offer the possibility to declare non-String
properties without supporting them?
Should I avoid using DynaActionForms at all and use the DynaValidatorForm?

Ben Engbers

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



RE: [OT ]BasicDataSource class of package org.apache.commons.dbcp

2003-12-17 Thread Jitesh Sinha
Thanks Chekuri and Ben for your replies...meanwhile I have done some
research on BasicDataSource
and found a few things..will post once I am totally sure about that...

-Original Message-
From: chekuri raju [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 7:49 PM
To: Struts Users Mailing List
Subject: RE: [OT ]BasicDataSource class of package
org.apache.commons.dbcp


hello jitesh,

why do u need to bother about  BasicDataSource  code if u r running it on
any server just configure  the configuration files and use JNDI lookup to
get the connection and your close() on Connection object returns the con obj
to pool

regards
srinivas

Jitesh Sinha [EMAIL PROTECTED] wrote:
No friends for me on this list ! :(

-Original Message-
From: Jitesh Sinha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:12 PM
To: Struts Users Mailing List
Subject: BasicDataSource class of package org.apache.commons.dbcp


Hello all,

I am making use of BasicDataSource class to get connections .The code which
I write to get a connection is as follows :

basicDataSource = new BasicDataSource();
basicDataSource.setDefaultAutoCommit(autoCommit);
basicDataSource.setUrl(jdbcUrl);
basicDataSource.setDriverClassName(driver);
basicDataSource.setUsername(user);
basicDataSource.setPassword(password);
basicDataSource.setMaxIdle(maxIdle);
basicDataSource.setMaxActive(maxConn);

basicDataSource.setRemoveAbandonedTimeout(removeAbandonedTimeout);
basicDataSource.setMaxWait(maxWait);
basicDataSource.setRemoveAbandoned(removeAbandoned);
basicDataSource.setLogAbandoned(logAbandoned);
basicDataSource.setValidationQuery(validationQuery);

Connection conn =basicDataSource.getConnection() ;

Does getConnection() method of BasicDataSource create a new connection to
the database or internally manage some connection pool from which a new
connection is taken?
Will I need to write any extra code to make use of a connectionpool ?

Thanks,
Jitesh


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


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now


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



sample program not running..getting stuck at Creating new Action

2003-12-17 Thread deepak saini
Hi,

I have written a small application based on struts.
there is one jsp page from which i am submitting some data.
this is the code inthe jsp file
html:form action=Lookup
table width=45% border=0
  tr
tdSymbol:/td
tdhtml:text property=symbol //td
  /tr
  tr
td colspan=2 align=centerhtml:submit//td
  /tr
/table
  /html:form
the struts mapping is

form-beans
form-bean name=lookupForm type=wiley.LookupForm
/form-bean
/form-beans
!-- Action Mappings --
action-mappings
action path=/Lookup type=wiley.LookupAction name=lookupForm
forward name=success path=/quote.jsp
/forward
forward name=failure path=/index.jsp
/forward
/action
/action-mappings
when i execute the code, index.jsp is running fine but when i submit some
data, the url changes to
http://localhost:9080/wileyapp/Lookup.do and gets stuck there.
the server log shows the following
[wileyapp] [/wileyapp] [Servlet.LOG]: /index.jsp: init
[12/17/03 20:10:54:109 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action: Processing a POST for /Lookup
[12/17/03 20:10:54:109 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action: Setting locale 'en_US'
[12/17/03 20:10:54:109 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:  Looking for ActionForm bean
under attribute 'lookupForm'
[12/17/03 20:10:54:109 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:  Recycling existing ActionForm
bean instance of class 'wiley.LookupForm'
[12/17/03 20:10:54:109 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:  Populating bean properties
from this request
[12/17/03 20:10:54:125 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:  Validating input form
properties
[12/17/03 20:10:54:125 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:   No errors detected,
accepting input
[12/17/03 20:10:54:125 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:  Looking for Action instance
for class wiley.LookupAction
[12/17/03 20:10:54:141 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:   Double checking for Action
instance already there
[12/17/03 20:10:54:141 GMT+05:30]  f1c9d22 WebGroup  I SRVE0180I:
[wileyapp] [/wileyapp] [Servlet.LOG]: action:   Creating new Action instance
_
Stand out from the crowd. Make your own MMS cards. http://msn.migasia.cn/msn 
Have some mobile masti!

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


New Tag Files vs Tiles??

2003-12-17 Thread Graham Lounder
Hey all,

I just learned about the new tag files in the JSP 2.0 spec by playing around
with the tomcat 5 examples.  I'm wondering since these tag files seem so
easy to create, could they be used as another templating mechanism similar
to tiles?  Does anyone see any reason why you would want to use one over the
other?  Any comments?

Cheers,
Graham


Graham Lounder - Java Developer
CARIS Spatial Components Division
[EMAIL PROTECTED]
Phone:  (506) 458-8533
Fax:(506) 459-3849

NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME
AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY.


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



Re: Newbie: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Mark Lowe
DynaActionForms as cool as they are are more trouble than they're worth 
unless its a small simple form. For one thing you don't find out what's 
wrong until runtime.

I just use strings for dynaaction forms as it works, the problems our 
in part caused (i think) by the conversions done by beanutils 
(org.apache.commons.beanutils). Validator validates stuff even of type 
string.

if/when you use action forms, the typing issues are less of a pain. I 
know that its discouraged according to the party line. But then those 
aren't the folks paying you are they.

Part of the problem is that action forms are strongly coupled to the 
presentation layer, but sometimes its handy to be able to copy the 
properties from your model beans to the servlet layer. Often this means 
having both groups of beans looking pretty much the same, but some MVC 
purists claim this is the devils work as you're not decoupling enough. 
While I symathise with this position, its often not pragmatic to go 
down this route at an early stage of a project. In fact I've been known 
to nest model beans in action forms, and re-factor later to decouple, 
while I know this breaks with MVC the folks paying for work don't 
really give a toss whether its mvc or not.

I'm not saying break with the world according to these folks who know 
better than me, but just that sometimes its important to understand 
their focus is different to some of us. While they're laying out road 
maps for future technologies, publishing books and suchlike. We're 
stuck in an is and ought dilemma, between clients/bosses and trying 
to craft the best app we can.

So IMO careful what you believe or you might end up trying to find the 
holy grail of tech development, while your productivity suffers.

My 2 pence.



On 17 Dec 2003, at 14:24, Engbers, ir. J.B.O.M. wrote:

Hi,

Both 'Struts in Action' and 'Programming Jakarta Struts' state that
ActionForms and DynaActionForms are nearly equivalent and the main 
advantage
of using DynaActionForms is that you don't have to declare all the 
getters
and setters.
In DynaAction Forms each property can be of a (array of a) primitive 
types.

Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
properties from a DynaActionForm on december 16), I partially 
succeeded in
solving the first problem which only confronted me with the next 
problem :-(
And while looking for a solution to that problem, I found a bugreport
(23355) in which Craig states that

'Adding these (getInteger, getBoolean etc, Ben) would encourage a 
behavior
that Struts discourages -- using
non-String data types in a form bean.'

Maybe that this explains why I have only found examples that use
String-properties (which lead me to my first question: where can I find
examples that use non_string properties?) but it leaves me with the 
more
fundamental question:
Why do DynaActionForms offer the possibility to declare non-String
properties without supporting them?
Should I avoid using DynaActionForms at all and use the 
DynaValidatorForm?

Ben Engbers

-
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: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Robert Taylor
To address the fundemental question, it is considered a best practice
to only use String or Boolean objects or collections of String and/or
Boolean objects or collection of
data structures which contain String and/or Boolean objects in your forms.
This is because it gives you
more control over validation. This doesn't mean that DynaActionForms or
any DynaForm for that matter doesn't support non-string types. It
supports
any Object because essentially the DynaXXXForms internal data structure is a
Map.

In general the Struts form should be a ValueObject passing immutable data
from the input
to be processed or passing immutable data to the output to be rendered.

The great thing about Struts is that it gives you more than enough rope to
use wisely or hang yourself :)

robert



 -Original Message-
 From: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 9:24 AM
 To: '[EMAIL PROTECTED]'
 Subject: Newbie: java.lang.boolean and DynaActionForm?


 Hi,

 Both 'Struts in Action' and 'Programming Jakarta Struts' state that
 ActionForms and DynaActionForms are nearly equivalent and the
 main advantage
 of using DynaActionForms is that you don't have to declare all the getters
 and setters.
 In DynaAction Forms each property can be of a (array of a)
 primitive types.

 Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
 properties from a DynaActionForm on december 16), I partially
 succeeded in
 solving the first problem which only confronted me with the next
 problem :-(
 And while looking for a solution to that problem, I found a bugreport
 (23355) in which Craig states that

 'Adding these (getInteger, getBoolean etc, Ben) would encourage a behavior
 that Struts discourages -- using
 non-String data types in a form bean.'

 Maybe that this explains why I have only found examples that use
 String-properties (which lead me to my first question: where can I find
 examples that use non_string properties?) but it leaves me with the more
 fundamental question:
 Why do DynaActionForms offer the possibility to declare non-String
 properties without supporting them?
 Should I avoid using DynaActionForms at all and use the DynaValidatorForm?

 Ben Engbers

 -
 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: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Mark Lowe
No one's suggesting that anyone hangs them selves or that struts isn't 
good. But the fact that this list sees a high influx of newbies, 
getting battered with high-brow design concepts which while are very 
interesting have a certain chocolate fire guard quality to them .

Easiest thing is to make all the form properties strings, or like has 
been suggested, non primitives. It was certainly the case a few months 
ago that to use dynaaction forms then it was just less bother to use 
strings.

Sure nesting model objects in action forms does take the piss a bit, 
but its nothing that cant be sorted when clients/non tech bosses have 
stopped wetting themselves about image swaps..

Cheers Mark

On 17 Dec 2003, at 15:27, Robert Taylor wrote:

To address the fundemental question, it is considered a best 
practice
to only use String or Boolean objects or collections of String and/or
Boolean objects or collection of
data structures which contain String and/or Boolean objects in your 
forms.
This is because it gives you
more control over validation. This doesn't mean that DynaActionForms or
any DynaForm for that matter doesn't support non-string types. It
supports
any Object because essentially the DynaXXXForms internal data 
structure is a
Map.

In general the Struts form should be a ValueObject passing immutable 
data
from the input
to be processed or passing immutable data to the output to be rendered.

The great thing about Struts is that it gives you more than enough 
rope to
use wisely or hang yourself :)

robert



-Original Message-
From: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:24 AM
To: '[EMAIL PROTECTED]'
Subject: Newbie: java.lang.boolean and DynaActionForm?
Hi,

Both 'Struts in Action' and 'Programming Jakarta Struts' state that
ActionForms and DynaActionForms are nearly equivalent and the
main advantage
of using DynaActionForms is that you don't have to declare all the 
getters
and setters.
In DynaAction Forms each property can be of a (array of a)
primitive types.

Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
properties from a DynaActionForm on december 16), I partially
succeeded in
solving the first problem which only confronted me with the next
problem :-(
And while looking for a solution to that problem, I found a bugreport
(23355) in which Craig states that
'Adding these (getInteger, getBoolean etc, Ben) would encourage a 
behavior
that Struts discourages -- using
non-String data types in a form bean.'

Maybe that this explains why I have only found examples that use
String-properties (which lead me to my first question: where can I 
find
examples that use non_string properties?) but it leaves me with the 
more
fundamental question:
Why do DynaActionForms offer the possibility to declare non-String
properties without supporting them?
Should I avoid using DynaActionForms at all and use the 
DynaValidatorForm?

Ben Engbers

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


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


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


Re: Newbie: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Ed Dowgiallo
Mark,

Perhaps I am getting old, but the meaning of your metaphors went over my
head.  On the other hand, this is an international audience.

What is a chocolate fire guard?

Do you believe it is harder or easier to use DynaActionForms instead of
Strings?

Is taking the piss a bit a good thing or a bad thing?

Thank you,
Ed
- Original Message - 
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 10:33 AM
Subject: Re: Newbie: java.lang.boolean and DynaActionForm?


 No one's suggesting that anyone hangs them selves or that struts isn't
 good. But the fact that this list sees a high influx of newbies,
 getting battered with high-brow design concepts which while are very
 interesting have a certain chocolate fire guard quality to them .

 Easiest thing is to make all the form properties strings, or like has
 been suggested, non primitives. It was certainly the case a few months
 ago that to use dynaaction forms then it was just less bother to use
 strings.

 Sure nesting model objects in action forms does take the piss a bit,
 but its nothing that cant be sorted when clients/non tech bosses have
 stopped wetting themselves about image swaps..

 Cheers Mark

 On 17 Dec 2003, at 15:27, Robert Taylor wrote:

  To address the fundemental question, it is considered a best
  practice
  to only use String or Boolean objects or collections of String and/or
  Boolean objects or collection of
  data structures which contain String and/or Boolean objects in your
  forms.
  This is because it gives you
  more control over validation. This doesn't mean that DynaActionForms or
  any DynaForm for that matter doesn't support non-string types. It
  supports
  any Object because essentially the DynaXXXForms internal data
  structure is a
  Map.
 
  In general the Struts form should be a ValueObject passing immutable
  data
  from the input
  to be processed or passing immutable data to the output to be rendered.
 
  The great thing about Struts is that it gives you more than enough
  rope to
  use wisely or hang yourself :)
 
  robert
 
 
 
  -Original Message-
  From: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 17, 2003 9:24 AM
  To: '[EMAIL PROTECTED]'
  Subject: Newbie: java.lang.boolean and DynaActionForm?
 
 
  Hi,
 
  Both 'Struts in Action' and 'Programming Jakarta Struts' state that
  ActionForms and DynaActionForms are nearly equivalent and the
  main advantage
  of using DynaActionForms is that you don't have to declare all the
  getters
  and setters.
  In DynaAction Forms each property can be of a (array of a)
  primitive types.
 
  Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
  properties from a DynaActionForm on december 16), I partially
  succeeded in
  solving the first problem which only confronted me with the next
  problem :-(
  And while looking for a solution to that problem, I found a bugreport
  (23355) in which Craig states that
 
  'Adding these (getInteger, getBoolean etc, Ben) would encourage a
  behavior
  that Struts discourages -- using
  non-String data types in a form bean.'
 
  Maybe that this explains why I have only found examples that use
  String-properties (which lead me to my first question: where can I
  find
  examples that use non_string properties?) but it leaves me with the
  more
  fundamental question:
  Why do DynaActionForms offer the possibility to declare non-String
  properties without supporting them?
  Should I avoid using DynaActionForms at all and use the
  DynaValidatorForm?
 
  Ben Engbers
 
  -
  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]



Re: Newbie: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Mark Lowe
Hi Ed

On 17 Dec 2003, at 15:49, Ed Dowgiallo wrote:

Mark,

Perhaps I am getting old, but the meaning of your metaphors went  
over my
head.  On the other hand, this is an international audience.

What is a chocolate fire guard?
a fire guard is like a shield one places in front of a fire to prevent  
any bits of hot ash escaping and setting one's house on fire. These are  
usually made of metal as it is fire proof. A fireguard made of  
chocolate wouldn't be much use, as it would melt and no protect one's  
house from the peril of smoldering ash.

Do you believe it is harder or easier to use DynaActionForms  
instead of
Strings?
A few months ago it was certainly the case that using strings when  
using dynaaction forms was the only sure way of getting stuff running.  
But robert sound like he's been using objects in there and sounds good  
to me, I thing that beanutils has problems with BigDecimal and perhaps  
other objects but I dont remeber the details. I haven't used dynaforms  
in a while cos i dont like the way you have to wait until runtime to  
see whether there's a problem.

Is taking the piss a bit a good thing or a bad thing?
Its another why of saying, taking the mickey , or making fun of  
something.. It used to be the case in victorian times in england that  
urine would fetch enough money for a decent meal. As urine was used for  
cosmetic and medical purposes by the affluent classes urine would be  
exchanged by poorer folks for a financial reward. Thus the phrase was  
born taking the piss its also where spending a penny came from  
also.

Cheers Mark

Thank you,
Ed
- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 10:33 AM
Subject: Re: Newbie: java.lang.boolean and DynaActionForm?

No one's suggesting that anyone hangs them selves or that struts isn't
good. But the fact that this list sees a high influx of newbies,
getting battered with high-brow design concepts which while are very
interesting have a certain chocolate fire guard quality to them .
Easiest thing is to make all the form properties strings, or like has
been suggested, non primitives. It was certainly the case a few months
ago that to use dynaaction forms then it was just less bother to use
strings.
Sure nesting model objects in action forms does take the piss a bit,
but its nothing that cant be sorted when clients/non tech bosses have
stopped wetting themselves about image swaps..
Cheers Mark

On 17 Dec 2003, at 15:27, Robert Taylor wrote:

To address the fundemental question, it is considered a best
practice
to only use String or Boolean objects or collections of String and/or
Boolean objects or collection of
data structures which contain String and/or Boolean objects in your
forms.
This is because it gives you
more control over validation. This doesn't mean that DynaActionForms  
or
any DynaForm for that matter doesn't support non-string types. It
supports
any Object because essentially the DynaXXXForms internal data
structure is a
Map.

In general the Struts form should be a ValueObject passing immutable
data
from the input
to be processed or passing immutable data to the output to be  
rendered.

The great thing about Struts is that it gives you more than enough
rope to
use wisely or hang yourself :)
robert



-Original Message-
From: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:24 AM
To: '[EMAIL PROTECTED]'
Subject: Newbie: java.lang.boolean and DynaActionForm?
Hi,

Both 'Struts in Action' and 'Programming Jakarta Struts' state that
ActionForms and DynaActionForms are nearly equivalent and the
main advantage
of using DynaActionForms is that you don't have to declare all the
getters
and setters.
In DynaAction Forms each property can be of a (array of a)
primitive types.
Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
properties from a DynaActionForm on december 16), I partially
succeeded in
solving the first problem which only confronted me with the next
problem :-(
And while looking for a solution to that problem, I found a  
bugreport
(23355) in which Craig states that

'Adding these (getInteger, getBoolean etc, Ben) would encourage a
behavior
that Struts discourages -- using
non-String data types in a form bean.'
Maybe that this explains why I have only found examples that use
String-properties (which lead me to my first question: where can I
find
examples that use non_string properties?) but it leaves me with the
more
fundamental question:
Why do DynaActionForms offer the possibility to declare non-String
properties without supporting them?
Should I avoid using DynaActionForms at all and use the
DynaValidatorForm?
Ben Engbers

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




validation and DynaActionForm

2003-12-17 Thread Marco Mistroni
Hi all,
I am experiencing problems with DynaActionForm..
I have a DynaActionForm that contains 13 properties and
A DispatchAction used calling different methods depending
On the value of one parameter (named methodToCall).

Now, when I enter the page for the first time the only request
Parameter is 'methodToCall' since when I enter the page I need to
Remove some values that were with session scope.

The problem is that when I enter page for the first time I receive 
Following exception:

2/03 16:04:21:963 GMT] 51272c9d WebGroup  E SRVE0026E: [Servlet
Error]-[action]: java.lang.NullPointerException
at org.apache.commons.validator.Validator.validate(Unknown
Source)
at
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm
.java:303)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcess
or.java:893)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
247)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


Now, since it is a NullPointerException and it is raised by the
validate, my assumption is that the DynaValidatorForm is trying to
validate all the parameters in order to populate the Form, and since the
only parameter in the request is methodToCall, it raises an exception.

But, since I am no expert in DynaActionForm, can anyone help me out in
Solving my problem?

Thanx in advance and regards
marco




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



Re: Newbie: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Mark Lowe
Hi Ed

I've checked my spellings this time.

On 17 Dec 2003, at 15:49, Ed Dowgiallo wrote:

Mark,

Perhaps I am getting old, but the meaning of your metaphors went  
over my
head.  On the other hand, this is an international audience.

What is a chocolate fire guard?
A fire guard is like a shield one places in front of a fire to prevent  
any bits of hot ash escaping and setting one's house on fire. These are  
usually made of metal as it is fire proof. A fireguard made of  
chocolate wouldn't be much use, as it would melt and not protect one's  
house from the peril of smoldering ash.

Do you believe it is harder or easier to use DynaActionForms  
instead of
Strings?
A few months ago it was certainly the case that using strings when  
using dynaaction forms was the only sure way of getting stuff running.  
But robert sounds like he's been using objects in there and sounds good  
to me, I think that beanutils has problems with BigDecimal and perhaps  
other objects but I dont remeber the details. I haven't used dynaforms  
in a while because i dont like the way you have to wait until runtime  
to see whether there's a problem.

Is taking the piss a bit a good thing or a bad thing?
Its another why of saying, taking the mickey , or making fun of  
something.. It used to be the case in victorian times in england that  
urine would fetch enough money for a decent meal. As urine was used for  
cosmetic and medical purposes by the affluent classes, urine would be  
exchanged by poorer folks for a financial reward. Thus the phrase was  
born taking the piss its also where spending a penny came from.

Cheers Mark

Thank you,
Ed
- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 10:33 AM
Subject: Re: Newbie: java.lang.boolean and DynaActionForm?

No one's suggesting that anyone hangs them selves or that struts isn't
good. But the fact that this list sees a high influx of newbies,
getting battered with high-brow design concepts which while are very
interesting have a certain chocolate fire guard quality to them .
Easiest thing is to make all the form properties strings, or like has
been suggested, non primitives. It was certainly the case a few months
ago that to use dynaaction forms then it was just less bother to use
strings.
Sure nesting model objects in action forms does take the piss a bit,
but its nothing that cant be sorted when clients/non tech bosses have
stopped wetting themselves about image swaps..
Cheers Mark

On 17 Dec 2003, at 15:27, Robert Taylor wrote:

To address the fundemental question, it is considered a best
practice
to only use String or Boolean objects or collections of String and/or
Boolean objects or collection of
data structures which contain String and/or Boolean objects in your
forms.
This is because it gives you
more control over validation. This doesn't mean that DynaActionForms  
or
any DynaForm for that matter doesn't support non-string types. It
supports
any Object because essentially the DynaXXXForms internal data
structure is a
Map.

In general the Struts form should be a ValueObject passing immutable
data
from the input
to be processed or passing immutable data to the output to be  
rendered.

The great thing about Struts is that it gives you more than enough
rope to
use wisely or hang yourself :)
robert



-Original Message-
From: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 9:24 AM
To: '[EMAIL PROTECTED]'
Subject: Newbie: java.lang.boolean and DynaActionForm?
Hi,

Both 'Struts in Action' and 'Programming Jakarta Struts' state that
ActionForms and DynaActionForms are nearly equivalent and the
main advantage
of using DynaActionForms is that you don't have to declare all the
getters
and setters.
In DynaAction Forms each property can be of a (array of a)
primitive types.
Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
properties from a DynaActionForm on december 16), I partially
succeeded in
solving the first problem which only confronted me with the next
problem :-(
And while looking for a solution to that problem, I found a  
bugreport
(23355) in which Craig states that

'Adding these (getInteger, getBoolean etc, Ben) would encourage a
behavior
that Struts discourages -- using
non-String data types in a form bean.'
Maybe that this explains why I have only found examples that use
String-properties (which lead me to my first question: where can I
find
examples that use non_string properties?) but it leaves me with the
more
fundamental question:
Why do DynaActionForms offer the possibility to declare non-String
properties without supporting them?
Should I avoid using DynaActionForms at all and use the
DynaValidatorForm?
Ben Engbers

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




RE: BUG!!! FormFile

2003-12-17 Thread Dan Payne
I have the same problem but ONLY with Opera 7.2x

I'm using Struts 1.1 and with Opera 7.1 everything
worked fine. The formFile field could be left blank.
When I upgraded to 7.2 it began to throw a argument
type mismatch when the formFile field was left blank.
Could this be the source of your problem? Everything
still works fine with IE. Here's the stack trace:

javax.servlet.ServletException: BeanUtils.populate
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)

root cause 

java.lang.IllegalArgumentException: argument type
mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at

RE: html:img is not getting recognised.

2003-12-17 Thread Dan Payne
Wouldn't it need to be

html-el:img page=/images/cal.gif
onClick=popUpCalendar(this,
ParameterEditForm.endDate,
'dd-mmm-',46,735) /

as using src won't append the context?

-Dan

-Original Message-
From: Yves Sy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:55 AM
To: 'Struts Users Mailing List';
[EMAIL PROTECTED]
Subject: RE: html:img is not getting recognised.


Struts already appends the context path.

html:img src=./images/cal.gif
onClick=popUpCalendar(this,
ParameterEditForm.endDate,
'dd-mmm-',46,735) /

...should be enough

-Yves-

-Original Message-
From: Amit Kumar Sharma
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 4:33 PM
To: Struts Users Mailing List
Subject: html:img is not getting recognised.

Dear friends,

I am substituting the normal HTML image tag 
img src=%=contextPath%/images/cal.gif
onClick=popUpCalendar(this,
ParameterEditForm.endDate,
'dd-mmm-',46,735) 
with the shown below but is not getting recognised,
can somebody guide
me
out how to use it, I am new to struts.
html:img src=%=contextPath%/images/cal.gif
onClick=popUpCalendar(this,
ParameterEditForm.endDate,
'dd-mmm-',46,735) /

Regards,
Amit Kumar Sharma
SysArris Software Pvt Ltd
120A, Elephant Rock Road,
3rd Block, Jayanagar, 
Bangalore - 560011
Tel.: 91-80-665 4965 / 665 5052
[EMAIL PROTECTED]
  
 





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


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



Re: validation and DynaActionForm

2003-12-17 Thread Mark Lowe
Hi Marco

Perhaps try a none strust form element

input type=hidden name=methodToCall value=foo

rather than

html:hidden property=methodToCall value=foo /

also if possible in your situation

html:form action=/myaction.do?methodToCall=foo

Cheers Mark

On 17 Dec 2003, at 16:10, Marco Mistroni wrote:

Hi all,
I am experiencing problems with DynaActionForm..
I have a DynaActionForm that contains 13 properties and
A DispatchAction used calling different methods depending
On the value of one parameter (named methodToCall).
Now, when I enter the page for the first time the only request
Parameter is 'methodToCall' since when I enter the page I need to
Remove some values that were with session scope.
The problem is that when I enter page for the first time I receive
Following exception:
2/03 16:04:21:963 GMT] 51272c9d WebGroup  E SRVE0026E: [Servlet
Error]-[action]: java.lang.NullPointerException
	at org.apache.commons.validator.Validator.validate(Unknown
Source)
	at
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorFor 
m
.java:303)
	at
org.apache.struts.action.RequestProcessor.processValidate(RequestProces 
s
or.java:893)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java 
:
247)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
	at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Now, since it is a NullPointerException and it is raised by the
validate, my assumption is that the DynaValidatorForm is trying to
validate all the parameters in order to populate the Form, and since  
the
only parameter in the request is methodToCall, it raises an exception.

But, since I am no expert in DynaActionForm, can anyone help me out in
Solving my problem?
Thanx in advance and regards
marco


-
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: validation and DynaActionForm

2003-12-17 Thread Marco Mistroni
Hi Mark,
Thanx.. but this

A href=/myaction.do?methodToCall=foo../a

is exactly what I am doing..

I am assuming that If validator is trying to validate all the
Parameters I have no other choice than redirect straight to the
Jsp...

Thanx anyway and regards
marco




On 17 Dec 2003, at 16:10, Marco Mistroni wrote:

 Hi all,
   I am experiencing problems with DynaActionForm..
 I have a DynaActionForm that contains 13 properties and
 A DispatchAction used calling different methods depending
 On the value of one parameter (named methodToCall).

 Now, when I enter the page for the first time the only request
 Parameter is 'methodToCall' since when I enter the page I need to
 Remove some values that were with session scope.

 The problem is that when I enter page for the first time I receive
 Following exception:

 2/03 16:04:21:963 GMT] 51272c9d WebGroup  E SRVE0026E: [Servlet
 Error]-[action]: java.lang.NullPointerException
   at org.apache.commons.validator.Validator.validate(Unknown
 Source)
   at

org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorFor 
 m
 .java:303)
   at

org.apache.struts.action.RequestProcessor.processValidate(RequestProces 
 s
 or.java:893)
   at

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java 
 :
 247)
   at

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
   at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


 Now, since it is a NullPointerException and it is raised by the
 validate, my assumption is that the DynaValidatorForm is trying to
 validate all the parameters in order to populate the Form, and since  
 the
 only parameter in the request is methodToCall, it raises an exception.

 But, since I am no expert in DynaActionForm, can anyone help me out in
 Solving my problem?

 Thanx in advance and regards
   marco




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



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


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



RE: validation and DynaActionForm / concrete question

2003-12-17 Thread Marco Mistroni
Hi all,
After struggling with my application, I have
One question to ask.
I have a DispatchAction class that handles my logic, and
A DynaActionForm associated with it.
The problem is that the jsp from which the request comes can
Contain either 1, 2 parameters (out of 13 of DynaActionForm) or
13/13 parameters, since the page presents different information
depending
on which task I have to perform (either a search or an update or
delete).
Now, I keep on getting ValidationException when I have only 2 parameters
In my DynaActionForm I have 9 Strings, 2 BigDecimal, 1 Short and 1
Timestamp.

Am I receiving the exception (listed below) because Struts is trying to
validate all the input parameters? If that is true, is It worth to use
DynaActionForm when I don't have all the parameters supplied from jsp?

Or, how do I have to proceed? 

Anyone has any suggestions?

Thanx and regards
Marco




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



Re: Newbie: java.lang.boolean and DynaActionForm?

2003-12-17 Thread Ed Dowgiallo
Thank you for the translation.  ;-)

Ed
- Original Message - 
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 11:11 AM
Subject: Re: Newbie: java.lang.boolean and DynaActionForm?


 Hi Ed

 I've checked my spellings this time.

 On 17 Dec 2003, at 15:49, Ed Dowgiallo wrote:

  Mark,
 
  Perhaps I am getting old, but the meaning of your metaphors went
  over my
  head.  On the other hand, this is an international audience.
 
  What is a chocolate fire guard?

 A fire guard is like a shield one places in front of a fire to prevent
 any bits of hot ash escaping and setting one's house on fire. These are
 usually made of metal as it is fire proof. A fireguard made of
 chocolate wouldn't be much use, as it would melt and not protect one's
 house from the peril of smoldering ash.

 
  Do you believe it is harder or easier to use DynaActionForms
  instead of
  Strings?

 A few months ago it was certainly the case that using strings when
 using dynaaction forms was the only sure way of getting stuff running.
 But robert sounds like he's been using objects in there and sounds good
 to me, I think that beanutils has problems with BigDecimal and perhaps
 other objects but I dont remeber the details. I haven't used dynaforms
 in a while because i dont like the way you have to wait until runtime
 to see whether there's a problem.

 
  Is taking the piss a bit a good thing or a bad thing?

 Its another why of saying, taking the mickey , or making fun of
 something.. It used to be the case in victorian times in england that
 urine would fetch enough money for a decent meal. As urine was used for
 cosmetic and medical purposes by the affluent classes, urine would be
 exchanged by poorer folks for a financial reward. Thus the phrase was
 born taking the piss its also where spending a penny came from.

 Cheers Mark

 
  Thank you,
  Ed
  - Original Message -
  From: Mark Lowe [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Wednesday, December 17, 2003 10:33 AM
  Subject: Re: Newbie: java.lang.boolean and DynaActionForm?
 
 
  No one's suggesting that anyone hangs them selves or that struts isn't
  good. But the fact that this list sees a high influx of newbies,
  getting battered with high-brow design concepts which while are very
  interesting have a certain chocolate fire guard quality to them .
 
  Easiest thing is to make all the form properties strings, or like has
  been suggested, non primitives. It was certainly the case a few months
  ago that to use dynaaction forms then it was just less bother to use
  strings.
 
  Sure nesting model objects in action forms does take the piss a bit,
  but its nothing that cant be sorted when clients/non tech bosses have
  stopped wetting themselves about image swaps..
 
  Cheers Mark
 
  On 17 Dec 2003, at 15:27, Robert Taylor wrote:
 
  To address the fundemental question, it is considered a best
  practice
  to only use String or Boolean objects or collections of String and/or
  Boolean objects or collection of
  data structures which contain String and/or Boolean objects in your
  forms.
  This is because it gives you
  more control over validation. This doesn't mean that DynaActionForms
  or
  any DynaForm for that matter doesn't support non-string types. It
  supports
  any Object because essentially the DynaXXXForms internal data
  structure is a
  Map.
 
  In general the Struts form should be a ValueObject passing immutable
  data
  from the input
  to be processed or passing immutable data to the output to be
  rendered.
 
  The great thing about Struts is that it gives you more than enough
  rope to
  use wisely or hang yourself :)
 
  robert
 
 
 
  -Original Message-
  From: Engbers, ir. J.B.O.M. [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 17, 2003 9:24 AM
  To: '[EMAIL PROTECTED]'
  Subject: Newbie: java.lang.boolean and DynaActionForm?
 
 
  Hi,
 
  Both 'Struts in Action' and 'Programming Jakarta Struts' state that
  ActionForms and DynaActionForms are nearly equivalent and the
  main advantage
  of using DynaActionForms is that you don't have to declare all the
  getters
  and setters.
  In DynaAction Forms each property can be of a (array of a)
  primitive types.
 
  Thanks to Pedro Salgado and Martin Gainty (see Retrieving boolean
  properties from a DynaActionForm on december 16), I partially
  succeeded in
  solving the first problem which only confronted me with the next
  problem :-(
  And while looking for a solution to that problem, I found a
  bugreport
  (23355) in which Craig states that
 
  'Adding these (getInteger, getBoolean etc, Ben) would encourage a
  behavior
  that Struts discourages -- using
  non-String data types in a form bean.'
 
  Maybe that this explains why I have only found examples that use
  String-properties (which lead me to my first question: where can I
  find
  examples that use 

Re: validation and DynaActionForm / concrete question

2003-12-17 Thread Mark Lowe
Hi marco

well i think the problem your having is because you're using a dispatch 
action

so the form is mapped to the action and its set to validate. You can 
either separte yu dispatch actions into standard actions or hack it by 
having a single action that calls your dispatch action much like you 
were suggesting doing with jsp.

Cheers Mark

On 17 Dec 2003, at 16:35, Marco Mistroni wrote:

Hi all,
	After struggling with my application, I have
One question to ask.
I have a DispatchAction class that handles my logic, and
A DynaActionForm associated with it.
The problem is that the jsp from which the request comes can
Contain either 1, 2 parameters (out of 13 of DynaActionForm) or
13/13 parameters, since the page presents different information
depending
on which task I have to perform (either a search or an update or
delete).
Now, I keep on getting ValidationException when I have only 2 
parameters
In my DynaActionForm I have 9 Strings, 2 BigDecimal, 1 Short and 1
Timestamp.

Am I receiving the exception (listed below) because Struts is trying to
validate all the input parameters? If that is true, is It worth to use
DynaActionForm when I don't have all the parameters supplied from jsp?
Or, how do I have to proceed?

Anyone has any suggestions?

Thanx and regards
Marco


-
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: Plea for help w/Struts-Hibernate Plugin that has it working!

2003-12-17 Thread David Erickson
Excellent I will give that a try.  What I was hoping to do was maintain one
JDNI location for my database, but I will definitly try this out.
Thanks!
-David

- Original Message - 
From: David Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 6:34 PM
Subject: RE: Plea for help w/Struts-Hibernate Plugin that has it working!


 David,

 There is an alternative Struts/Hibernate/JNDI combination.  All of it
hinges
 on one file: hibernate.cfg.xml.  It doesn't require any changes to
 server.xml or web.xml and works (at the very least) for me on Struts v1.0

 v1.1 with Hibernate v2.0.3  V2.1beta6 under Tomcat 4.1.24 through 4.1.29.

 * Use a hibernate.cfg.xml file like so (passwords changed and pardon
my
 MySQL slant)

 ?xml version='1.0' encoding='utf-8'?
 !DOCTYPE hibernate-configuration PUBLIC
 -//Hibernate/Hibernate Configuration DTD 2.0//EN

http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd;
 hibernate-configuration
 session-factory name=dgf:/hibernate/SessionFactory
 property
 name=dialectnet.sf.hibernate.dialect.MySQLDialect/property
 property name=connection.usernameAA/property
 property name=connection.passwordBB/property
 property
 name=connection.urljdbc:mysql://localhost:3306/authors/property
 property
 name=connection.driver_classcom.mysql.jdbc.Driver/property
 property name=show_sqltrue/property
 property name=use_outer_jointrue/property
 property

name=transaction.factory_classnet.sf.hibernate.transaction.JDBCTransactio
 nFactory/property
 property name=dbcp.minIdle1/property
 !-- Optional, I use this but it requires an opensymphony.org download of
 OSCache
 property name=cache.use_query_cachetrue/property
 property

name=cache.provider_classnet.sf.hibernate.cache.OSCacheProvider/property
 
 --

 !-- insert any mapping file so you don't need to hardcode adding
 classes or adding files in a Java class --
 mapping resource=hibernate/Misc.hbm.xml/
 /session-factory
 /hibernate-configuration

 The JNDI location is set in the session-factory tag using the 'name='
 attribute.   Whatever name you choose, DO NOT use anything starting
 java:comp/env as that is read-only in Tomcat and will NOT work.  I made
up
 a context named dgf:/hibernate/SessionFactory and was pleasantly
surprised
 when hibernate created the context for me and stored the SessionFactory
 within it so I could us it in JNDI context lookups after I got the
 InitialContext and performed a
 ' SessionFactory sf = (SessionFactory)
 context.lookup(dgf:/hibernate/SessionFactory);'.

 I see you want to use DBCP.  As long as you set a minimum of 1 dbcp
 property, hibernate will detect you want to use DBCP as your connection
 pool.  Feel free to set more than one DBCP property or even to use
something
 other than dbcp.minIdle as in my working example above.

 Hibernate can work with other connection pools.  I recommend avoiding C3P0
 as it can't shutdown (eats up memory unless you fully shutdown the JVM
[i.e.
 TOMCAT] and restart).  A Beta C3P0 allows shutdown of a C3P0 pool, but the
 last time I checked, the Hibernate controlling class for C3P0 pooling
still
 had an empty finalize() and never actually shutdown my C3P0 pool.

 Regards,
 David

 -Original Message-
 From: David Erickson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 16, 2003 7:20 PM
 To: Struts Mailing List
 Subject: Plea for help w/Struts-Hibernate Plugin that has it working!


 For some reason I just cannot make the Struts-Hibernate plugin work.. I
 can't make the Struts-Hibernate Listener work either.  Here is the link to
 class I am trying to use:

 http://www.hibernate.org/133.html

 Here is the error I get without fail every time.. now note that this jndi
 connection WORKS fine when I use the HibernateUtil class, or when I use my
 own JDNI tests.

 Error:
 2003-12-16 17:10:31,452 [DEBUG] impl.SessionImpl - opened session
 2003-12-16 17:10:31,468 [DEBUG] transaction.JDBCTransaction - begin
 2003-12-16 17:10:31,484 [DEBUG] util.JDBCExceptionReporter - SQL Exception
 java.sql.SQLException: Cannot load JDBC driver class 'null'
  at

org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
 a:529)
  at

org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
 12)
  at

net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas
 ourceConnectionProvider.java:59)
  at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:262)
  at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3155)
  at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3138)
  at

net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)

 My setup:
 tomcat_home\common\lib contains:
 commons-dbcp.jar
 commons-pool.jar
 jdbc2_0-stdext.jar
 jndi.jar
 

RE: validation and DynaActionForm / concrete question

2003-12-17 Thread Wendy Smoak
 well i think the problem your having is because you're using 
 a dispatch action
 so the form is mapped to the action and its set to validate. You can 
 either separte yu dispatch actions into standard actions or 
 hack it by having a single action that calls your dispatch action much
like you 
 were suggesting doing with jsp.

What about LookupDispatchAction?  It uses a request parameter to figure
out which method to call.  I use it with hidden form fields and a bit of
JavaScript.

In Marco's case, overriding the validate method might work.  Only call
super.validate() if all of the parameters are present.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



RE: validation and DynaActionForm / concrete question

2003-12-17 Thread Marco Mistroni
Hi Wendy,
Only a little problem.. I haven't written any class for my
DynaActionForm. Instead, I declare all the properties in the
struts-config.xml

Struts does all the rest

But, anyway, can u give more details on ur solution to my problem?

Regards
marco

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: 17 December 2003 17:06
To: Struts Users Mailing List
Subject: RE: validation and DynaActionForm / concrete question

 well i think the problem your having is because you're using 
 a dispatch action
 so the form is mapped to the action and its set to validate. You can 
 either separte yu dispatch actions into standard actions or 
 hack it by having a single action that calls your dispatch action much
like you 
 were suggesting doing with jsp.

What about LookupDispatchAction?  It uses a request parameter to figure
out which method to call.  I use it with hidden form fields and a bit of
JavaScript.

In Marco's case, overriding the validate method might work.  Only call
super.validate() if all of the parameters are present.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Character encoding issue

2003-12-17 Thread Seyed Razavi
Howdy,

I've got a strange problem with character encoding German characters.
I'm using iso-8859-1.  The app is running on JDK 1.4.2, Jboss 3.2 w/
Tomcat and using Struts 1.1.

The application works fine on local Windows machine and on a Red Hat
system.

However, when moved to a Debian system it behaves strangely ONLY when
accessing Action mappings NOT when accessing JSPs directly.

Accessing a JSP directly shows all messages properly displayed but
accessing it via an Action class (through an ActionForward) shows all
German characters as ?.

The HTML encoding is properly set and all JSP include:

%@ page contentType=text/html; charset=iso-8859-1%
%@ page pageEncoding=iso-8859-1%

I've set the following in the run.sh for Jboss in case it's a system
issue:

export LANG=german
export LC_ALL=de_DE

I don't think it is a system issue because as I said, all JSP when
accessed directly respond properly.  The resource bundle is also
iso-8859-1 encoded.

I'm also setting the Locale on each request to de (using the Action
class setLocale method) just in case.  The output from the action
servlet seem to have the correct content-type according to Netscape.

Anybody help?

Cheers,

Seyed


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



using redirecting forwards after failed validation

2003-12-17 Thread Par Winzell
Hello everyone -- this is my first post. I'm hoping you can help with a
problem. I've seen bits and pieces of this question asked, but not
entirely...

Here's my problem:

When the user enters data into a 'enter search parameters' form and
validation fails, I don't want the URL to proceed to the 'perform the
search' action. This means I have to use redirecting forwards for the
'input' attribute.

However, with redirects... if I understand correctly... it's not good
enough to store validation errors in the request attributes. They need
to go into session scope. My problem is figuring out where this should
happen.

Experimentally, I now mask validate(), which basically does

  errors = super.validate();
  request.getSession().setAttribute(ERROR_KEY, errors);
  return errors;

but this feels rather nasty to me; validate() is supposed to return
values, not cause side-effects... right?

The problem is that RequestProcessor.java is entirely atomic all the way
from calling validate() to performing the redirect. Is there some other
way to do this that I'm missing? ... or should I not be doing what I'm
doing? Is there some other way to get redirection to work, with the
validator framework?

Appreciate any help --

Par Winzell
Madison, WI



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



Re: Flash Flex w/ Struts article

2003-12-17 Thread BaTien Duong
Vic Cekvenich wrote:

http://www.macromedia.com/devnet/flex/articles/struts.html

Is this for real? YES!

Point of Struts is MVC, so some people do JSP, Velocity... other do 
Hibrenate or iBatis... one thing remains.
(note how they did not support Spring, or WebWork or XYZ).

Flex is XML like, used to be Royale ( and my guess the product that 
resulted when MacroMedia rummored to break of from JSF).
Yes. This is what I am looking at Struts 2 of request/response framework 
(struts-chain): in the article example of registration service, we will 
probably have something like this:

Registration request - RequestProcessor - RegistrationService - 
RegistrationAction  - blah blah blah - ResponseProcessor - Selected 
Presentation engine - user response

RegistrationService can use RegistrationForm, Validation, etc. There can 
be different presentation engines: JSP, JSF, Xform, WML. etc.

This makes open sources very interesting place to work.

BaTien
DBGROUPS
(This is diffrent than PetStore http://blueprints.macromedia.com , I 
also realy like the Components from Flash Pro 2004 such as Tree, Grid, 
Calendar that bind to any SOAP like source)

If you want Rich UI that runs on Linux, OSX, PocketPC, Windoze and of 
loads UI rendering to each client thus giving scalability!
If you are bidding projects, and your bid shows clients the richer UI, 
guess who wins the gig?
And it's Struts, something you know.

.V



-
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: validation and DynaActionForm / concrete question

2003-12-17 Thread Wendy Smoak
Marco wrote:
   Only a little problem.. I haven't written any class for my
 DynaActionForm. Instead, I declare all the properties in the
 struts-config.xml

That does not preclude you from writing a class-- Dyna forms just get
you out of writing a bunch of get/set methods.  You can still override
'validate' and 'reset' if you need to.  I use DynaValidatorForm, and
have a Java class for all but the most trivial forms.  In struts-config,
use your class name as the 'type' in the form-bean tag.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



Struts internal error

2003-12-17 Thread Julien Martin
Hello,
I am working on a fairly complex application and I am running into a struts
internal error.  Can anyone tell me how to sort it please.

Here is the exception trace:

***
HTTP Status 500 -




type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:536)

root cause

java.lang.IllegalAccessError: tried to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor
at
org.apache.commons.beanutils.MappedPropertyDescriptor.getPublicDeclaredMetho
ds(MappedPropertyDescriptor.java:383)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.internalFindMethod(Map
pedPropertyDescriptor.java:453)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.findMethod(MappedPrope
rtyDescriptor.java:527)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.(MappedPropertyDescrip
tor.java:149)
at
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUti
ls.java:907)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1096)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:816)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at 

RE: using redirecting forwards after failed validation

2003-12-17 Thread Barett McGavock
I did the following to get around the drawback with RequestProcessor that
you pointed out:
1) keep the ActionErrors as a request attribute
2) set the validate parameter to false for the ActionMapping
3) add code like the following to the search action itself:
errs = form.validate();
if (!errs.isEmpty()) {
  saveErrors(errs);
  return mapping.getInput();
}

I've also seen a solution like this floating around the list in the last few
days.

A note: this solution will forward to your input page, not redirect. I'm not
entirely sure from your message on why you'd like to redirect to the input.
It sounds like you're not set on it, so maybe a forward like the above will
do.

B

-Original Message-
From: Par Winzell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 10:41 AM
To: [EMAIL PROTECTED]
Subject: using redirecting forwards after failed validation


Hello everyone -- this is my first post. I'm hoping you can help with a
problem. I've seen bits and pieces of this question asked, but not
entirely...

Here's my problem:

When the user enters data into a 'enter search parameters' form and
validation fails, I don't want the URL to proceed to the 'perform the
search' action. This means I have to use redirecting forwards for the
'input' attribute.

However, with redirects... if I understand correctly... it's not good enough
to store validation errors in the request attributes. They need to go into
session scope. My problem is figuring out where this should happen.

Experimentally, I now mask validate(), which basically does

  errors = super.validate();
  request.getSession().setAttribute(ERROR_KEY, errors);
  return errors;

but this feels rather nasty to me; validate() is supposed to return values,
not cause side-effects... right?

The problem is that RequestProcessor.java is entirely atomic all the way
from calling validate() to performing the redirect. Is there some other way
to do this that I'm missing? ... or should I not be doing what I'm doing? Is
there some other way to get redirection to work, with the validator
framework?

Appreciate any help --

Par Winzell
Madison, WI

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



Re: Chain Was: Flash Flex w/ Struts article

2003-12-17 Thread Vic Cekvenich
BaTien Duong wrote:
Yes. This is what I am looking at Struts 2 of request/response framework 
(struts-chain): in the article example of registration service, we will 
probably have something like this:

Registration request - RequestProcessor - RegistrationService - 
RegistrationAction  - blah blah blah - ResponseProcessor - Selected 
Presentation engine - user response

As long as Chains are used for technology and not for business 
application workflow, great.

I think it be a missues to do workflow, that some people will try to use 
it for that.

.V



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


[OT?] WebSphere and commons-logging

2003-12-17 Thread Hibbs, David
For those who are using commons-logging (i.e all Struts users!) on
WebSphere 4.0 or greater, you need to be aware that WebSphere comes with its
own implementation of a commons-logging Log.  Not only that, but it comes
with its own implementation of LogFactory... and a
commons-logging.properties file that forces the use of the IBM Log.  

This isn't so bad in itself, but the IBM log swallows all log
messages of a detail greater than info.  i.e. log.debug() and log.trace()
messages disappear.  That would be fine if you could change the log level
(as expected with commons-logging) and make them appear.  However, IBM
support won't tell me how to change it!  As far as they know (and the pushed
it back to level 3, i.e. the developers), it cannot be changed.  Thus,
you're stuck at a log level of Info and using their logger unless you change
your class loader mode to application first rather than parent first.  What
a kludge!

Instead of fixing the problem, they opened a feature request!
Aaargh!  They're as bad as Sun!  If your log messages are important to you,
along with the capability to change log levels and loggers without having to
kludge a server setting, please visit their RFE database and vote for the
RFE so as to get it through their thick skulls.  It requires a
login/password, but it's a simple matter of signing up for one.

To quote support, It is request # 241 and you can view it via this
link : http://www7b.software.ibm.com/webapp/wsdd/wasServlet3. Development
will evaluate and prioritize the requests (if chosen) to be included in
future release of Websphere Application Server -- and if you have problems
getting to the page, well, try again later.  Their website seems flaky.  Go
figure.

Thanks,

--David 

David Hibbs, ACS
Staff Programmer / Analyst
Distributed Applications Development and Support
American National Insurance Company


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



RE: Modules with Tiles Problem

2003-12-17 Thread Hibbs, David
If you have components used everywhere for every module, create some new and
separate struts-config.xml and tiles-defs.xml files.  You can specify
multiples of each type of file for each module, so each module is free to
reference a shared config file.  

To reference more than one struts-config.xml, simply list them in the
web.xml file separated by commas:

init-param
param-nameconfig/myModule/param-name

param-value/WEB-INF/shared_config.xml,/WEB-INF/myModule_config.xml/param-
value
/init-param

To reference more than one tile definition file, you can do the same thing
in the myModule-config.xml file when you initialize the tiles plugin...

set-property 
property=definitions-config 
value=/WEB-INF/tiles-defs/shared_defs.xml,
/WEB-INF/tiles-defs/myModule_defs.xml 
/

Note, however, that you do NOT want to initiaize the tiles plugin in the
shared config file, or it will not reinitialize it from your module file
with your module definitions!

--David

David Hibbs, ACS
Staff Programmer / Analyst
Distributed Applications Development and Support
American National Insurance Company

 -Original Message-
 From: Patrick Cheng [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 1:27 AM
 To: Struts Users Mailing List
 Subject: RE: Modules with Tiles Problem
 
 
 HI All,
 I found a way to get it working.
 
 %org.apache.struts.util.RequestUtils.selectModule(,request,
 applicatio
 n);%
 html:form action=/Layout.do
 
 I have to do this for every html:form item. 
 This works, but it is ugly. It's even worse since this method is
 deprecated in struts1.2.
 I'm suspecting there must be a better way round right?
 Can someone tell me if this is the way? Or there're smarter ways?
 
 Rgds,
 Patrick.
 -Original Message-
 From: Patrick Cheng 
 Sent: Wednesday, December 17, 2003 10:12 AM
 To: Struts Users Mailing List
 Subject: Modules with Tiles Problem
 
 
 Hi All,
 
 I have a question on Tiles when using Modules(multiple
 struts-config.xml's). As far as I know, switching between modules
 requires more than providing different URLs. Either we use
 ContextRelative forwards or using the struts Swiching Action 
 class. But
 in the situation of tiles, if the layout includes two jsp 
 pages and they
 are from different modules, say, the top part is a generic search
 function, used everywhere for every module, what can I do about this?
 
 Here's my situation.
 2 struts configs : struts-config.xml, struts-module1-config.xml
 Struts-config.xml has an action called 'layout'. Struts-module1-config
 has an action called 'ViewMultiSelect'. So when I go:
 http://localhost:7001/RootContext/module1/ViewMultiSelect.do
 I got my ViewMultiSelect working, but in the tile 'layout', I got:
 
 [ServletException in:/layout/Header.jsp] Cannot retrieve mapping for
 action /Layout' 
 
 My understanding is, when the current module is in Module1, 
 struts won't
 care anything in struts-config.xml, therefore it doesn't know about a
 Layout action. How can I get it to work?
 
 Thanks a lot.
 
 Rgds.
 Patrick.
 
 -
 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]



Targeted forward

2003-12-17 Thread Ovidiu EFTIMIE
Hi,
I have an abstract  base Action class which calls an abstract method called
executeAction. All my Actions implement the executeAction method.
//Snip from BaseAction class

public ActionForward execute(ActionMapping mapping,ActionForm
form,HttpServletRequest request,HttpServletResponse response)throws Exception {
ActionForward forward = null;
try {
forward = executeAction(mapping,form,request,response);
} catch (Exception e) {
ActionErrors errors= new ActionErrors();
ActionError error = null;

if(e instanceof BaseException){
BaseException lex = (BaseException)e;
error = new ErrorMessage(lex.getMessage());
forward = new ActionForward(mapping.getInput());
errors.add(lex.getType(),error);

}else{
if(e.getMessage() != null){
error = new ErrorMessage(e.getMessage());
}else{
error = new ErrorMessage(Constants.DEFAULT_MESSAGE);
}
forward = mapping.findForward(systemError);
errors.add(Constants.BLOCKING,error);
}
saveErrors(request,errors);
}
return forward;
}

//--end snip

So as you can see in case of exception I do a forward to the  input page. The
thing is that there are several cases in which I don't want forward to the
input, and that's beacuse I have a master page which triggers submits on an
iframe. So if there is an error in the iframe page the input (that means the
master page) will be displayed in the iframe ... and that wouldn't look very
nice.

So my question is:   is there any way that I can get the input page to be loaded
in the _parent and not in the iframe,  in case of an error?



Thanx,

Ovidiu


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



Strategy for out of date items through forms using hibernate?

2003-12-17 Thread David Erickson
Hi I am using Struts with Hibernate in a webapplication.. we are using forms
etc. The problem I am currently trying to decide how to handle is thus:

Assume user 1 loads up an object in a form and is modifying it.
Assume user 2 loads up the same object in a form and is also modifying it.
User 1 submits the modified object.
User 2 also submits the object, however his is out of date and I would like
the webapp to tell him that and show the differences that exist.

What is the best way to use hibernate to deal with this? What I have
attempted is using the built in timestamp feature in MySQL, I have a field
in my object that is timestamp but does not insert or update, thus mysql
controls its value. Then when the user submits the object I loaded another
copy of that object from the DB and tried to compare their dates.. however
this gave me an error saying:

net.sf.hibernate.NonUniqueObjectException: a different object with the same
identifier value was already associated with the session: 1, of class:
cmcflex.salesweb.model.prospect.Prospect

because of the object I loaded to compare.

What do do? Is there a better strategy for tackling this? I tried using the
actual timestamp in the properties for my object, but then when I tried to
submit the object the generated sql said when id=? AND timestamp=? meaning
it would not update if the timestamp is different, and I'm unsure if I could
even determine if it did or did not update.

Thanks in advance,
David


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



Weblogic 8.1 - Error in using tag library

2003-12-17 Thread aashra
Environment:

OS: Windows XP
App Server: BEA Weblogic 8.1
MVC: Struts 1.1
IDE: JBuilder 7 Enterprise

JSP File:  See attachment

Error:
Dec 17, 2003 9:34:42 AM MST Error HTTP BEA-101020 
[ServletContext(id=28941,name=hipaax,context-path=/hipaax)] Servlet failed with 
Exception

weblogic.servlet.jsp.JspException: (line 1): 
===
Error in using tag library uri='/WEB-INF/struts-html.tld' prefix='html': The Tag class 
'org.apache.struts.taglib.html.BaseTag' has no setter method corresponding to TLD 
declared attribute 'server', (JSP 1.1 spec, 5.4.1)
===

I have checked the following:
1. Struts.jar is present in web-inf/lib
2. Taglib definitions (uri and location) present in web.xml
3. Struts tld files present under web-inf

I have also searched the BEA newsgroups for solutions in vain.

I use StrutsCX (XML/XSL) for the View part of MVC. So I am not familiar with tag 
libraries and am unable to solve this problem after a day of searching the 
newsgroups/web. Your help and time are greatly appreciated.

Thank you.

Aashra.

PS:Please let me know resources where I could get more information if this is a 
generic issue.





 

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

Re: [OT?] WebSphere and commons-logging

2003-12-17 Thread Ovidiu EFTIMIE
Hi,

Make a file called commons-logging.properties and add this line:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFacto
ry

Put the file in your classpath



Ovidiu

- Original Message - 
From: Hibbs, David [EMAIL PROTECTED]
To: Struts-Users (E-mail) [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:37 PM
Subject: [OT?] WebSphere and commons-logging


 For those who are using commons-logging (i.e all Struts users!) on
 WebSphere 4.0 or greater, you need to be aware that WebSphere comes with its
 own implementation of a commons-logging Log.  Not only that, but it comes
 with its own implementation of LogFactory... and a
 commons-logging.properties file that forces the use of the IBM Log.

 This isn't so bad in itself, but the IBM log swallows all log
 messages of a detail greater than info.  i.e. log.debug() and log.trace()
 messages disappear.  That would be fine if you could change the log level
 (as expected with commons-logging) and make them appear.  However, IBM
 support won't tell me how to change it!  As far as they know (and the pushed
 it back to level 3, i.e. the developers), it cannot be changed.  Thus,
 you're stuck at a log level of Info and using their logger unless you change
 your class loader mode to application first rather than parent first.  What
 a kludge!

 Instead of fixing the problem, they opened a feature request!
 Aaargh!  They're as bad as Sun!  If your log messages are important to you,
 along with the capability to change log levels and loggers without having to
 kludge a server setting, please visit their RFE database and vote for the
 RFE so as to get it through their thick skulls.  It requires a
 login/password, but it's a simple matter of signing up for one.

 To quote support, It is request # 241 and you can view it via this
 link : http://www7b.software.ibm.com/webapp/wsdd/wasServlet3. Development
 will evaluate and prioritize the requests (if chosen) to be included in
 future release of Websphere Application Server -- and if you have problems
 getting to the page, well, try again later.  Their website seems flaky.  Go
 figure.

 Thanks,

 --David

 David Hibbs, ACS
 Staff Programmer / Analyst
 Distributed Applications Development and Support
 American National Insurance Company


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



datasources and oracle 9i

2003-12-17 Thread Claire Wall
hi,

i am using Oracle 9i as my datasource and have declared it in my struts-config as 
follows:

data-source key=DB type=oracle.jdbc.pool.OracleConnectionPoolDataSource
   set-property property=autoCommit value=false/
set-property property=description value=DB_Connection_Pool/
set-property property=driverClass value=oracle.jdbc.driver.OracleDriver/
 
set-property property=maxCount value=5/
set-property property=minCount value=1/
set-property property=password value=password/
set-property property=url value=jdbc:oracle:thin:@ip-of-server:1521:ORACLE1/
set-property property=user value=user/

/data-source


however, when i come to use this datasource in my struts actions, it gives me the 
following error:


Invalid Oracle URL specified: OracleDataSource.makeURL


im accessing the datasource in my actions like so (i use the same thing with an 
SQLServer datasource and it works fine):

DataSource dataSource = (DataSource)servlet.getServletContext().getAttribute(DB);


also, i have my oracle driver jar in the commons folder in tomcat - could this be the 
cause


Any help would be much appreciated!
claire




Question about back button on forward.

2003-12-17 Thread Shah, Shrihas (OFT)








Hi All:



In IE when user hits back button then I want to
forward user to my main page. I want to do this in reset method of the form.
How can I



1)
forward using request object to forward to main page.

2)
Or redirect to main page



Note: At this time I am not executing action class. So
I cannot return mapping. I am just in form. And I want to 

Forward to a specific page.



Any hints? Help??



Thanks.



Shrihas Shah
NYS
Office for Technology
[EMAIL PROTECTED]
Phone
(518) 408-2382
Fax
(518) 473-3389
(US
Postal Service Regular Mail Address)
State
Capitol ESP, PO Box 2062
Albany,
NY 12220-0062
(Parcel
Post/Overnight and Interagency Mail Address)
Empire
State Plaza
Swan
St., Core 4, 1st Floor
Albany,
NY 12223










RE: Struts internal error

2003-12-17 Thread Fullam, Jonathan
You can get the root cause of an internal exception by looking about half
way down the stack trace.  In your case it is:

root cause

java.lang.IllegalAccessError: tried to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor

-Jonathan

-Original Message-
From: Julien Martin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 12:53 PM
To: Struts Users Mailing List
Subject: Struts internal error


Hello,
I am working on a fairly complex application and I am running into a struts
internal error.  Can anyone tell me how to sort it please.

Here is the exception trace:

***
HTTP Status 500 -




type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:536)

root cause

java.lang.IllegalAccessError: tried to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor
at
org.apache.commons.beanutils.MappedPropertyDescriptor.getPublicDeclaredMetho
ds(MappedPropertyDescriptor.java:383)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.internalFindMethod(Map
pedPropertyDescriptor.java:453)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.findMethod(MappedPrope
rtyDescriptor.java:527)
at
org.apache.commons.beanutils.MappedPropertyDescriptor.(MappedPropertyDescrip
tor.java:149)
at
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUti
ls.java:907)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1096)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:816)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at 

Generate Java class from xml?

2003-12-17 Thread Vicky
Does anyone have an idea of how i can generate .java file from xml file? Tools like 
jakrata digester, JOX are there but both of them are useful in populating java beans 
from xml. My requirement is to generate .java file from .xml with getters and setters 
methods for xml elements/attributes. I also tried JAXB. But JAXB generates bunch of 
files and most of them are interfaces, which is not going to work for me. 
 
For e.g. i have following xml file and i want to generate Address.java file with 
getters/setters. Any ideas? 
?xml version='1.0' encoding='UTF-8' ?
 Address
FirstName type=String/
PoBox type=int/
..
/Address
 
 
Thanks,
Vicky




-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

Re: OT: Strategy for out of date items through forms using hibernate?

2003-12-17 Thread Vic Cekvenich
I avoid timestamps.

Just make your where class = to the selct cluase.
In case any colum is changed, it fails.
(if you really need this)

.V

David Erickson wrote:

Hi I am using Struts with Hibernate in a webapplication.. we are using forms
etc. The problem I am currently trying to decide how to handle is thus:
Assume user 1 loads up an object in a form and is modifying it.
Assume user 2 loads up the same object in a form and is also modifying it.
User 1 submits the modified object.
User 2 also submits the object, however his is out of date and I would like
the webapp to tell him that and show the differences that exist.
What is the best way to use hibernate to deal with this? What I have
attempted is using the built in timestamp feature in MySQL, I have a field
in my object that is timestamp but does not insert or update, thus mysql
controls its value. Then when the user submits the object I loaded another
copy of that object from the DB and tried to compare their dates.. however
this gave me an error saying:
net.sf.hibernate.NonUniqueObjectException: a different object with the same
identifier value was already associated with the session: 1, of class:
cmcflex.salesweb.model.prospect.Prospect
because of the object I loaded to compare.

What do do? Is there a better strategy for tackling this? I tried using the
actual timestamp in the properties for my object, but then when I tried to
submit the object the generated sql said when id=? AND timestamp=? meaning
it would not update if the timestamp is different, and I'm unsure if I could
even determine if it did or did not update.
Thanks in advance,
David


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


Struts internal error

2003-12-17 Thread Julien Martin
Thank you Jonathan,
I figured this out myself but I don't know how to sort it out...  Can you
help?
Julien.

- Original Message -
From: Fullam, Jonathan [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 7:58 PM
Subject: RE: Struts internal error


 You can get the root cause of an internal exception by looking about half
 way down the stack trace.  In your case it is:

 root cause

 java.lang.IllegalAccessError: tried to access class
 org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
 org.apache.commons.beanutils.MappedPropertyDescriptor

 -Jonathan

 -Original Message-
 From: Julien Martin [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 12:53 PM
 To: Struts Users Mailing List
 Subject: Struts internal error


 Hello,
 I am working on a fairly complex application and I am running into a
struts
 internal error.  Can anyone tell me how to sort it please.

 Here is the exception trace:

 ***
 HTTP Status 500 -

 --
--
 

 type Exception report

 message

 description The server encountered an internal error () that prevented it
 from fulfilling this request.

 exception

 javax.servlet.ServletException: Servlet execution threw an exception
 at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:269)
 at

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
 Chain.java:98)
 at

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
 .java:176)
 at java.security.AccessController.doPrivileged(Native Method)
 at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:172)
 at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:256)
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:191)
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
 org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
 at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
 )
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
 java:171)
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:641)
 at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
 )
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:641)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
 :174)
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
 at

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
 ction(Http11Protocol.java:392)
 at
 org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
 at

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
 a:619)
 at java.lang.Thread.run(Thread.java:536)

 root cause

 java.lang.IllegalAccessError: tried to access class
 org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
 org.apache.commons.beanutils.MappedPropertyDescriptor
 at

org.apache.commons.beanutils.MappedPropertyDescriptor.getPublicDeclaredMetho
 ds(MappedPropertyDescriptor.java:383)
 at

org.apache.commons.beanutils.MappedPropertyDescriptor.internalFindMethod(Map
 pedPropertyDescriptor.java:453)
 at

org.apache.commons.beanutils.MappedPropertyDescriptor.findMethod(MappedPrope
 rtyDescriptor.java:527)
 at

org.apache.commons.beanutils.MappedPropertyDescriptor.(MappedPropertyDescrip
 tor.java:149)
 at

org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUti
 ls.java:907)
 at 

RE: Generate Java class from xml?

2003-12-17 Thread Higdon, Brian [VIS-Non JJ]
Have you looked at XML beans:

http://xml.apache.org/xmlbeans/



-Original Message-
From: Vicky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
To: [EMAIL PROTECTED]
Subject: Generate Java class from xml?


Does anyone have an idea of how i can generate .java file from xml file?
Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me. 
 
For e.g. i have following xml file and i want to generate Address.java file
with getters/setters. Any ideas? 
?xml version='1.0' encoding='UTF-8' ?
 Address
FirstName type=String/
PoBox type=int/
..
/Address
 
 
Thanks,
Vicky




-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing


Re: Generate Java class from xml?

2003-12-17 Thread Martin Gainty
Castor (http://www.castor.org) which generate the java classes with marshall
and unmarshall methods, but it is not finished, doesn't care to namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as enumeration ...
but I think that a better version will come soon. Generates JAXP compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - 
From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?


 Does anyone have an idea of how i can generate .java file from xml file?
Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.

 For e.g. i have following xml file and i want to generate Address.java
file with getters/setters. Any ideas?
 ?xml version='1.0' encoding='UTF-8' ?
  Address
 FirstName type=String/
 PoBox type=int/
 ..
 /Address


 Thanks,
 Vicky




 -
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing

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



Re: Question about back button on forward.

2003-12-17 Thread Khalid K.
This is an age old questions. There are various javascript 'hacks' around. I 
suggest google the following: javascript back button 

the problem is that when you click on back button no server request is made, 
the catched page froom history.back() (i think that is the method) is 
displayed.  So java can't help you on that.

Khalid


 Hi All:
 
  
 
 In IE when user hits back button then I want to forward user to my main
 page. I want to do this in reset method of the form. How can I
 
  
 
 1)forward using request object to forward to main page.
 
 2)Or redirect to main page
 
  
 
 Note: At this time I am not executing action class. So I cannot return
 mapping. I am just in form. And I want to 
 
 Forward to a specific page.
 
  
 
 Any hints? Help??
 
  
 
 Thanks.
 
  
 
 Shrihas Shah
 NYS Office for Technology
 [EMAIL PROTECTED]
 Phone (518) 408-2382
 Fax (518) 473-3389
 (US Postal Service Regular Mail Address)
 State Capitol ESP, PO Box 2062
 Albany, NY 12220-0062
 (Parcel Post/Overnight and Interagency Mail Address)
 Empire State Plaza
 Swan St., Core 4, 1st Floor
 Albany, NY 12223
 
  
 
 


-- 
Khalid K.

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



Re: *****SPAM*****Re: Generate Java class from xml?

2003-12-17 Thread John Smart
There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
Castor, works with JDK 1.4...

Martin Gainty wrote:

Castor (http://www.castor.org) which generate the java classes with marshall
and unmarshall methods, but it is not finished, doesn't care to namespaces,
owns severals bugs ...
The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as enumeration ...
but I think that a better version will come soon. Generates JAXP compliant
Java Beans
http://www.altova.com/features_java.html
-Martin

- Original Message - 
From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?

 

Does anyone have an idea of how i can generate .java file from xml file?
   

Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.
 

For e.g. i have following xml file and i want to generate Address.java
   

file with getters/setters. Any ideas?
 

?xml version='1.0' encoding='UTF-8' ?
Address
   FirstName type=String/
   PoBox type=int/
..
/Address
Thanks,
Vicky


-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
   

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


Error using tiles-el

2003-12-17 Thread Narayanan, Sunitha
Hello,

I am using Struts 1.2 (nightly build as of 17 Dec 2003) and am trying out using the 
tiles-el. When I replace my tiles taglib with tiles-el, I am getting this error

/WEB-INF/tiles/layout/main_layout.jsp(4): Error in using tag library 
uri='/WEB-INF/taglib/struts-tiles-el.tld' prefix='tiles': The Tag class 
'org.apache.strutsel.taglib.tiles.ELUseAttributeTag' has no setter method 
corresponding to TLD declared attribute 'classname', (JSP 1.1 spec, 5.4.1)
probably occurred due to an error in /WEB-INF/tiles/layout/main_layout.jsp line 4:
%@ taglib uri=/WEB-INF/taglib/struts-tiles-el.tld prefix=tiles % 

On looking at the source of ELUseAttributeTag.java, am finding that there is no setter 
for the classname attribute which has been defined in the struts-tiles-el.tld file.

Have any of you seen this problem? Is this a known bug?

Thanks,
Sunitha


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



Checkboxes with session-scoped DynaActionForms

2003-12-17 Thread Sgarlata Matt
Does anyone know a good reference on how to use checkboxes with
session-scoped DynaActionForms?  The problem I am running into is that when
the form bean is session scoped, the checkbox sticks to always being
checked even if the user unchecks the checkbox.  This makes some sense to
me, because I know that if the checkbox is unchecked then a value for the
checkbox is not passed along in the request, so the old value is kept.  I
think with ActionForms this is solved by making the underlying property of
the checkbox of type boolean and by setting the value of the checkbox to
false in the reset() method of the ActionForm.  So, what is the correct
setup with DynaActionForms?  Should I make my underlying form property of
type java.lang.Boolean?  Also, It looks like I am going to have to subclass
DynaActionForm or DynaValidatorForm so that I can reset the checkboxes in
the reset() method of the form bean.  That seems like quite a pain (kind of
defeats the purpose of Dyna forms, doesn't it?).  Is that correct?

Thanks,

Matt


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



Re: Struts internal error

2003-12-17 Thread Martin Gainty
A wild guess in your jsp are you declaring any Properties such as
private Properties elementMap = null;

In that case you want to make sure you have mutators (set) and
accessors(get) methods set up for elementMap declared in your form
Would be helpful to look at the entire jsp

-Martin
Message - 
From: Julien Martin [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:06 PM
Subject: Struts internal error


 Thank you Jonathan,
 I figured this out myself but I don't know how to sort it out...  Can you
 help?
 Julien.

 - Original Message -
 From: Fullam, Jonathan [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 7:58 PM
 Subject: RE: Struts internal error


  You can get the root cause of an internal exception by looking about
half
  way down the stack trace.  In your case it is:
 
  root cause
 
  java.lang.IllegalAccessError: tried to access class
  org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
  org.apache.commons.beanutils.MappedPropertyDescriptor
 
  -Jonathan
 
  -Original Message-
  From: Julien Martin [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, December 17, 2003 12:53 PM
  To: Struts Users Mailing List
  Subject: Struts internal error
 
 
  Hello,
  I am working on a fairly complex application and I am running into a
 struts
  internal error.  Can anyone tell me how to sort it please.
 
  Here is the exception trace:
 
  ***
  HTTP Status 500 -
 

 --
 --
  
 
  type Exception report
 
  message
 
  description The server encountered an internal error () that prevented
it
  from fulfilling this request.
 
  exception
 
  javax.servlet.ServletException: Servlet execution threw an exception
  at
 

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
  FilterChain.java:269)
  at
 

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
  Chain.java:98)
  at
 

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
  .java:176)
  at java.security.AccessController.doPrivileged(Native Method)
  at
 

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
  ain.java:172)
  at
 

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
  va:256)
  at
 

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
  eNext(StandardPipeline.java:643)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
 

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
  va:191)
  at
 

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
  eNext(StandardPipeline.java:643)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
  at
 

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
  )
  at
 

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
  eNext(StandardPipeline.java:643)
  at
 

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
  java:171)
  at
 

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
  eNext(StandardPipeline.java:641)
  at
 

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
  )
  at
 

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
  eNext(StandardPipeline.java:641)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
 

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
  :174)
  at
 

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
  eNext(StandardPipeline.java:643)
  at
 

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
  at
 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
  at
 

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
  ction(Http11Protocol.java:392)
  at
 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
  at
 

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
  a:619)
  at java.lang.Thread.run(Thread.java:536)
 
  root cause
 
  java.lang.IllegalAccessError: tried to access class
  org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
  

html:submit

2003-12-17 Thread Clark Kent
I am trying to use bean:message for internationalization within the html:submit 
button like this :

html:submit property=physicianSubmit value=bean:message 
key='csc.button.submit'//

There is a key-value pair in the resource bundle.

But it seems to display the following error : Attribute csc.button.submit has no value 

How do I fix this error?

Thanks,

CK

 



-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

RE: Checkboxes with session-scoped DynaActionForms

2003-12-17 Thread Barett McGavock
If your fields are currently Strings, just put
field = new String[0];
in your reset() method. You don't need to change it to a [Bb]oolean.

This advice should work for any type.

B

-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 12:48 PM
To: Struts Users Mailing List
Subject: Checkboxes with session-scoped DynaActionForms


Does anyone know a good reference on how to use checkboxes with
session-scoped DynaActionForms?  The problem I am running into is that when
the form bean is session scoped, the checkbox sticks to always being
checked even if the user unchecks the checkbox.  This makes some sense to
me, because I know that if the checkbox is unchecked then a value for the
checkbox is not passed along in the request, so the old value is kept.  I
think with ActionForms this is solved by making the underlying property of
the checkbox of type boolean and by setting the value of the checkbox to
false in the reset() method of the ActionForm.  So, what is the correct
setup with DynaActionForms?  Should I make my underlying form property of
type java.lang.Boolean?  Also, It looks like I am going to have to subclass
DynaActionForm or DynaValidatorForm so that I can reset the checkboxes in
the reset() method of the form bean.  That seems like quite a pain (kind of
defeats the purpose of Dyna forms, doesn't it?).  Is that correct?

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



RE: Checkboxes with session-scoped DynaActionForms

2003-12-17 Thread Wendy Smoak
 From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
 Also, It looks like I am going to have to subclass
 DynaActionForm or DynaValidatorForm so that I can reset the 
 checkboxes in the reset() method of the form bean.  
 That seems like quite a pain (kind of
 defeats the purpose of Dyna forms, doesn't it?).  

Dyna forms merely free you of the need to write all those get/set
methods.  Defining the properties in struts-config.xml does not mean you
can't or shouldn't override the 'reset' and/or 'validate' methods.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 





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



RE: html:submit

2003-12-17 Thread Ben Anderson
you can't specifiy a tag as the value of an attribute in another tag.  There 
are a few different ways you could solve this problem.  Here's one using 
jstl and struts-el:
c:set var=messy
   bean:message key='csc.button.submit'/
/c:set
html-el:submit property=physicianSubmit value=${messy}/

From: Clark Kent [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: usergroup [EMAIL PROTECTED]
Subject: html:submit
Date: Wed, 17 Dec 2003 11:53:25 -0800 (PST)
I am trying to use bean:message for internationalization within the 
html:submit button like this :

html:submit property=physicianSubmit value=bean:message 
key='csc.button.submit'//

There is a key-value pair in the resource bundle.

But it seems to display the following error : Attribute csc.button.submit 
has no value

How do I fix this error?

Thanks,

CK





-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
_
Check your PC for viruses with the FREE McAfee online computer scan.  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Problem

2003-12-17 Thread Shaun Roach
Hello, I have been using struts for awhile, but after I started a new project last 
week, I began having a problem with it.

It seems like struts cannot find the getter methods in my beans.  For instance, when I 
try the following jsp page:

html:html
 logic:iterate id=statLine name=playerDisplay property=playerStats   
type=com.rototheory.beans.StatLine
br
bean:write name=statLine property=lineDate/
 /logic:iterate
/html:html


Nothing is generated, ( suggesting that it didn't find the lineDate getter ).
However, if I use the following code:

html:html
 logic:iterate id=statLine name=playerDisplay property=playerStats   
type=com.rototheory.beans.StatLine
br
%= statLine.getLineDate() %
 /logic:iterate
/html:html


The correct output is generated.  I am having similar problems with struts finding 
collections that I am trying to iterate over.  Does anyone have any idea of what might 
be causing the struts to not find my bean's getters?

Thanks for your help,

Shaun Roach


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



Struts has problem finding getter

2003-12-17 Thread Shaun Roach
Sorry for resending this, I forgot to put a descriptive subject:

Hello, I have been using struts for awhile, but after I started a new project last 
week, I began having a problem with it.

It seems like struts cannot find the getter methods in my beans.  For instance, when I 
try the following jsp page:

html:html
 logic:iterate id=statLine name=playerDisplay property=playerStats   
type=com.rototheory.beans.StatLine
br
bean:write name=statLine property=lineDate/
 /logic:iterate
/html:html


Nothing is generated, ( suggesting that it didn't find the lineDate getter ).
However, if I use the following code:

html:html
 logic:iterate id=statLine name=playerDisplay property=playerStats   
type=com.rototheory.beans.StatLine
br
%= statLine.getLineDate() %
 /logic:iterate
/html:html


The correct output is generated.  I am having similar problems with struts finding 
collections that I am trying to iterate over.  Does anyone have any idea of what might 
be causing the struts to not find my bean's getters?

Thanks for your help,

Shaun Roach

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



RE: Problem

2003-12-17 Thread Robert Taylor
Did you include the Struts bean tag-lib directive?
In other words if you view source, do you see
bean:write name=statLine property=lineDate/
?
robert

 -Original Message-
 From: Shaun Roach [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 3:13 PM
 To: [EMAIL PROTECTED]
 Subject: Problem 
 
 
 Hello, I have been using struts for awhile, but after I started a 
 new project last week, I began having a problem with it.
 
 It seems like struts cannot find the getter methods in my beans.  
 For instance, when I try the following jsp page:
 
 html:html
  logic:iterate id=statLine name=playerDisplay 
 property=playerStats   type=com.rototheory.beans.StatLine
 br
 bean:write name=statLine property=lineDate/
  /logic:iterate
 /html:html
 
 
 Nothing is generated, ( suggesting that it didn't find the 
 lineDate getter ).
 However, if I use the following code:
 
 html:html
  logic:iterate id=statLine name=playerDisplay 
 property=playerStats   type=com.rototheory.beans.StatLine
 br
 %= statLine.getLineDate() %
  /logic:iterate
 /html:html
 
 
 The correct output is generated.  I am having similar problems 
 with struts finding collections that I am trying to iterate over. 
  Does anyone have any idea of what might be causing the struts to 
 not find my bean's getters?
 
 Thanks for your help,
 
 Shaun Roach
 
 
 -
 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: Problem

2003-12-17 Thread Shaun Roach
Yes, I have these taglib directives at the top of both those pages:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested %

Shaun

-Original Message-
From:   Robert Taylor [mailto:[EMAIL PROTECTED]
Sent:   Wed 12/17/2003 12:22 PM
To: Struts Users Mailing List
Cc: 
Subject:RE: Problem 
Did you include the Struts bean tag-lib directive?
In other words if you view source, do you see
bean:write name=statLine property=lineDate/
?
robert

 -Original Message-
 From: Shaun Roach [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 3:13 PM
 To: [EMAIL PROTECTED]
 Subject: Problem 
 
 
 Hello, I have been using struts for awhile, but after I started a 
 new project last week, I began having a problem with it.
 
 It seems like struts cannot find the getter methods in my beans.  
 For instance, when I try the following jsp page:
 
 html:html
  logic:iterate id=statLine name=playerDisplay 
 property=playerStats   type=com.rototheory.beans.StatLine
 br
 bean:write name=statLine property=lineDate/
  /logic:iterate
 /html:html
 
 
 Nothing is generated, ( suggesting that it didn't find the 
 lineDate getter ).
 However, if I use the following code:
 
 html:html
  logic:iterate id=statLine name=playerDisplay 
 property=playerStats   type=com.rototheory.beans.StatLine
 br
 %= statLine.getLineDate() %
  /logic:iterate
 /html:html
 
 
 The correct output is generated.  I am having similar problems 
 with struts finding collections that I am trying to iterate over. 
  Does anyone have any idea of what might be causing the struts to 
 not find my bean's getters?
 
 Thanks for your help,
 
 Shaun Roach
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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





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

Re: ActionMapping - regexp pattern matching for path

2003-12-17 Thread Brice Ruth
No, I don't believe this is possible currently. Wildcards of any kind 
(extending to regexps) are not support for ActionMapping paths.

Sergey Proskurnya wrote:

Hello to all,

In Struts-1.1 it is possible to bind Actions to static URL path,
but is it possible to bind Actions to the set of the paths,
described by Java regular expression?
For example:
action-mappings
   action   path=/users/.*
type=com.mysite.UserPageAction
scope=session
validate=false
/action
/action-mappings
I mean that in this case the requests for /users/John/,
/users/Mary/ and etc. will be handled by com.mysite.UserPageAction.
Thanks for attention,
 Sergey Proskurnya.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


problem with adding ActionMessage to ActionErrors

2003-12-17 Thread Bradford M. Ayers
I noticed in the documentation that ActionError is deprecated, so I was trying to be a 
good doobie and use ActionMessage like the docs say to.  So in my code, when I go from 
this:
errors.add( ActionErrors.GLOBAL_ERROR, new ActionMessage( error.password.mismatch ));
to this:
errors.add( ActionErrors.GLOBAL_ERROR, new ActionError( error.password.mismatch ));
when my page tries to resolve html:errors/ I get:
java.lang.ClassCastException
at org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)...

Has anyone seen this?  I'm using JBoss 3.2.2 (which uses Tomcat 4.1).


Brad Ayers
Senior Programmer Analyst
Granite State Management and Resources
[EMAIL PROTECTED]
603-225-5867 ext. 308
603-224-2581  Fax number

CONFIDENTIALITY NOTICE

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.



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



RE: [OT?] WebSphere and commons-logging

2003-12-17 Thread Hibbs, David
Yeah, it doesn't help because there is a commons-logging.properties file in
the WAS classpath already!  As long as you have the classloader mode set to
parent first, it will find the IBM version first and, thus, use the IBM log.

Good thought, though, and I did neglect to mention that creating this file
was also a necessary step.

--David

 -Original Message-
 From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 12:04 PM
 To: Struts Users Mailing List
 Subject: Re: [OT?] WebSphere and commons-logging
 
 
 Hi,
 
 Make a file called commons-logging.properties and add this line:
 
 org.apache.commons.logging.LogFactory=org.apache.commons.loggi
 ng.impl.Log4jFacto
 ry
 
 Put the file in your classpath
 
 
 
 Ovidiu
 
 - Original Message - 
 From: Hibbs, David [EMAIL PROTECTED]
 To: Struts-Users (E-mail) [EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 3:37 PM
 Subject: [OT?] WebSphere and commons-logging
 
 
  For those who are using commons-logging (i.e all Struts users!) on
  WebSphere 4.0 or greater, you need to be aware that 
 WebSphere comes with its
  own implementation of a commons-logging Log.  Not only 
 that, but it comes
  with its own implementation of LogFactory... and a
  commons-logging.properties file that forces the use of the IBM Log.
 
  This isn't so bad in itself, but the IBM log swallows all log
  messages of a detail greater than info.  i.e. log.debug() 
 and log.trace()
  messages disappear.  That would be fine if you could change 
 the log level
  (as expected with commons-logging) and make them appear.  
 However, IBM
  support won't tell me how to change it!  As far as they 
 know (and the pushed
  it back to level 3, i.e. the developers), it cannot be 
 changed.  Thus,
  you're stuck at a log level of Info and using their logger 
 unless you change
  your class loader mode to application first rather than 
 parent first.  What
  a kludge!
 
  Instead of fixing the problem, they opened a feature request!
  Aaargh!  They're as bad as Sun!  If your log messages are 
 important to you,
  along with the capability to change log levels and loggers 
 without having to
  kludge a server setting, please visit their RFE database 
 and vote for the
  RFE so as to get it through their thick skulls.  It requires a
  login/password, but it's a simple matter of signing up for one.
 
  To quote support, It is request # 241 and you can view it via this
  link : 
http://www7b.software.ibm.com/webapp/wsdd/wasServlet3. Development
 will evaluate and prioritize the requests (if chosen) to be included in
 future release of Websphere Application Server -- and if you have
problems
 getting to the page, well, try again later.  Their website seems flaky.
Go
 figure.

 Thanks,

 --David

 David Hibbs, ACS
 Staff Programmer / Analyst
 Distributed Applications Development and Support
 American National Insurance Company


 -
 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: *****SPAM*****Re: Generate Java class from xml?

2003-12-17 Thread Christopher Milton
I use Digester which is used by Struts itself.

http://jakarta.apache.org/commons/digester/
http://www.google.com/search?q=jakarta+digester
http://www.javaranch.com/newsletter/August2003/TouringTheCommonsPart2.html

--- John Smart [EMAIL PROTECTED] wrote:
 There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
 Castor, works with JDK 1.4...
 
 Martin Gainty wrote:
 
 Castor (http://www.castor.org) which generate the java classes with marshall
 and unmarshall methods, but it is not finished, doesn't care to namespaces,
 owns severals bugs ...
 
 The second one is Xml Spy 5.0, it generate classes from an xsd file which
 wrap on the Dom Tree, but all facets are not implemented as enumeration ...
 but I think that a better version will come soon. Generates JAXP compliant
 Java Beans
 http://www.altova.com/features_java.html
 
 -Martin
 
 - Original Message - 
 From: Vicky [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, December 17, 2003 2:01 PM
 Subject: Generate Java class from xml?
 
 
   
 
 Does anyone have an idea of how i can generate .java file from xml file?
 
 
 Tools like jakrata digester, JOX are there but both of them are useful in
 populating java beans from xml. My requirement is to generate .java file
 from .xml with getters and setters methods for xml elements/attributes. I
 also tried JAXB. But JAXB generates bunch of files and most of them are
 interfaces, which is not going to work for me.
   
 
 For e.g. i have following xml file and i want to generate Address.java
 
 
 file with getters/setters. Any ideas?
   
 
 ?xml version='1.0' encoding='UTF-8' ?
  Address
 FirstName type=String/
 PoBox type=int/
 ..
 /Address
 
 
 Thanks,
 Vicky
 
 
 
 
 -
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing
 
 
 
 -
 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]
 


=
Christopher Milton
[EMAIL PROTECTED]

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



Re: Strategy for out of date items through forms using hibernate?

2003-12-17 Thread Jason Lea
I have done this.  Hibernate supports versioning (using a version number 
column), if you use this Hibernate can make sure the changes are not 
overwritten.

The basic process is:
1. Hibernate session A loads object A1 (with identifier 1234)
2. Hibernate session B loads object B1 (also with identifier 1234)
3. Session A modifies object A1 and saves it
4. B modifies object B1 and attempts to save it
5. Hibernate will detect the version number for the object has changed 
and generate an exception (StaleObjectStateException)
6. Catch this exception, close the hibernate session, return an error 
message to the user using ActionErrors etc

I also have a refresh button so that at any time the user can press 
refresh which reloads the object from hibernate so it is up to date.  
When I return my stale object error I also allow the user to either 
refresh (loses the users changes), cancel (do nothing, return to parent 
menu), or overwrite.  Overwrite can attempt to overwrite the changes by 
reloading the new object, but use the posted field changes to update and 
then save the object.

You should check out versioning on the hibernate web site for more info 
on that.

David Erickson wrote:

Hi I am using Struts with Hibernate in a webapplication.. we are using forms
etc. The problem I am currently trying to decide how to handle is thus:
Assume user 1 loads up an object in a form and is modifying it.
Assume user 2 loads up the same object in a form and is also modifying it.
User 1 submits the modified object.
User 2 also submits the object, however his is out of date and I would like
the webapp to tell him that and show the differences that exist.
What is the best way to use hibernate to deal with this? What I have
attempted is using the built in timestamp feature in MySQL, I have a field
in my object that is timestamp but does not insert or update, thus mysql
controls its value. Then when the user submits the object I loaded another
copy of that object from the DB and tried to compare their dates.. however
this gave me an error saying:
net.sf.hibernate.NonUniqueObjectException: a different object with the same
identifier value was already associated with the session: 1, of class:
cmcflex.salesweb.model.prospect.Prospect
because of the object I loaded to compare.

What do do? Is there a better strategy for tackling this? I tried using the
actual timestamp in the properties for my object, but then when I tried to
submit the object the generated sql said when id=? AND timestamp=? meaning
it would not update if the timestamp is different, and I'm unsure if I could
even determine if it did or did not update.
Thanks in advance,
David
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
Jason Lea


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


Re: Strategy for out of date items through forms using hibernate?

2003-12-17 Thread David Erickson
 I have done this.  Hibernate supports versioning (using a version number
 column), if you use this Hibernate can make sure the changes are not
 overwritten.

 The basic process is:
 1. Hibernate session A loads object A1 (with identifier 1234)
 2. Hibernate session B loads object B1 (also with identifier 1234)
 3. Session A modifies object A1 and saves it
 4. B modifies object B1 and attempts to save it
 5. Hibernate will detect the version number for the object has changed
 and generate an exception (StaleObjectStateException)
 6. Catch this exception, close the hibernate session, return an error
 message to the user using ActionErrors etc

 I also have a refresh button so that at any time the user can press
 refresh which reloads the object from hibernate so it is up to date.
 When I return my stale object error I also allow the user to either
 refresh (loses the users changes), cancel (do nothing, return to parent
 menu), or overwrite.  Overwrite can attempt to overwrite the changes by
 reloading the new object, but use the posted field changes to update and
 then save the object.

Yes I figured this out just barely, rather I used timestamp instead of
version (are there any drawbacks to that?).  I am interested in doing
exactly what you did, but how did you go about overwriting the things that
have been changed?

Thanks,
David


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



RE: Character encoding issue

2003-12-17 Thread Seyed Razavi
Well to answer my own question: The source of the problem was found.  A
compression filter (gzipping the response) seems to have been the
culprit. 

 -Original Message-
 From: Seyed Razavi [mailto:[EMAIL PROTECTED] 
 Sent: 17 December 2003 17:37
 To: [EMAIL PROTECTED]
 Subject: Character encoding issue
 
 
 Howdy,
 
 I've got a strange problem with character encoding German 
 characters. I'm using iso-8859-1.  The app is running on JDK 
 1.4.2, Jboss 3.2 w/ Tomcat and using Struts 1.1.
 
 The application works fine on local Windows machine and on a 
 Red Hat system.
 
 However, when moved to a Debian system it behaves strangely 
 ONLY when accessing Action mappings NOT when accessing JSPs directly.
 
 Accessing a JSP directly shows all messages properly 
 displayed but accessing it via an Action class (through an 
 ActionForward) shows all German characters as ?.
 
 The HTML encoding is properly set and all JSP include:
 
 %@ page contentType=text/html; charset=iso-8859-1%
 %@ page pageEncoding=iso-8859-1%
 
 I've set the following in the run.sh for Jboss in case it's a system
 issue:
 
 export LANG=german
 export LC_ALL=de_DE
 
 I don't think it is a system issue because as I said, all JSP 
 when accessed directly respond properly.  The resource bundle 
 is also iso-8859-1 encoded.
 
 I'm also setting the Locale on each request to de (using 
 the Action class setLocale method) just in case.  The output 
 from the action servlet seem to have the correct content-type 
 according to Netscape.
 
 Anybody help?
 
 Cheers,
 
 Seyed
 
 
 -
 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: Strategy for out of date items through forms using hibernate?

2003-12-17 Thread Jason Lea
With versioning hibernate increments the version number each time.  I 
believe this is prefrered to the timestamp method, but I think hibernate 
supports both.

(off the top of my head) I have a struts form which holds the fields etc 
plus the object I loaded from Hibernate.  I use DispatchLookUp actions 
so that all of my actions are selected from the button pressed eg it 
adds a dispatch=save, or dispatch=overwrite to decide which action to 
perform.  The save action would normally reconnect the hibernate 
session, start a hibernate transaction, get the object from the form, 
populate the object properties from the form fields, and end the 
transaction.

To overwrite (dispatch=overwrite), I think I throw the current hibernate 
session away, create a new one, load a new object using the objects id 
(this should get the latest version from the db), start transaction and 
do the same as the save above.

David Erickson wrote:

I have done this.  Hibernate supports versioning (using a version number
column), if you use this Hibernate can make sure the changes are not
overwritten.
The basic process is:
1. Hibernate session A loads object A1 (with identifier 1234)
2. Hibernate session B loads object B1 (also with identifier 1234)
3. Session A modifies object A1 and saves it
4. B modifies object B1 and attempts to save it
5. Hibernate will detect the version number for the object has changed
and generate an exception (StaleObjectStateException)
6. Catch this exception, close the hibernate session, return an error
message to the user using ActionErrors etc
I also have a refresh button so that at any time the user can press
refresh which reloads the object from hibernate so it is up to date.
When I return my stale object error I also allow the user to either
refresh (loses the users changes), cancel (do nothing, return to parent
menu), or overwrite.  Overwrite can attempt to overwrite the changes by
reloading the new object, but use the posted field changes to update and
then save the object.
   

Yes I figured this out just barely, rather I used timestamp instead of
version (are there any drawbacks to that?).  I am interested in doing
exactly what you did, but how did you go about overwriting the things that
have been changed?
Thanks,
David
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--

Jason Lea



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


Re: [OT] I didn't know Struts was an antipattern

2003-12-17 Thread Ted Husted
Gus Heck wrote:
Interesting, I'm not sure I agree, but the patch that he complains about 
not being added sounds useful...
A lot of people have requested a history stack, and have also 
implemented it in their own applications. But I think we need to solve 
it in the larger context of a general solution to workflow issues.

Meanwhile, the post the author cited does *not* prove this point. In 
fact, it proves just the opposite.

The developer said that he *was able* to extend the framework and was 
simply offering the extension to the community. This is the same way the 
Validator and Tiles started.

The author was offering it as an example of Struts being inflexible when 
in fact is an example of Struts being flexible enough that people can 
extend it without our help :)

-Ted.



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


Problem with initialize servlet - load-on-startup

2003-12-17 Thread Les Dunaway
I'm running Tomcat 406 on Redhat9

I have a working Struts app

I've added a second servlet to web.xml, specifying load-on-startup 2
(where 1 is Action servlet

The second servlet is ignored (or at least it doesn't produce anything
in the logs) - the log shows the parsing of the web.xml going normally
(no errors).

Can anyone tell me what I didn't do / did wrong?

Les
+ web.xml +++
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

web-app

  !-- Standard Action Servlet Configuration (with debugging) --
  servlet
servlet-nameaction/servlet-name
   
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value3/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value2/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet
  
!-- Initialization servlet --
servlet
servlet-nameglsi-init/servlet-name
   
servlet-classcom.glsi.share.ApplicationInitialze/servlet-class
init-param
param-nameglsi-config/param-name
   
param-value/WEB-INF/classes/glsi-config.properties/param-value
/init-param
load-on-startup2/load-on-startup
/servlet

  !-- Standard Action Servlet Mapping --
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping
  
  !-- The Usual Welcome File List --
  welcome-file-list
welcome-fileindex.jsp/welcome-file
  /welcome-file-list


  !-- Struts Tag Library Descriptors --
  taglib
taglib-uri/tags/struts-bean/taglib-uri
taglib-location/WEB-INF/struts-bean.tld/taglib-location
  /taglib

  taglib
taglib-uri/tags/struts-html/taglib-uri
taglib-location/WEB-INF/struts-html.tld/taglib-location
  /taglib

  taglib
taglib-uri/tags/struts-logic/taglib-uri
taglib-location/WEB-INF/struts-logic.tld/taglib-location
  /taglib

  taglib
taglib-uri/tags/struts-nested/taglib-uri
taglib-location/WEB-INF/struts-nested.tld/taglib-location
  /taglib

  taglib
taglib-uri/tags/struts-tiles/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
  /taglib

/web-app


+ The servlet 
/*
 * ApplicationInitialize.java
 *
 * Created on December 15, 2003, 12:36 PM
 */

package com.glsi.share;

import java.io.*;
import java.net.*;

import java.util.Properties;

import javax.servlet.*;
import javax.servlet.http.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Performs initialization for glsi class-libraries-based applications
 * @author  Les
 * @version
 */
public class ApplicationInitialize extends HttpServlet {
  
  /**
   *  The codeLog/code instance for this application.
   */
  private Log log =
  LogFactory.getLog(com.glsi.share.ApplicationInitialize);
  
  /** Initializes the servlet.
   */
  public void init(ServletConfig config) throws ServletException {
super.init(config);
System.out.println(Hi there, I'm the
initializer);
String cfgPathName = config.getInitParameter(config);
Properties cfgProps = new Properties();
try{
cfgProps.load(new FileInputStream(cfgPathName));
} catch (Exception ie) {
  log.info(Error loading glsi-config.properties +
ie.getMessage());
}
log.info(glsi-config.properties loaded);
  }
  
  /** Destroys the servlet.
   */
  public void destroy() {

  }
  
  /** Processes requests for both HTTP codeGET/code and
codePOST/code methods.
   * @param request servlet request
   * @param response servlet response
   */
  protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
  throws ServletException, IOException {
response.setContentType(text/html);
PrintWriter out = response.getWriter();
/* output your page here
out.println(html);
out.println(head);
out.println(titleServlet/title);
out.println(/head);
out.println(body);
 
out.println(/body);
out.println(/html);
 */
out.close();
  }
  
  /** Handles the HTTP codeGET/code method.
   * @param request servlet request
   * @param response servlet response
   */
  protected void doGet(HttpServletRequest request, HttpServletResponse
response)
  throws ServletException, IOException {
processRequest(request, response);
  }
  
  /** Handles the HTTP codePOST/code method.
   * @param request servlet request
   * @param response servlet response
   */
  protected void doPost(HttpServletRequest request, HttpServletResponse
response)
  throws ServletException, IOException {
processRequest(request, response);
  }
  
  /** Returns a short description of the 

Re: Checkboxes with session-scoped DynaActionForms

2003-12-17 Thread Sgarlata Matt
Wendy  Barrett - Thanks for your help!  Both of your answers helped me fix
the problem I was having with checkboxes and session-scoped DynaActionForms.

Wendy - I feel like the reset method of the DynaActionForm should be able to
automatically take care of checkboxes, perhaps with a little extra help like
specifying clearOnReset=true or isCheckbox=true in the set-property
element for the property, but oh well... I'm not going to push it on the dev
list.

Matt
- Original Message - 
From: Wendy Smoak [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:03 PM
Subject: RE: Checkboxes with session-scoped DynaActionForms


 From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
 Also, It looks like I am going to have to subclass
 DynaActionForm or DynaValidatorForm so that I can reset the
 checkboxes in the reset() method of the form bean.
 That seems like quite a pain (kind of
 defeats the purpose of Dyna forms, doesn't it?).

Dyna forms merely free you of the need to write all those get/set
methods.  Defining the properties in struts-config.xml does not mean you
can't or shouldn't override the 'reset' and/or 'validate' methods.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management





-
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: Checkboxes with session-scoped DynaActionForms

2003-12-17 Thread Mainguy, Mike
I think there is a common misconception that if you use DynaActionForms you
don't need to write an ActionForm AT ALL.  While this is true, you may also
subclass the DynaForm and provide a similar level of functionality as a
normal form.

Kmart Tech News
news://uskihsvtfinsys
 
The essence of knowledge is, having it, to apply it; not having it, to
confess your ignorance. 

-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 4:47 PM
To: Struts Users Mailing List
Subject: Re: Checkboxes with session-scoped DynaActionForms


Wendy  Barrett - Thanks for your help!  Both of your answers helped me fix
the problem I was having with checkboxes and session-scoped DynaActionForms.

Wendy - I feel like the reset method of the DynaActionForm should be able to
automatically take care of checkboxes, perhaps with a little extra help like
specifying clearOnReset=true or isCheckbox=true in the set-property
element for the property, but oh well... I'm not going to push it on the dev
list.

Matt
- Original Message - 
From: Wendy Smoak [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 3:03 PM
Subject: RE: Checkboxes with session-scoped DynaActionForms


 From: Sgarlata Matt [mailto:[EMAIL PROTECTED]
 Also, It looks like I am going to have to subclass DynaActionForm or 
 DynaValidatorForm so that I can reset the checkboxes in the reset() 
 method of the form bean. That seems like quite a pain (kind of
 defeats the purpose of Dyna forms, doesn't it?).

Dyna forms merely free you of the need to write all those get/set methods.
Defining the properties in struts-config.xml does not mean you can't or
shouldn't override the 'reset' and/or 'validate' methods.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management





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

-
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.


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



RE: using redirecting forwards after failed validation

2003-12-17 Thread Par Winzell
Barett,

 1) keep the ActionErrors as a request attribute
 2) set the validate parameter to false for the ActionMapping
 3) add code like the following to the search action itself:
 errs = form.validate();
 if (!errs.isEmpty()) {
   saveErrors(errs);
   return mapping.getInput();
 }

This seems like forcing a flow that's supposed to be the framework's
supposed to deliver... but clearly it's very similar to what the
RequestProcessor already does, so it sounds like an acceptable
compromise.

 A note: this solution will forward to your input page, not redirect. I'm not
 entirely sure from your message on why you'd like to redirect to the input.
 It sounds like you're not set on it, so maybe a forward like the above will
 do.

If the user's URL reads /gui.do when she first enters her search data,
and validation fails, then I believe the URL should still read /gui.do
for the second attempt, rather than /executesearch.do or whatnot.

That does require a redirect, right?

Anyway, your solution should work equally well while storing the errors
in the session context. Many thanks!

Zell



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



Re: *****SPAM*****Re: Generate Java class from xml?

2003-12-17 Thread Adam Hardy
John,
this is off-topic, but why does your message header contain the word 
***SPAM** ?

On 12/17/2003 08:43 PMnbsp;John Smart wrote:
There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
Castor, works with JDK 1.4...

Martin Gainty wrote:

Castor (http://www.castor.org) which generate the java classes with 
marshall
and unmarshall methods, but it is not finished, doesn't care to 
namespaces,
owns severals bugs ...

The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as 
enumeration ...
but I think that a better version will come soon. Generates JAXP 
compliant
Java Beans
http://www.altova.com/features_java.html

-Martin

- Original Message - From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?
 

Does anyone have an idea of how i can generate .java file from xml file?
  
Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file
from .xml with getters and setters methods for xml elements/attributes. I
also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.
 

For e.g. i have following xml file and i want to generate Address.java
  
file with getters/setters. Any ideas?
 

?xml version='1.0' encoding='UTF-8' ?
Address
   FirstName type=String/
   PoBox type=int/
..
/Address
Thanks,
Vicky


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Generate Java class from xml?

2003-12-17 Thread Adam Hardy
Hi Christopher,
just a quick question about Digester, perhaps you can save me the effort 
of reading up on it to find out myself, but will Digester be able to 
parse HTML?

I am dealing with the Internet Explorer bookmarks export file. I have 
already tried JAXB but JAXB chokes on it, saying that the XML is not 
well-formed.

The bookmarks file has quite a few unpaired p and dt elements, which 
is obviously bad XML.

Thanks
Adam
On 12/17/2003 09:38 PMnbsp;Christopher Milton wrote:
I use Digester which is used by Struts itself.

http://jakarta.apache.org/commons/digester/
http://www.google.com/search?q=jakarta+digester
http://www.javaranch.com/newsletter/August2003/TouringTheCommonsPart2.html
--- John Smart [EMAIL PROTECTED] wrote:

There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike 
Castor, works with JDK 1.4...

Martin Gainty wrote:


Castor (http://www.castor.org) which generate the java classes with marshall
and unmarshall methods, but it is not finished, doesn't care to namespaces,
owns severals bugs ...
The second one is Xml Spy 5.0, it generate classes from an xsd file which
wrap on the Dom Tree, but all facets are not implemented as enumeration ...
but I think that a better version will come soon. Generates JAXP compliant
Java Beans
http://www.altova.com/features_java.html
-Martin

- Original Message - 
From: Vicky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 2:01 PM
Subject: Generate Java class from xml?





Does anyone have an idea of how i can generate .java file from xml file?
  

Tools like jakrata digester, JOX are there but both of them are useful in
populating java beans from xml. My requirement is to generate .java file

from .xml with getters and setters methods for xml elements/attributes. I

also tried JAXB. But JAXB generates bunch of files and most of them are
interfaces, which is not going to work for me.


For e.g. i have following xml file and i want to generate Address.java
  

file with getters/setters. Any ideas?



?xml version='1.0' encoding='UTF-8' ?
Address
  FirstName type=String/
  PoBox type=int/
..
/Address
Thanks,
Vicky


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: using redirecting forwards after failed validation

2003-12-17 Thread Barett McGavock
You are correct.

Your decision to put the errors in the session is necessary if you want the
URL to read that way. My understanding is that all request attributes will
vanish if you redirect. Most notably including the ActionErrors that the
thread was all about! :) I have long since given up trying to control what
the URL line reads, in favor of preserving a slim session. But this is one
of the many tradeoffs we all make with Struts.

Also a small problem with the code that I originally submitted that would
make this more obvious:
-  saveErrors(errs);
+  saveErrors(request, errs);

Thanks for the comments.
B

-Original Message-
From: Par Winzell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 3:36 PM
To: Struts Users Mailing List
Cc: 'Par Winzell'
Subject: RE: using redirecting forwards after failed validation


Barett,

 1) keep the ActionErrors as a request attribute
 2) set the validate parameter to false for the ActionMapping
 3) add code like the following to the search action itself: errs = 
 form.validate(); if (!errs.isEmpty()) {
   saveErrors(errs);
   return mapping.getInput();
 }

This seems like forcing a flow that's supposed to be the framework's
supposed to deliver... but clearly it's very similar to what the
RequestProcessor already does, so it sounds like an acceptable compromise.

 A note: this solution will forward to your input page, not redirect. 
 I'm not entirely sure from your message on why you'd like to redirect 
 to the input. It sounds like you're not set on it, so maybe a forward 
 like the above will do.

If the user's URL reads /gui.do when she first enters her search data, and
validation fails, then I believe the URL should still read /gui.do for the
second attempt, rather than /executesearch.do or whatnot.

That does require a redirect, right?

Anyway, your solution should work equally well while storing the errors in
the session context. Many thanks!

Zell



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



  1   2   >