Does html:base/ affect html:form action=... ?

2005-08-04 Thread Michael Jouravlev
Am I doing something wrong? I have %@ taglib
uri=/WEB-INF/struts-html.tld prefix=html % in my page, I have
html:html tag, and I have html:form. I would like to use relative
address for a action mapping, by using html:base/ in the head, but
looks like it does not work.

Struts 1.2.4 (? I guess)

Michael.

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



Validating indexed properties using struts

2005-08-04 Thread Kalra, Ashwani

Hi,

Can some one give me some sample on how to validate the indexed
properties in Struts 1.1



Thanks
Ashwani



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


RE: 1.3.x in production (was Re: Showing a PDF inside a JSP)

2005-08-04 Thread Marco Mistroni
Aha!
StrutsWS 1.3 that I have uploaded in sourceforge cvs  (strutsws project)
was 
In fact using Struts 1.3 with customization of RequestProcessor

Am I the winner :)) ?

Regards
marco

-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: 04 August 2005 04:12
To: Struts Users Mailing List
Subject: Re: 1.3.x in production (was Re: Showing a PDF inside a JSP)

Well, now I'm going to have to go update my blog to 1.3 just to beat you

both :)

(Nah, doesn't even REMOTELY count as a production app, I know! :) )

Frank

Wendy Smoak wrote:
 From: Joe Germuska [EMAIL PROTECTED]
 
 ... my most recent app (which may make history this weekend as the 
 first Struts 1.3.x based webapp to go into production?  ;-) )
 
 
 You'll beat me by a few days, then. ;)  I have one out in test that I 
 had originally planned to leave at 1.2.7... but what fun would that
be?
 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.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: validator question

2005-08-04 Thread Dewitte Rémi
Le Mardi 2 Août 2005 20:14, Dewitte Rémi a écrit :
 Hi !
 In a wizard, I have some required checks with struts-validator assigned
 to pages (with page=).
 There is sometimes a jump in the wizard so that a property is null. When
 validating the page after the jump, the server-side validation failed as if
 validator checked all previous pages.
 For example,
 page1 - property q1
 page2 - property q2
 page3 - property q3
 If i jump from page1 to page3, submitting page3 will failed telling q2 is
 required (because null).

 Can you confirm that the validator ckecks all properties for pages =
 current page ?

Answer to myself : yes

From validator src :
/** 
 * Gets the page.  This in conjunction with the page property of 
 * a codeFieldcode can control the processing of fields. If the 
field's 
 * page is less than or equal to this page value, it will be processed. 
 */ 
public int getPage() { 
return page; 
}


 Thanks.

 -
 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: action executing two times

2005-08-04 Thread Chatzinikos, Fotis, VF-GR Consultant
I had the same problem with my action executing twice and I tracked the
problem in the struts-config file.

When an action is of type X and a second completely different action is
of the same type X then the problem occurs...

Check your config file for actions that share the same type...

Cheers,
Fotis

-Original Message-
From: Jeremiah Johnson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 03, 2005 6:03 PM
To: Struts Users Mailing List
Subject: Re: action executing two times

I think this has me on the right track. I was using firefox. I tried 
this with ie and it works fine. I'm clicking on a link that is an 
html:link to cause this. If I type the url the same thing happens. 
There is javascript  code that submits the page by clicking on a link 
but it's not tied to the link I am clicking. there are some links where 
href=# but they are not created by struts tags. How does src=# trigger

another submit? I'm going to start taking html out of the page till I 
figure out which piece causes this. I post back if I find anything 
interesting. Thanks!
/Jeremiah


Laurie Harper wrote:
 Jeremiah Johnson wrote:
 
 I have an action mapping that looks like:
   action
 attribute=someForm
 name=someForm
 path=/my/path
 scope=request
  validate=false
  parameter=cmd
 type=someAction
forward
 name=showForm
 path=myTileDefinition/
/action

 If I click the link to /my/path.do my action class sends out the
 showForm then displays myTileDef. Then it executes the same action
class
 again. The second execution doesn't copy some of the information from
 the first execution. My action class is a LookupDispatchAction so on
the
 second time it errors out because cmd is not defined as a parameter.
If
 I point my action at a regular jsp page with a tile definition in the
 page it does the same thing. If I point the action at a plain old jsp
 page it executes once. Why does this execute more then once? how do I
 write code around this problem? I'm using struts 1.2.7. Thanks!
 /Jeremiah
 
 
 How are you invoking the action (from an HTML link? form submission? 
 directly by typing the URL into the address bar?); is there any 
 Javascript involved?
 
 Does the response contain any suspect hrefs (for example img/ tags 
 with src=#) that might be triggering the second request?
 
 Using something like tcpflow to watch what's going over the wire can 
 help figure out where your 'mystery' request is coming from.
 
 If that doesn't help, I'd suggest posting any HTML that invokes the 
 action as well as the HTML it produces as a resonse.
 
 L.
 

-
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: Html:link with DynaActionForm

2005-08-04 Thread Chatzinikos, Fotis, VF-GR Consultant
I have dine something similar that works. I configure an action in the
struts config file that defines the formbean to use. Then the onclick
method of the link uses javascript to fill in the form and then calls
document.getElementById(myForm).submit() ;

The form bean arrives filled and ready to the correct action

Fotis

-Original Message-
From: Woodchuck [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 03, 2005 9:16 PM
To: Struts Users Mailing List; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Html:link with DynaActionForm

hihi,

clicking on links (even on a page with a form) does *not* submit the
form at all.  do not confuse this with the common input type='submit'
or using javascript to submit forms via document.forms[0].submit().

when you click on a link such as 
a href=http://www.mywebsite.com/myAction.do;Click this link!/a
no extra information is submitted to that Action even if there's an
associated ActionForm.

if you want to populate the ActionForm associated to the Action that is
to be 'triggered' from a link you can use query string parameters.  not
very elegant but it works, and not recommended if you have a lot of
info to populate.  using this method your final renedered link should
look something like this:

a
href=http://www.mywebsite.com/myAction.do?personId='12345'firstName='J
ohn'lastName='Smith'Click
this link!/a

how you create this link is another matter but when you click the above
link an attempt to populate personId, firstName, lastName values into
the corresponding ActionForm for myAction will be made (using the
JavaBean convention).

hth,
woodchuck


--- Amol Yadwadkar [EMAIL PROTECTED] wrote:

 Hi List,
 
 I have a form where all the action are provided by link.
 
 I am using DynaActionform so when I click on html:link  I do not
 get
 the Dynaform populated for the next page
 
 But
 
 If I use use html:submit then it happens as expected.
 
  
 
 Can any one have solution for the above issue.
 
 Thankx
 
 best regds, 
 AMOL 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

-
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: checkbox initially checked?

2005-08-04 Thread Swapnil Patil
Hi ,
As Wendy has mentioned-

Otherwise, the place to do this is in your Action, before you forward to the
JSP.

I am interested in populating Form before loading jsp page so that I can 
assign values to HTML comtrols.
HOw to do that?

On 8/4/05, Wendy Smoak [EMAIL PROTECTED] wrote:
 
 From: Chris Decker [EMAIL PROTECTED]
 
  New to struts so sorry for the simple questions.
  I have a html: checkbox struts tag and I want to have the checkbox
  checked initially similar to the checked attribute in a traditional
  INPUT statement.
  Can you do this? I've looked everywhere!
 
 If it's a dynamic form, you can set a default value in struts-config.xml:
 
 form-bean name=contactForm
 type=edu.example.ContactForm
 form-property name=onHoldFlag
 type=java.lang.Boolean initial=true/
 /form-bean
 
 Otherwise, the place to do this is in your Action, before you forward to 
 the
 JSP. You only need to set the default the first time the form is 
 displayed.
 Exactly where and how depends on how you've written the app-- do you have 
 a
 'setup' action that's separate from the one that handles form submission?
 
 The reset method is not the place to set defaults. In fact, you will need
 to set that checkbox to false/off in the form's reset method. If you 
 don't,
 you will find that there is no way for the user to to un-check it.
 
 A couple of checkbox links from the FAQ:
 http://struts.apache.org/faqs/newbie.html#checkbox
 http://struts.apache.org/faqs/newbie.html#reset
 
 --
 Wendy Smoak
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Adam Hardy

Craig McClanahan on 03/08/05 23:10, wrote:

I just uploaded the slides from my OSCON talk this afternoon,
comparing several web frameworks on how they implement six major
architectural features.  Several people have asked for them, so here's
a link:

  http://people.apache.org/~craigmcc/oscon_2005_web_architectures.pdf


Can I summarise in a slightly Friday manner :)

(1) Struts: v1.3 should be better, in fact there are at least 5 major 
points that need addressing


(2) Webwork: kind of weird, has Actions but has unknowns like XWork, 
interceptor stacks, OGNL


(3) Spring MVC: totally flexible, configurable, wide variety of 
implementations - everything to everybody. Sounds like it can make 
coffee too. Good if you love XML config files.


(4) Tapestry: even weirder than Webwork, and you don't get to use JSPs, 
you have to write your HTML like ColdFusion


(5) JSF: obviously the dog's gonads

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



RE: Pass errors to tile for popup

2005-08-04 Thread draegoon Z

Is the only solution a tiles controller?

Ok, I gotta go to my day job. I'll check in this afternoon.

Thanx.






From: draegoon Z [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: user@struts.apache.org
Subject: RE: Pass errors to tile for popup
Date: Thu, 04 Aug 2005 00:15:07 +

I tried this, but got a null error at the end of the tile:insert:

logic:messagesPresent

   %-- Need to show error popup --%
   tiles:insert definition=tile.error_box.insert flush=false

   %-- define putList dynamically --%
   tiles:putList name=errors

   %-- iterate through error messages --%
   html:messages id=error

   %-- add error to the list --%
   tiles:add value=${error} direct=true /

   /html:messages
   /tiles:putList
   /tiles:insert
   /logic:messagesPresent

I could see the value of ${error}, so I'm definitely reading the errors.
Can this not be done with tiles like this?

Later


From: draegoon Z [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: struts-user@jakarta.apache.org
Subject: Pass errors to tile for popup
Date: Wed, 03 Aug 2005 19:21:36 +

I need some code snippets please:

I'm trying to have a page popup a window that will display all the errors 
in the first page.
For cleanliness purposes, and modularity, I will use a tile to insert 
this code.


I will do this either by putting the errors in the session, or by getting 
them from a dynamically built putList.


So how do I actually access each error in the page (maybe iterate 
through), so that I can build my putList or put them in the session.


Thanx :)



-
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: Validating indexed properties using struts

2005-08-04 Thread Kjersti Berg
On 04/08/05, Kalra, Ashwani [EMAIL PROTECTED] wrote:
 
 Hi,
 
 Can some one give me some sample on how to validate the indexed
 properties in Struts 1.1
 
I assume you are using the default Validator plugin. 

This is an excerpt from my validation.xml, using indexed properties. 
form name=/myForm
 field property=gradeCurrentMonth indexedListProperty=jobs
depends=integer
   arg0 key=absence.label.scale/
/field
field property=amountCurrentMonth indexedListProperty=jobs
depends=integer
  arg0 key=absence.label.amount/
/field
/form

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



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread M4RC0
Sorry but:
what's the meaning of dog's gonads? :P

2005/8/4, Adam Hardy [EMAIL PROTECTED]:
 Craig McClanahan on 03/08/05 23:10, wrote:
  I just uploaded the slides from my OSCON talk this afternoon,
  comparing several web frameworks on how they implement six major
  architectural features.  Several people have asked for them, so here's
  a link:
 
http://people.apache.org/~craigmcc/oscon_2005_web_architectures.pdf
 
 Can I summarise in a slightly Friday manner :)
 
 (1) Struts: v1.3 should be better, in fact there are at least 5 major
 points that need addressing
 
 (2) Webwork: kind of weird, has Actions but has unknowns like XWork,
 interceptor stacks, OGNL
 
 (3) Spring MVC: totally flexible, configurable, wide variety of
 implementations - everything to everybody. Sounds like it can make
 coffee too. Good if you love XML config files.
 
 (4) Tapestry: even weirder than Webwork, and you don't get to use JSPs,
 you have to write your HTML like ColdFusion
 
 (5) JSF: obviously the dog's gonads
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
M4RC0

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



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Adam Hardy

M4RC0 on 04/08/05 11:54, wrote:

Sorry but:
what's the meaning of dog's gonads? :P



You can look up 'gonad' in any medical dictionary, but as for the phrase 
I based it on, try this:


http://www.phrases.org.uk/meanings/114500.html


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



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread M4RC0
so  if i'm right... the entire phrase should mean:

 JSF: obviously the dog's testicles

mmm ... i'm still confused :P 

I mean, i'd like to know an opinion about JSF compared to other
frameworks, but also the english class is appreciated too :P

tnx


2005/8/4, Adam Hardy [EMAIL PROTECTED]:
 M4RC0 on 04/08/05 11:54, wrote:
  Sorry but:
  what's the meaning of dog's gonads? :P
 
 
 You can look up 'gonad' in any medical dictionary, but as for the phrase
 I based it on, try this:
 
 http://www.phrases.org.uk/meanings/114500.html
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
M4RC0

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



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Adam Hardy
Well you're all primed to understand the explanation given at that link 
then! Check it out, or have you no web access?


M4RC0 on 04/08/05 12:37, wrote:

so  if i'm right... the entire phrase should mean:



JSF: obviously the dog's testicles



mmm ... i'm still confused :P 


I mean, i'd like to know an opinion about JSF compared to other
frameworks, but also the english class is appreciated too :P

tnx


2005/8/4, Adam Hardy [EMAIL PROTECTED]:


M4RC0 on 04/08/05 11:54, wrote:


Sorry but:
what's the meaning of dog's gonads? :P



You can look up 'gonad' in any medical dictionary, but as for the phrase
I based it on, try this:

http://www.phrases.org.uk/meanings/114500.html


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



java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm

2005-08-04 Thread Petar Tahchiev
Hi I am working on a project and we are building an ear file that cosists of 
2 jars and a war file. When deploying it on the Weblogic Server it reports 
no errors, but when requesting the url from the browser it reports the 
follwing error:

java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at 
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:480)
at 
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:182)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at 
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
at 
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:41)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
at java.lang.Class.getDeclaredMethods(Class.java:1139)
at java.beans.Introspector$1.run(Introspector.java:1127)
at java.security.AccessController.doPrivileged(Native Method)
at 
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1125)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:990)


I am sure I have the struts.jar in my WEB-INF/lib directory which is
located in the war file and I don't now what is going on. Any
suggestions would be appreciated.

-- 
Regards, Petar!


Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Mark Benussi
Ahem JSF is not a Framework, it is an implementation specification. Its 
not made by someone like Apache or Sun (But can be implemented by them to 
the specification or by another vendor, IBM etc). Struts is an application 
Framework, JSF is a user interface implementation.


And I prefer the muts nuts. that must transalate accross to the boys on 
the other side of the atlantic.


Original Message Follows
From: Adam Hardy [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: [OT] My O'Reilly Open Source Conference Talk
Date: Thu, 04 Aug 2005 13:08:21 +0100

Well you're all primed to understand the explanation given at that link 
then! Check it out, or have you no web access?


M4RC0 on 04/08/05 12:37, wrote:

so  if i'm right... the entire phrase should mean:



JSF: obviously the dog's testicles



mmm ... i'm still confused :P

I mean, i'd like to know an opinion about JSF compared to other
frameworks, but also the english class is appreciated too :P

tnx


2005/8/4, Adam Hardy [EMAIL PROTECTED]:


M4RC0 on 04/08/05 11:54, wrote:


Sorry but:
what's the meaning of dog's gonads? :P



You can look up 'gonad' in any medical dictionary, but as for the phrase
I based it on, try this:

http://www.phrases.org.uk/meanings/114500.html


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



Logon redirect - Construct ActionForward on the fly ?

2005-08-04 Thread aleiprecht
Hi all,

I have overridden the RequestsProcessor#processRoles() to check whether a
user has sufficient Role to access an Action(an therefore a page). If he/she
hasn't, it is easy. I dump the request URI to the session and redirect to a
global forward (logon). That's all not so difficult..as the logon is a
statically existing mapping..

The logon has a forward linking to the member's homepage and after the users
logged in successfully, that's where they get forwarded to..

I would like to forward them to the stored URI (from the session), if they
tried to access a specific location in the members area rather then logging
in proactively. Any hints where to look to get enlightened?

Rgds
Aleiprecht

PS: To all native English speakers . sorry . I'm German .all language
mistakes exclusively C by myself ;)


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



Re: Logon redirect - Construct ActionForward on the fly ?

2005-08-04 Thread Gareth Evans

In your login jsp

logic:present name=mySavedUrl scope=session
html:hidden property=url value=%= session.getAttribute(mySavedUrl) 
% /
/logic:present

In your login action...

String redirect = form.get(url);  // providing your using a dyna type action 
form
if ( redirect != null ) {
return new RedirectingActionForward( redirect );
}
return mapping.findForward(success);


Something like that should work

[EMAIL PROTECTED] wrote:


Hi all,

I have overridden the RequestsProcessor#processRoles() to check whether a
user has sufficient Role to access an Action(an therefore a page). If he/she
hasn't, it is easy. I dump the request URI to the session and redirect to a
global forward (logon). That's all not so difficult..as the logon is a
statically existing mapping..

The logon has a forward linking to the member's homepage and after the users
logged in successfully, that's where they get forwarded to..

I would like to forward them to the stored URI (from the session), if they
tried to access a specific location in the members area rather then logging
in proactively. Any hints where to look to get enlightened?

Rgds
Aleiprecht

PS: To all native English speakers . sorry . I'm German .all language
mistakes exclusively C by myself ;)


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



--
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

--
Tel:+44 (0)870 0100 704
Fax:+44 (0)870 9010 705
E-Mail: [EMAIL PROTECTED]
Web:www.msoft.co.uk

--
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
--
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.


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



RE: Logon redirect - Construct ActionForward on the fly ?

2005-08-04 Thread aleiprecht

Please disregard ...
The solution was right in front of my eyes ;)

At the end of the logon action

if (getSessionAttribute(AFTERLOGON_DEST) != null) {
String tmpString =  + getSessionAttribute (AFTERLOGON_DEST);
  removeSessionAttribute(AFTERLOGON_DEST);
  return  (ActionForward) new RedirectingActionForward(tmpString); 
} else {
return (mapping.findForward(logonsuccess));
}

The calls

getSessionAttribute(String key)
removeSessionAttribute(String key)

are just shortened for readability sake

rgds
albi

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 04, 2005 3:01 PM
To: user@struts.apache.org
Subject: Logon redirect - Construct ActionForward on the fly ?

Hi all,

I have overridden the RequestsProcessor#processRoles() to check whether a
user has sufficient Role to access an Action(an therefore a page). If he/she
hasn't, it is easy. I dump the request URI to the session and redirect to a
global forward (logon). That's all not so difficult..as the logon is a
statically existing mapping..

The logon has a forward linking to the member's homepage and after the users
logged in successfully, that's where they get forwarded to..

I would like to forward them to the stored URI (from the session), if they
tried to access a specific location in the members area rather then logging
in proactively. Any hints where to look to get enlightened?

Rgds
Aleiprecht

PS: To all native English speakers . sorry . I'm German .all language
mistakes exclusively C by myself ;)


-
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: action executing two times

2005-08-04 Thread Woodchuck
--- Chatzinikos, Fotis, VF-GR Consultant
[EMAIL PROTECTED] wrote:

 I had the same problem with my action executing twice and I tracked
 the
 problem in the struts-config file.
 
 When an action is of type X and a second completely different action
 is
 of the same type X then the problem occurs...
 
 Check your config file for actions that share the same type...

hihi,

this is simply not true.

only the path attribute is used to determine which action to execute. 
the type attribute has nothing to do with this.

there is something else causing your action executing twice.  it is
*not* because you have multiple actions defined with the same type
(action class).


woodchuck












Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



RE: action executing two times

2005-08-04 Thread Chatzinikos, Fotis, VF-GR Consultant
Only the path attribute 'should' be used. I will post the config
tomorrow so you can have a look... Maybe I did something else wrong
maybe there is a bug... I do not know. I will have another look before
the post tomorrow,

Cheers,
Fotis

-Original Message-
From: Woodchuck [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 04, 2005 5:31 PM
To: Struts Users Mailing List
Subject: RE: action executing two times

--- Chatzinikos, Fotis, VF-GR Consultant
[EMAIL PROTECTED] wrote:

 I had the same problem with my action executing twice and I tracked
 the
 problem in the struts-config file.
 
 When an action is of type X and a second completely different action
 is
 of the same type X then the problem occurs...
 
 Check your config file for actions that share the same type...

hihi,

this is simply not true.

only the path attribute is used to determine which action to execute. 
the type attribute has nothing to do with this.

there is something else causing your action executing twice.  it is
*not* because you have multiple actions defined with the same type
(action class).


woodchuck












Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

-
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: Showing a PDF inside a JSP

2005-08-04 Thread Woodchuck
hihi,

i've also worked quite a bit with generating PDF documents (iText,
JasperReports via iReport) so i know Acrobat pains too.  (yes Acrobat
is very moody, it works one day then not the next, and only for ppl it
likes) :)

i went to that website:
http://www.sos.state.co.us/biz

but couldn't find a working example of a PDF document displayed
embedded *within* an html page.  that is, the Acrobat plugin window
occupying a sub portion of the entire displayed html page.  is this not
what the original post was about?  or did i simply not find the working
example on the website?  (i went to the File a document section and
brought up the PDFs on the subsequent page but they all 'took over' the
entire browser window)

it would be awesome to see a PDF embedded in an html page without using
frames.


woodchuck



--- Frank W. Zammetti [EMAIL PROTECTED] wrote:

 Cool, thanks!
 
 At work I actually have a rather lengthy document listing all the 
 Acrobat issues I found along the way, and the solutions to it...
 quite a 
 few... I'm going to add this to it as a miscellaneous note, just so I
 
 don't forget for next time (and, oh, I *know* there's gonna be a next
 time!)
 
 Frank
 
 Gary VanMatre wrote:
 Really? You found that to be necassery? What specific problem does
 it 
 solve (which of the MANY Acrobat problems I mean? :) ). 
 
  
   
  I belive that it had to do with the upgrade from the 5.x to 6.0.2
 reader com controls.  Version 6.0.2 would not run as an inprocess
 server.  It wanted to fire up an instance of reader instead of
 imbeding in the document.  The context type was the ticket.  That's
 about I'll I know about details.  It's been about a year ago.  I sat
 next to the guy working on it (Mr. Bee).
  
  Gary 
  
  
 I ask because I spent probably a month dealing with PDF generation 
 issues and I just last week managed to get everything working for 
 everyone (it was one of those it works for user A but not B, oh
 wait, 
 it's tommorrow and now user B doesn't work but A does... and their
 PCs 
 appear to be identical in every way). I never tried what you
 suggest, 
 and it looks to be working perfectly now, so as someone who has
 fought 
 the Acrobat battle too, I'm curious. 
 
 Frank 
 
 Gary VanMatre wrote: 
 
 Excellent! I wouldn't have thought that would work, based on how 
 screwed up the Acrobat plug-in generally is, but that's
 excellent! 
 
 
 
 Well, I think there was better than a week spent one line of code,
 actually 
 
 one char '\r'. You are not alone 
 
 response.setContentType(application/pdf\r); 
 
 Gary 
 
 
 
 Frank 
 
 [EMAIL PROTECTED] wrote: 
 
 
 I've also seen it done using the html embed tag. We used itext
 to deliver a 
 
 fillable pdf. You can see it action here
 (http://www.sos.state.co.us/biz). 
 
 
 type=application/pdf  
 
 public ActionForward loadBytesIntoStream( 
 ActionMapping mapping, 
 ActionForm form, 
 HttpServletRequest request, 
 HttpServletResponse response, 
 String filename, 
 byte[] bytes) 
 throws Exception { 
 
 response.setContentType(application/pdf\r); 
 response.setHeader( 
 Content-disposition, 
 inline; filename= + justFilename); 
 response.setContentLength(bytes.length); 
 response.setHeader(Expires, 0); 
 response.setHeader( 
 Cache-Control, 
 must-revalidate, post-check=0, pre-check=0); 
 response.setHeader(Pragma, public); 
 ServletOutputStream buff = response.getOutputStream(); 
 buff.write(bytes, 0, bytes.length); 
 bytes = null; 
 buff.flush(); 
 return null; 
 } 
 
 Gary 
 
 -- Original message -- 
 
 
 
 
 iText just generates the PDF on the server-side, the display
 issue on 
 the browser would still be the same because you are returning a
 PDF 
 stream back (or redirecting to a temp file, either way) and the
 browser 
 recognizes that and passes it to the plug-in for display (a
 plug-in 
 which, by the way, is perhaps the buggiest piece of garbage
 ever foisted 
 on an unsuspecting public!) 
 
 Frank 
 
 ziggler wrote: 
 
 
 
 you can use itext to realize? 
 
 2005/8/4, Frank W. Zammetti : 
 
 
 
 
 Hi Rafael, 
 
 The only way I can think of to actually embed a PDF, or at
 least to 
 give that appearance, is to use iFrames. 
 
 The Acrobat plug-in takes over the entire window it is shown
 in, which 
 when frames aren't involved is the entire client area of the
 browser. 
 
 So, using frames should, in theory, work (I've never actually
 tried to 
 do this, so there could be hidden gotchas). An iFrame would
 allow you 
 more or less to seem to embed the PDF. 
 
 I'd be willing to bet there aren't any other ways to do it
 that aren't 
 way more trouble than they're woth, if there are any at
 all... 
 
 ...now that THAT gauntlet is thrown down, let the flood of
 messages 
 correcting me begin :) 
 
 Frank 
 
 Rafael Taboada wrote: 
 
 
 
 
 Hi Folks, I know my doubt is out Struts topic but I want to
 use ur 
 xperiencie in my problem. 
 
 I want to show a report in PDF file inside a JSP, inside a
 table for 
 

Designs for Wizard workflow...

2005-08-04 Thread Swapnil Patil
Hi all,

I am converting Wizard workflow into Struts framework.
Wizard page contains next,back,finish buttons.
I am considering 2 approches..

1) 
/PrepareStep1.do -- step1Form -- forward to step1.jsp
step2.jsp
on next --- ProcessStep1.do


/ProcessStep1.do --step1Form --on success /PrepareStep2.do 

/PrepareStep2.do --step2Form -- on success forword to step2.jsp

step2.jsp
on next --- ProcessStep2.do
on back --- PrepareStep3.do

/ProcessStep2.do --step2Form -- /PrepareStep3.do


PrepareStep1 will fill the form step1Form to render the jsp page step1.jsp . 
step1.jsp on submit forwrd to /ProcessStep1.do . /ProcessStep1.do on success 
forward to /PrepareStep3.do . and so one... 

Each ProcessAction will save the data from Form to Business object.



2) One common ActionForm (session scope) will be used be all actions.

/PrepareStep1.do -- commonForm -- forward to step1.jsp -- 
/ProcessStep1AndPrepareStep2.do --- step2.jsp  
/ProcessStep2AndPrepareStep3.do 

I read somewhere that DispatchAction with common Form is suitable for Wizard 
workFlow applications. My wizarsd must support next,back.




Which approch is better? on the following points
1 Extesion of wozard steps.(may be in between the old steps)
2 Maintenance 

Can any body tell me the advantage and disadvantage of both of these 
approach. 

Waiting for suggetion 

Thanks  Regard
Swapnil


Re: DTOs are evil

2005-08-04 Thread Rick Reumann

Michael Jouravlev wrote the following on 8/3/2005 9:07 PM:

http://www.theserverside.com/news/thread.tss?thread_id=35233



Just curious what are Rod's exact views on the DTO? I searched for DTOs 
on that link you posted but only saw posts by other people.


I do agree, though, with what others have said that DTOs/ValueObjects 
aren't really that OO. It's funny that the subject comes up because I 
was a late bloomer to the programming world (started about 6 years and 
was a waiter and science teacher before that:), and when I first started 
reading the Java books and then applying that to what I was 
reading/seeing in JSP projects I was on, the concepts did seem to conflict.


What I mean is take the concept of an Employee. In almost all web 
applications you see the EmployeeDTO being passed to the DAO...


employeeDAO.updateEmployee( employee );

From what I recall the real OO way would be...

employee.update();

and employee takes care of updating itself.

From an OO perspective I don't see a problem having an Employee object 
that has a DAO inside that takes care of persistence. I do have a couple 
questions though about OO design if this approach is used...


1) Where do you encapsulate getting Collections back of your objects? 
For example an Employee object has CRUD methods, but what about you when 
you need a List of Employees? Do you make an EmployeeList object that 
has methods getEmployees? Do you maybe just 'cheat' and add a getList or 
getEmployees method directly to the Employee object?


2) It also seems a bit heavy to return Collections of pretty heavy 
objects. (Each Employee since it's not a simple VO could be a large 
object - although by large I just mean having a bunch of methods in it 
etc - I'm not so sure it would be large footprint-wise if just the 
properties were being filled in the case of a list - so bottom line is 
maybe the extra stuff in the object doesn't matter much?


Side note...

3) Even from an OO perspective, you always hear about encapsulating 
unique behaviors to make things reusable, so in a sense couldn't you 
consider the 'properties' of an Employee 'unique' or, if not the 
properties, the CRUD stuff is 'sort of' unique? If this is the case, you 
could make an argument for separating out the properties into another 
object (DTO/VO) separate?



--
Rick

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



Re: Designs for Wizard workflow...

2005-08-04 Thread Michael Jouravlev
Two years ago you would be on your own. Now you have a bunch of solutions:

* Struts Workflow Extension: 
  http://www.livinglogic.de/Struts/index.html
* Struts Flow: 
  http://struts.apache.org/flow/index.html
* Spring Web Flow: 
  http://struts.apache.org/flow/index.html
* And my very own, WizardAction implementing Easy Wizard:
  http://struts.sourceforge.net/strutsdialogs/wizardaction.html

Of course, I would prefer you to use my solution ;-) and I am here to
help if you need. See the live demo here:
http://www.superinterface.com/strutsdialog/wizardaction.do
and a slightly different version here:
http://www.superinterface.com/wizard/signupWizard.do

I use DispatchAction flavor, like your second choice.

But I've listed other flow engines for you too.

Michael.

On 8/4/05, Swapnil Patil [EMAIL PROTECTED] wrote:
 Hi all,
 
 I am converting Wizard workflow into Struts framework.
 Wizard page contains next,back,finish buttons.
 I am considering 2 approches..
 
 1)
 /PrepareStep1.do -- step1Form -- forward to step1.jsp
 step2.jsp
 on next --- ProcessStep1.do
 
 
 /ProcessStep1.do --step1Form --on success /PrepareStep2.do
 
 /PrepareStep2.do --step2Form -- on success forword to step2.jsp
 
 step2.jsp
 on next --- ProcessStep2.do
 on back --- PrepareStep3.do
 
 /ProcessStep2.do --step2Form -- /PrepareStep3.do
 
 
 PrepareStep1 will fill the form step1Form to render the jsp page step1.jsp .
 step1.jsp on submit forwrd to /ProcessStep1.do . /ProcessStep1.do on success
 forward to /PrepareStep3.do . and so one...
 
 Each ProcessAction will save the data from Form to Business object.
 
 
 
 2) One common ActionForm (session scope) will be used be all actions.
 
 /PrepareStep1.do -- commonForm -- forward to step1.jsp --
 /ProcessStep1AndPrepareStep2.do --- step2.jsp 
 /ProcessStep2AndPrepareStep3.do
 
 I read somewhere that DispatchAction with common Form is suitable for Wizard
 workFlow applications. My wizarsd must support next,back.
 
 
 
 
 Which approch is better? on the following points
 1 Extesion of wozard steps.(may be in between the old steps)
 2 Maintenance
 
 Can any body tell me the advantage and disadvantage of both of these
 approach.
 
 Waiting for suggetion
 
 Thanks  Regard
 Swapnil

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



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Michael Jouravlev
On 8/4/05, Mark Benussi [EMAIL PROTECTED] wrote:
 Ahem JSF is not a Framework, it is an implementation specification. Its
 not made by someone like Apache or Sun (But can be implemented by them to
 the specification or by another vendor, IBM etc). Struts is an application
 Framework, JSF is a user interface implementation.

JSF was supposed to be just a view layer, but now it is a framework on
itself. Ok, there are two frameworks: Sun's and Apache's ;)

 And I prefer the muts nuts. that must transalate accross to the boys on
 the other side of the atlantic.

Have you watched Formula 51?

Michael.

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



Re: [OT] wrong list I know, but lazy, Tomcat 5.5 question

2005-08-04 Thread Rick Reumann

Robert Taylor wrote the following on 8/3/2005 7:06 PM:

Rick, I'm sure you already have, but just in case you haven't...

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html

It provides a pretty detailed explaination of how to configure 
cross-context logging using either log4j or java.util.logging package.


BTW, Tomcat 5.5 uses Commons Logging which I think defaults to 
java.util.logging if its found and no other logging configs are specified.


Yea that was the problem. Thanks Robert. I actually didn't bother to 
read those docs because I was assuming a default cross-context log would 
be provided. Although I'm still a bit confused since I never ran into a 
stdout log that Tomcat 5.5 says it should produce for stack traces? 
(Unless by stdout log they mean the stdout to the console?):


Tomcat 5.5 has done away with localhost_log which you may be familiar 
with as the runtime exception/stack trace log. These types of error are 
usually thrown by uncaught exceptions, but are still valuable to the 
developer. They can now be found in the stdout log.


Not a big deal though since I'm back to using 5.0 because they changed 
the way the JNDI stuff is done in tomcat 5.5 and since I'm deploying 
eventually to tomcat 5 and not 5.5, I just went back to 5.0 locally as well.


--
Rick

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



Re: Does html:base/ affect html:form action=... ?

2005-08-04 Thread Dakota Jack
Action mappings are not URLs.  That is apples and oranges.  Your
action mapping is completely independent of anything to do with URLs
and is a logical rather than physical based protocol.

On 8/3/05, Michael Jouravlev [EMAIL PROTECTED] wrote:
 Am I doing something wrong? I have %@ taglib
 uri=/WEB-INF/struts-html.tld prefix=html % in my page, I have
 html:html tag, and I have html:form. I would like to use relative
 address for a action mapping, by using html:base/ in the head, but
 looks like it does not work.
 
 Struts 1.2.4 (? I guess)
 
 Michael.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

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



html:link: url rewrite of href parameter still there?

2005-08-04 Thread Bourgon, Jean-Francois
Hi,

I recently move my web application from Struts 1.2.4 to 1.2.7.

Since this, the html:link tag doesn't behave as before because it doesn't
encode sessionid in url specified as href property when session cookies are
disable.

I compare TagUtils class source code between Struts 1.2.4 and 1.2.7 and
found that an extra condition have been added in computeURLWithCharEncoding
method to avoid url encoding of link with href property. See sample code
below.

In Struts 1.2.4
// Perform URL rewriting to include our session ID (if any)
if (pageContext.getSession() != null) {
HttpServletResponse response = (HttpServletResponse)
pageContext.getResponse();
if (redirect) {
return (response.encodeRedirectURL(url.toString()));
} else {
return (response.encodeURL(url.toString()));
}
} else {
return (url.toString());
}

and Struts 1.2.7
// Perform URL rewriting to include our session ID (if any)
// but only if url is not an external URL
if (( href == null )  ( pageContext.getSession() != null )) {
HttpServletResponse response = (HttpServletResponse)
pageContext.getResponse();
if (redirect) {
return (response.encodeRedirectURL(url.toString()));
} else {
return (response.encodeURL(url.toString()));
}
} else {
return (url.toString());
}

Then, I only want to know if this is a correct behaviour, because this is
not in concordance with the Struts documentation. As I know, we should be
able to use something similar to html:link href=index.jspMain
Page/html:link and benefit of URL rewriting to preserve session when
cookies are disable.

Thanks


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



Re: [STRUTS 2X]: Ideas

2005-08-04 Thread Michael Jouravlev
If someone have not noticed my another message, I have got the article
published. It discusses the idea of two-phase components, JSP controls
and Struts implementation:

http://today.java.net/pub/a/today/2005/08/04/jspcomponents.html

I hope that the article explains better what I has been offering for
last couple of months. The article discusses the issue from another
perspective, but I hope it is even better to see the same thing from a
different angle.

Michael

---
Struts Dialogs
http://struts.sourceforge.net/strutsdialogs

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



RE: DTOs are evil

2005-08-04 Thread Mark Benussi
That's how my persistence framework goes.

All my data extends a data object which makes public CRUD methods that
accept a persister, you can then have File persisters, Database persisters
etc. An employee shouldn't have any knowledge of how they persist in an
enterprise IMHO. All that logic is placed in the persister.

Employee employee = new Employee();
employee.setKey(1);

// Reads and populates an employee.
EmployeeDBPersister dbPersister = new EmployeeDBPersister(conn);
employee.read(dbPersister);

// Writes the employee to a file.
EmployeeFilePersister filePersister = new EmployeeFilePersister(file);
employee.create(filePersister);

I hate DAO's. The company I work for uses them. Basically one class to do
all the logic related in any way shape of form to a valgue amount of
database tables. They then change a column on a table and wonder why there
code is a nightmare to fix. If you have one Persister responsible for a
table then you change the four pieces of sql for create read update and
delete and you are laughing.

In answer to the collections comment, I have managers which my application
interfaces with to get collections. Basically something like

EmployeeManager manager = new EmployeeManager();
ArrayList employees = manager.getEmployees();

And the method gets all the keys in a separate piece of SQL and then calls
the code I have shown above.

-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED] 
Sent: 04 August 2005 16:15
To: Struts Users Mailing List
Subject: Re: DTOs are evil

Michael Jouravlev wrote the following on 8/3/2005 9:07 PM:
 http://www.theserverside.com/news/thread.tss?thread_id=35233
 

Just curious what are Rod's exact views on the DTO? I searched for DTOs 
on that link you posted but only saw posts by other people.

I do agree, though, with what others have said that DTOs/ValueObjects 
aren't really that OO. It's funny that the subject comes up because I 
was a late bloomer to the programming world (started about 6 years and 
was a waiter and science teacher before that:), and when I first started 
reading the Java books and then applying that to what I was 
reading/seeing in JSP projects I was on, the concepts did seem to conflict.

What I mean is take the concept of an Employee. In almost all web 
applications you see the EmployeeDTO being passed to the DAO...

employeeDAO.updateEmployee( employee );

 From what I recall the real OO way would be...

employee.update();

and employee takes care of updating itself.

 From an OO perspective I don't see a problem having an Employee object 
that has a DAO inside that takes care of persistence. I do have a couple 
questions though about OO design if this approach is used...

1) Where do you encapsulate getting Collections back of your objects? 
For example an Employee object has CRUD methods, but what about you when 
you need a List of Employees? Do you make an EmployeeList object that 
has methods getEmployees? Do you maybe just 'cheat' and add a getList or 
getEmployees method directly to the Employee object?

2) It also seems a bit heavy to return Collections of pretty heavy 
objects. (Each Employee since it's not a simple VO could be a large 
object - although by large I just mean having a bunch of methods in it 
etc - I'm not so sure it would be large footprint-wise if just the 
properties were being filled in the case of a list - so bottom line is 
maybe the extra stuff in the object doesn't matter much?

Side note...

3) Even from an OO perspective, you always hear about encapsulating 
unique behaviors to make things reusable, so in a sense couldn't you 
consider the 'properties' of an Employee 'unique' or, if not the 
properties, the CRUD stuff is 'sort of' unique? If this is the case, you 
could make an argument for separating out the properties into another 
object (DTO/VO) separate?


-- 
Rick

-
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: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Mark Benussi
Nope what channel is it on?

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Sent: 04 August 2005 16:32
To: Struts Users Mailing List
Subject: Re: [OT] My O'Reilly Open Source Conference Talk

On 8/4/05, Mark Benussi [EMAIL PROTECTED] wrote:
 Ahem JSF is not a Framework, it is an implementation specification.
Its
 not made by someone like Apache or Sun (But can be implemented by them to
 the specification or by another vendor, IBM etc). Struts is an application
 Framework, JSF is a user interface implementation.

JSF was supposed to be just a view layer, but now it is a framework on
itself. Ok, there are two frameworks: Sun's and Apache's ;)

 And I prefer the muts nuts. that must transalate accross to the boys
on
 the other side of the atlantic.

Have you watched Formula 51?

Michael.

-
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: checkbox initially checked?

2005-08-04 Thread Dave Newton

Swapnil Patil wrote:


Otherwise, the place to do this is in your Action, before you forward to the
JSP.

I am interested in populating Form before loading jsp page so that I can 
assign values to HTML comtrols.

HOw to do that?
 


In your Action, before you forward to the JSP???

Wow, that was spooky... it's alsmot as though you answered your own 
question before you even asked it.


I wish I could do that.

Dave



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



RE: checkbox initially checked?

2005-08-04 Thread Chris Decker
Thanks it worked!  Actually had List of Objects I was forwarding.  And in my 
action class I just did the following as I was building the list 

Object.setSelected(true);

Where the Object class had a boolean called selected. 

 

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 04, 2005 12:11 PM
To: Struts Users Mailing List
Subject: Re: checkbox initially checked?

Swapnil Patil wrote:

Otherwise, the place to do this is in your Action, before you forward 
to the JSP.

I am interested in populating Form before loading jsp page so that I 
can assign values to HTML comtrols.
HOw to do that?
  

In your Action, before you forward to the JSP???

Wow, that was spooky... it's alsmot as though you answered your own question 
before you even asked it.

I wish I could do that.

Dave



-
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: Showing a PDF inside a JSP

2005-08-04 Thread Gary VanMatre
 hihi,
 
 i've also worked quite a bit with generating PDF documents (iText,
 JasperReports via iReport) so i know Acrobat pains too.  (yes Acrobat
 is very moody, it works one day then not the next, and only for ppl it
 likes) :)
 
 i went to that website:
 http://www.sos.state.co.us/biz
 
 but couldn't find a working example of a PDF document displayed
 embedded *within* an html page.  that is, the Acrobat plugin window
 occupying a sub portion of the entire displayed html page.  is this not
 what the original post was about?  or did i simply not find the working
 example on the website?  (i went to the File a document section and
 brought up the PDFs on the subsequent page but they all 'took over' the
 entire browser window)
 
 it would be awesome to see a PDF embedded in an html page without using
 frames.
 

Try a reservation of name filing.  It is a short one that is open to the 
public.  You are able to view the statement before paying for it (uses the 
embedeed pdf).  

Gary

 
 woodchuck
 



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



Re: DTOs are evil

2005-08-04 Thread Laurie Harper

Rick Reumann wrote:

Michael Jouravlev wrote the following on 8/3/2005 9:07 PM:

http://www.theserverside.com/news/thread.tss?thread_id=35233
Just curious what are Rod's exact views on the DTO? I searched for DTOs 
on that link you posted but only saw posts by other people.


Mechael's referring to a throw-away one-liner about half way through the 
actual presentation (which is about an hour and a quarter long if you want 
to sit through it; it's not a bad introduction to the issues involved in 
handling persistence). Rod doesn't explain or justify his statement in the 
presentation.


L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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



Deploying on Tomcat - Urgent

2005-08-04 Thread Shabada, Gnaneshwer

Hello,
I am trying to deploy my Struts application on Tomcat 5.0.28 on Win2k. I get
the following error on my browser when I try to start up. My application has
tiles in them and I believe I configured everything properly. I was able to
successfully deploy and run the application in Websphere App Server 5.1
through WSAD. But it just doesn't run on Tomcat. I created a WAR file and
dropped it in webapps folder in Tomcat home and tried starting up the
server. I have my server.xml configured too.

Please help.

Thanks
Gnan

exception 
javax.servlet.ServletException: Can't get definitions factory from context.
at
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:825)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:758)
at org.apache.jsp.index2_jsp._jspService(index2_jsp.java:72)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
24)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter
.java:114)
root cause 
javax.servlet.jsp.JspException: Can't get definitions factory from context.
at
org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.jav
a:616)
at
org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:515
)
at
org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:477)
at
org.apache.jsp.index2_jsp._jspx_meth_tiles_insert_0(index2_jsp.java:88)
at org.apache.jsp.index2_jsp._jspService(index2_jsp.java:62)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
24)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter
.java:114)


 
This email message 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 email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to [EMAIL PROTECTED] 
Toys R Us, Inc.

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



Re: DTOs are evil

2005-08-04 Thread Michael Jouravlev
On 8/4/05, Laurie Harper [EMAIL PROTECTED] wrote:
 Rick Reumann wrote:
  Michael Jouravlev wrote the following on 8/3/2005 9:07 PM:
  http://www.theserverside.com/news/thread.tss?thread_id=35233
  Just curious what are Rod's exact views on the DTO? I searched for DTOs
  on that link you posted but only saw posts by other people.
 
 Mechael's referring to a throw-away one-liner about half way through the
 actual presentation (which is about an hour and a quarter long if you want
 to sit through it; it's not a bad introduction to the issues involved in
 handling persistence). Rod doesn't explain or justify his statement in the
 presentation.

To squeeze 60-something slides into 60 minutes, he should have been
prepared. I do not believe that this throw away one-liner was not
mentioned somewhere in his notes. But yes, he have not (yet) explained
this remark on TSS. Maybe it was a hook to have others talk about
presentation ;)

Michael.

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



RE: DTOs are evil

2005-08-04 Thread Frank W. Zammetti
I too have taken something of a hybrid approach in most cases...

I created something called a Function Bean (FB), which for all intents and
purposes is really just a DAO.  For instance, in one app I have a ClientFB
class that has methods like:

ArrayList getClientList();
ClientDTO getClientInfo(String id);
boolean saveClient(ClientDTO client);
boolean deleteClient(String id);

All the typical methods... note that the DTOs are really only for data
storage and transpot... there are usually no operations attached (except
sometimes for simple things like comparisons and such).

In any case, only these FBs know anything about how the data is stored.

Then I have a ClientFBHelper class that is where the actual business
logic-type things reside, so that the ClientFB winds up just dealing with
persistance.  So, in it I might have:

boolean isClientValid(ClientDTO client);

Where it starts to become a little bit of a hybrid is that the FBs don't
actually, in many cases, map to real modeled objects.  I'd describe them
as more mapping to a view of the model.

So in my Actions I do things like (in the case of saving a client):

ClientFB cfb = fbfactory.get(ClientFB);
ClientFBHelper cfbh = fbhelperfacroty.get(ClientFBHelper);
ClientDTO cdto = new ClientDTO();
PropertyUtils.copyProperties(cdto, actionform);
ActionForward af;
if (cfbh.isClientValid(cdto)) {
  if (cfb.saveClient(cdto)) {
af = mapping.findForward(goodsave);
  } else {
af = mapping.findForward(badsave);
  }
} else {
  af = mapping.findForward(notvalid);
}
return af;

The FBs and FBHelpers are gotten from a factory only, so I can control
various things easily (i.e., the factory makes sure the beans get set up
in the beginning and cleaned up at the end, share a database connection if
need be, things like that).  There is actually a Struts base Action that
instantiates the factories and passes them into execute() and then cleans
them up afterwards, but that's kind of outside this particular discussion.

I even toyed at one point with the idea of doing all of the above from a
config file and reducing the app to a single specialized Action in most
places.  When you find that most of your Actions look like the above,
that's a fairly appealing idea!

The nice thing about this setup is that I can test the persistance in the
FBs separate from the application and the helper classes separate from the
FBs and the app, etc.  It's also trivially easy to mock up either to test
the app.

In this approach, you can have a persistence framework involved or not. 
We've only recently here decided to use Hibernate across-the-board, so
much of our existing apps are straight JDBC.  But, converting them to use
Hibernate will only require changes in the FBs, everything else remains
the same (I've done some pilots to test that theory, and it works out
nicely).

So, to Rick's original point, I guess this really isn't as OO as we all
started out learning :)  But, as with most things it's an evolution of
understanding... I'd be willing to bet that 5 years from now we won't be
writing apps like we do today either and we'll wonder why we ever did
things this way or that.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, August 4, 2005 12:05 pm, Mark Benussi said:
 That's how my persistence framework goes.

 All my data extends a data object which makes public CRUD methods that
 accept a persister, you can then have File persisters, Database persisters
 etc. An employee shouldn't have any knowledge of how they persist in an
 enterprise IMHO. All that logic is placed in the persister.

 Employee employee = new Employee();
 employee.setKey(1);

 // Reads and populates an employee.
 EmployeeDBPersister dbPersister = new EmployeeDBPersister(conn);
 employee.read(dbPersister);

 // Writes the employee to a file.
 EmployeeFilePersister filePersister = new EmployeeFilePersister(file);
 employee.create(filePersister);

 I hate DAO's. The company I work for uses them. Basically one class to do
 all the logic related in any way shape of form to a valgue amount of
 database tables. They then change a column on a table and wonder why there
 code is a nightmare to fix. If you have one Persister responsible for a
 table then you change the four pieces of sql for create read update and
 delete and you are laughing.

 In answer to the collections comment, I have managers which my application
 interfaces with to get collections. Basically something like

 EmployeeManager manager = new EmployeeManager();
 ArrayList employees = manager.getEmployees();

 And the method gets all the keys in a separate piece of SQL and then calls
 the code I have shown above.

 -Original Message-
 From: Rick Reumann [mailto:[EMAIL PROTECTED]
 Sent: 04 August 2005 16:15
 To: Struts Users Mailing List
 Subject: Re: DTOs are evil

 Michael Jouravlev wrote the following on 8/3/2005 9:07 PM:
 http://www.theserverside.com/news/thread.tss?thread_id=35233


Re: DTOs are evil

2005-08-04 Thread Laurie Harper

Rick Reumann wrote:
I do agree, though, with what others have said that DTOs/ValueObjects 
aren't really that OO. It's funny that the subject comes up because I 
was a late bloomer to the programming world (started about 6 years and 
was a waiter and science teacher before that:), and when I first started 
reading the Java books and then applying that to what I was 
reading/seeing in JSP projects I was on, the concepts did seem to conflict.


What I mean is take the concept of an Employee. In almost all web 
applications you see the EmployeeDTO being passed to the DAO...


employeeDAO.updateEmployee( employee );

 From what I recall the real OO way would be...

employee.update();

and employee takes care of updating itself.


The idea of a DTO is to encapsulate the persistence logic so that it can be 
independent of the model representation and business logic, and easily 
replaceable. There's nothing saying you can't put an update() method on 
your business objects and have it delegate to a DTO but you risk having an 
explosion of data access methods on your business objects that way. Since 
persistence is typically a quite separate concern from other domain logic, 
it makes sense to separate it out.


 From an OO perspective I don't see a problem having an Employee object 
that has a DAO inside that takes care of persistence. I do have a couple 
questions though about OO design if this approach is used...


1) Where do you encapsulate getting Collections back of your objects? 
For example an Employee object has CRUD methods, but what about you when 
you need a List of Employees? Do you make an EmployeeList object that 
has methods getEmployees? Do you maybe just 'cheat' and add a getList or 
getEmployees method directly to the Employee object?


Looking up lists of things is sort of a meta-concern; you're right, putting 
that on the Employee object would clutter things up, especially when you 
start needing more complex queries -- e.g. 
getEmployeesEligibleForPerformanceBonus() etc. Since these kinds of 
operations are a higher level concern (i.e. they aren't operations on 
employees but on the entire data class) they should typically live in a 
higher layer. That's often represented as a 'service' or 'manager' API, 
which also turns out to be a good place to put business-transaction type 
operations which also tend to cross-cut across multiple domain objects.


2) It also seems a bit heavy to return Collections of pretty heavy 
objects. (Each Employee since it's not a simple VO could be a large 
object - although by large I just mean having a bunch of methods in it 
etc - I'm not so sure it would be large footprint-wise if just the 
properties were being filled in the case of a list - so bottom line is 
maybe the extra stuff in the object doesn't matter much?


It depends on how 'connected' your domain objects are. If an employee 
references a manager and a manager contains a collection of reports and ... 
then you need to care about how much of the object graph you load when you 
load each employee. different persistence frameworks and ORM tools have 
different ways of managing this. If you need most of the data stored on an 
employee from the list, returning a list of employees makes sense. If you 
only need a sub-set of the properties on each employee, returning an 
intermediate representation of the specific data query will make more sense.



Side note...

3) Even from an OO perspective, you always hear about encapsulating 
unique behaviors to make things reusable, so in a sense couldn't you 
consider the 'properties' of an Employee 'unique' or, if not the 
properties, the CRUD stuff is 'sort of' unique? If this is the case, you 
could make an argument for separating out the properties into another 
object (DTO/VO) separate?


OO generally talks about grouping behaviour and data together, so factoring 
out the properties into a separate object would be less OO than factoring 
out a sub-set of the behaviour (the CRUD actions). In particular, CRUD 
actions are not behaviour of the business object ('save employee object to 
the database' is not an operation that makes sense in the context of the 
business domain, it's an implementation artifact [speaking broadly]). 
That's partly what makes them a good candidate for encapsulating separately.


L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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



Re: Problem in populating html controls from Bean...

2005-08-04 Thread Wendy Smoak

From: Laurie Harper [EMAIL PROTECTED]


This really should be an FAQ :-) The problem is that it's not legal to
nest JSP tags that way. Try:

  html:text property=title value=${someBean.oldTitle}
or
  html:text property=title value=%= someBean.getOldTitle() %


That prevents the framework from re-displaying the user's input if the form 
fails

validation.

At the risk of repeating myself:  the place to pre-populate your form beans
is in the Action, before you forward to the JSP.

--
Wendy Smoak


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



RE: Deploying on Tomcat - Urgent

2005-08-04 Thread aleiprecht
Post your 

web.xml file... (you can omit mime defs from it)
and the controller and plugin part of your struts config file

rgds
aleiprecht


-Original Message-
From: Shabada, Gnaneshwer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 04, 2005 6:41 PM
To: 'user@struts.apache.org'
Subject: Deploying on Tomcat - Urgent


Hello,
I am trying to deploy my Struts application on Tomcat 5.0.28 on Win2k. I get
the following error on my browser when I try to start up. My application has
tiles in them and I believe I configured everything properly. I was able to
successfully deploy and run the application in Websphere App Server 5.1
through WSAD. But it just doesn't run on Tomcat. I created a WAR file and
dropped it in webapps folder in Tomcat home and tried starting up the
server. I have my server.xml configured too.

Please help.

Thanks
Gnan

exception 
javax.servlet.ServletException: Can't get definitions factory from context.
at
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:825)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:758)
at org.apache.jsp.index2_jsp._jspService(index2_jsp.java:72)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
24)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter
.java:114)
root cause 
javax.servlet.jsp.JspException: Can't get definitions factory from context.
at
org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.jav
a:616)
at
org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:515
)
at
org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:477)
at
org.apache.jsp.index2_jsp._jspx_meth_tiles_insert_0(index2_jsp.java:88)
at org.apache.jsp.index2_jsp._jspService(index2_jsp.java:62)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
24)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter
.java:114)


 
This email message 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 email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to [EMAIL PROTECTED] 
Toys R Us, Inc.

-
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: Showing a PDF inside a JSP

2005-08-04 Thread Woodchuck
--- Gary VanMatre [EMAIL PROTECTED] wrote:
 Try a reservation of name filing.  It is a short one that is open to
 the public.  You are able to view the statement before paying for it
 (uses the embedeed pdf).  
 

Gary,

very nice!!  thanks for this great tip, i'm sure it will come in handy
in the future.  :)

it didn't work in FireFox, but it did in IE.  (you probably know this
already)

best regards,
woodchuck



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





Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



RE: Deploying on Tomcat - Urgent

2005-08-04 Thread Shabada, Gnaneshwer

THanks for your reply. Here is my plug-in part from struts-config.xml. I
don't have a Controller part.


plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml /
/plug-in
plug-in
className=org.acaosa.registration.web.plugin.RegistrationPlugIn
/plug-in
plug-in className=org.apache.struts.tiles.TilesPlugin 
set-property property=definitions-config
   value=/WEB-INF/tiles-defs.xml/
set-property property=moduleAware value=true /
set-property property=definitions-parser-validate
value=true /
/plug-in


here is web.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app id=WebApp
display-nameAcaosaRegistrationWeb/display-name
filter
filter-nameResponseOverrideFilter/filter-name 

filter-classorg.displaytag.filter.ResponseOverrideFilter/filter-class 
/filter
filter-mapping
filter-nameResponseOverrideFilter/filter-name 
url-pattern*.do/url-pattern
/filter-mapping
filter-mapping 
filter-nameResponseOverrideFilter/filter-name 
url-pattern*.jsp/url-pattern
/filter-mapping
!--listener

listener-classcom.sun.faces.config.ConfigureListener/listener-class
/listener--

servlet
servlet-nameaction/servlet-name

servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
param-nameapplication/param-name

param-valueorg.acaosa.registration.resources.ApplicationResources/param-v
alue
/init-param

init-param
param-nameconfig/param-name

param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
param-namedebug/param-name
param-value2/param-value
/init-param
init-param
param-namedetail/param-name
param-value2/param-value
/init-param
init-param
param-namevalidate/param-name
param-valuetrue/param-value
/init-param
init-param
param-namedefinitions-config/param-name
param-value/WEB-INF/tiles-defs.xml/param-value
/init-param
load-on-startup2/load-on-startup
/servlet
servlet
servlet-nameLog4jInit/servlet-name

servlet-classorg.acaosa.registration.web.plugin.Log4jInit/servlet-class
init-param
param-namelog4j-init-file/param-name
param-valuelog4j.properties/param-value
/init-param
init-param
param-namecommons-logging/param-name

param-valuecommons-logging.properties/param-value
/init-param
load-on-startup2/load-on-startup
/servlet
servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
/servlet-mapping

welcome-file-list
welcome-fileindex2.jsp/welcome-file
welcome-filedefault.html/welcome-file
welcome-filedefault.htm/welcome-file
welcome-filedefault.jsp/welcome-file
/welcome-file-list

taglib
taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
taglib-location/WEB-INF/struts-bean.tld/taglib-location
/taglib
taglib
taglib-uri/WEB-INF/struts-html.tld/taglib-uri
taglib-location/WEB-INF/struts-html.tld/taglib-location
/taglib
taglib
taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
taglib-location/WEB-INF/struts-logic.tld/taglib-location
/taglib
taglib
taglib-uri/WEB-INF/struts-nested.tld/taglib-uri

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

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

taglib-urihttp://www.ibm.com/websphere/wdo/core/taglib-uri
taglib-location/WEB-INF/lib/wdo_web.jar/taglib-location
/taglib
resource-ref 

Re: DTOs are evil

2005-08-04 Thread Dave Newton

Frank W. Zammetti wrote:


ArrayList getClientList();
ClientDTO getClientInfo(String id);
boolean saveClient(ClientDTO client);
boolean deleteClient(String id);

In any case, only these FBs know anything about how the data is stored.
 

I do much the same thing defined as an interface so I can switch 
persistence mechanisms.


(Hey, shouldn't getClientList return a List? ;)

I've never actually switched persistence mechanisms, of course, which 
leads me to wonder if I really need[ed] to do all that work. :/



I even toyed at one point with the idea of doing all of the above from a
config file and reducing the app to a single specialized Action in most
places.  When you find that most of your Actions look like the above,
that's a fairly appealing idea!
 

That's actually where I'm headed right now for generic CMS/CRUD, but I'm 
getting bogged down.


*sigh*


So, to Rick's original point, I guess this really isn't as OO as we all
started out learning :)


Well, yes and no--Common Lisp implements its OO by using generic methods:

(when (isValid cfbh cfb)
 (save cfb cdto))

so you still write an isValid and a save for each useful combination of 
FB and FBHelpers, but methods are dispatchedd based on the types of the 
parameters. More or less the same as if you wrote a class like this:


public class SortaGeneric {
   public static boolean isValid(ClientFBHelper cfbh_, ClientDTO cdto_) {
   // ... and then a miracle occurs
   return resultsOfClientDtoValidation;
   }
   public static boolean isValid(CompanyFBHelper cfbh_, CompanyDTO cdto_) {
   // ... you get the idea
   }
}

and did

if (SortaGeneric.isValid(cfbh, cdto)) {
   if (SortaGeneric.save(cdto)) {
   }
}

but in Lisp you can define the generics in a more appropriate place than 
a non-local static method class.


The only real difference between this and what you've done is the 
location of those methods--basically OO-by-hand rather than letting the 
system do it for you. With mild config and reflection you could remove 
the class depedencies in the actions, which is where my low-level stuff 
seems to be heading at the moment.


Dave



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



Re: DTOs are evil

2005-08-04 Thread Rick Reumann

Laurie Harper wrote the following on 8/4/2005 12:58 PM:

Looking up lists of things is sort of a meta-concern; you're right, 
putting that on the Employee object would clutter things up, especially 
when you start needing more complex queries -- e.g. 
getEmployeesEligibleForPerformanceBonus() etc. Since these kinds of 
operations are a higher level concern (i.e. they aren't operations on 
employees but on the entire data class) they should typically live in a 
higher layer. That's often represented as a 'service' or 'manager' API, 
which also turns out to be a good place to put business-transaction type 
operations which also tend to cross-cut across multiple domain objects.


This is EXACTLY what I currently do and even use the term Service 
since it makes sense to me. (I also use regular DTOs in the standard 
way.. simply a POJO). I guess my question is more to those (Rod?) that 
say DTOs are a bad idea since I think it makes sense to have them. For 
example, as your description above you might have a method in a service 
class that is: getEmployeesEligibleForPerformanceBonus() To me, it also 
then makes sense to encapsulate other Employee related operations there 
also including standard CRUD stuff. I find an application to become 
confusing when operations start being handled in different layers (ie 
some done from Service/Delegate classes, some called from the 
ValueObject itself).


OO generally talks about grouping behaviour and data together, so 
factoring out the properties into a separate object would be less OO 
than factoring out a sub-set of the behaviour (the CRUD actions). 


True, my initial statement was poorly worded, what I meant, though, was 
in regard to the DTO debate, once you do factor of the CRUD stuff you 
are left with just your standard DTO, but the distinction you make is 
noteworthy.


In  particular, CRUD actions are not behaviour of the business object ('save 
employee object to the database' is not an operation that makes sense in 
the context of the business domain, it's an implementation artifact 
[speaking broadly]). That's partly what makes them a good candidate for 
encapsulating separately.


I totally agree, yet this topic seems to come up a lot - where you'll 
see people state it's 'better design' and 'adheres more to standard OO' 
to do just the opposite (that is add these kind of CRUD methods to the 
object in question). I tend to agree that CRUD actions are NOT behaviors 
of business objects. For example, if working with Dog objects a save 
is much different than say performBark(). Barking, moving, eating 
owner's shoes, are behavior of a Dog - I don't see CRUD in the same light.


--
Rick

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



Re: Problem in populating html controls from Bean...

2005-08-04 Thread Rick Reumann

Wendy Smoak wrote the following on 8/4/2005 1:27 PM:


  html:text property=title value=${someBean.oldTitle}


That prevents the framework from re-displaying the user's input if the 
form fails

validation.

At the risk of repeating myself:  the place to pre-populate your form beans
is in the Action, before you forward to the JSP.


Yes exactly.

And if you are going to hardcode the value in there then you might as 
well not even use the Struts html tags?


html:text property=title value=${someBean.oldTitle}

Could just become

input type=text name=title value=${someBean.oldTitle}/

Occasionaly I will set a value manually in my JSP but for the most part, 
as Wendy states, this is usually a very bad practice Swapnil (form bean 
properties should be in place before going to the JSP).


--
Rick

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



Re: DTOs are evil

2005-08-04 Thread Frank W. Zammetti
On Thu, August 4, 2005 2:12 pm, Dave Newton said:
 Frank W. Zammetti wrote:

ArrayList getClientList();
ClientDTO getClientInfo(String id);
boolean saveClient(ClientDTO client);
boolean deleteClient(String id);

 (Hey, shouldn't getClientList return a List? ;)

Yep, I suppose it should :)  I have a bad habit of specifying
implementations rather than interfaces for collections.  Some day I'll
break myself of it :)

 I've never actually switched persistence mechanisms, of course, which
 leads me to wonder if I really need[ed] to do all that work. :/

I've yet to do it either, although I may have to with my most recent app. 
I'm not really looking forward to it... I don't mind learning new stuff as
part of a new project, but retrofitting tends to be more annoying than
fun, for me anyway.

I even toyed at one point with the idea of doing all of the above from a
config file and reducing the app to a single specialized Action in most
places.  When you find that most of your Actions look like the above,
that's a fairly appealing idea!


 That's actually where I'm headed right now for generic CMS/CRUD, but I'm
 getting bogged down.

 *sigh*

This kind of goes with the whole framework discussions around here
recently... this is the kind of thing I'd like to see in a new framework. 
I think there are large chunks of most webapps that can be developed in
a purely declarative way, if the system is robust enough.  I should only
have to write code for the more fringe cases (maybe not QUITE fringe
cases, but I think you know what I mean).

 Well, yes and no--Common Lisp implements its OO by using generic methods:

 (when (isValid cfbh cfb)
   (save cfb cdto))

 so you still write an isValid and a save for each useful combination of
 FB and FBHelpers, but methods are dispatchedd based on the types of the
 parameters. More or less the same as if you wrote a class like this:

 public class SortaGeneric {
 public static boolean isValid(ClientFBHelper cfbh_, ClientDTO cdto_) {
 // ... and then a miracle occurs
 return resultsOfClientDtoValidation;
 }
 public static boolean isValid(CompanyFBHelper cfbh_, CompanyDTO cdto_)
 {
 // ... you get the idea
 }
 }

 and did

 if (SortaGeneric.isValid(cfbh, cdto)) {
 if (SortaGeneric.save(cdto)) {
 }
 }

 but in Lisp you can define the generics in a more appropriate place than
 a non-local static method class.

 The only real difference between this and what you've done is the
 location of those methods--basically OO-by-hand rather than letting the
 system do it for you. With mild config and reflection you could remove
 the class depedencies in the actions, which is where my low-level stuff
 seems to be heading at the moment.

Interesting stuff!  I like the comment about removing the class
dependencies from the Actions, that's really what my declarative version
did, at least as far as the proof-of-concept went... I added some config
elements to struts-config that allowed you to declare what FBs and
FBHelpers each Action needed.  So, you might see:

actionDependencies action=action1
  object name=ClientFBcom.company.app.ClientFB/object
  object name=ClientFBHelpercom.company.app.ClientFBHelper/object
/actionDependencies

So, in a sense, those dependencies were injected into the Action.  You
just did the action work with them, everything else was handled outside.

Then I had a special Action base class that worked against an XML file. 
So, in keeping with my examples from before, you might see:

action name=action1
  function id=1createDTO:ClientDTO/function
  function id=2copyActionForm:ClientDTO/function
  function
id=3callMethod:ClientHelper.isClientValid(ClientDTO)/function
  check sourceid=3
if outcome=falsereturnForward:clientnotvalid/if
  /check
  function id=4callMethod:ClientFB.saveClient(ClientDTO)/function
  check sourceid=4
if outcome=truereturnForward:goodsave/if
if outcome=falsereturnForward:badsave/if
  /check
/action

The createDTO, copyActionForm, callMethod and returnForward were standard
commands I could issue.  I got it working to this point, never took the
exercise any further... there were some obvious problems that would have
taken a bit more effort to solve, but more importantly I wasn't really
sure it was actually better... declarative over code is almost always true
for me, but there is a certain point where the declarative complexity
outweighs just writing the code.  This might have been one of those cases,
I'm not sure :)

Even still, I think the idea is an interesting one, if done well.

Frank

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



RE: Deploying on Tomcat - Urgent

2005-08-04 Thread Shabada, Gnaneshwer
Albi,
I commented out all the below stuff you mentioned in my web.xml and also in
my struts-config.xml I just left the plugin tags and commented rest of them.
I still get the same error and nothing in the logs I find the same stack
trace. I also find one extra error during the server start up  as follows: I
am confused as to how this would work in WAS and not in Tomcat, I thought
Tomcat would be more simpler ..

anyways let me know if you find something..thanks


2005-08-04 15:23:48 StandardContext[/acaosareg]action: null
org.acaosa.registration.RegistrationException: Exception in
RegistrationFacade while getting state information.: =: Cannot create
resource instance
at
org.acaosa.registration.RegistrationFacade.getState(RegistrationFacade.java:
193)
at
org.acaosa.registration.util.RegistrationServices.getStateList(RegistrationS
ervices.java:82)
at
org.acaosa.registration.web.plugin.RegistrationPlugIn.init(RegistrationPlugI
n.java:66)
at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:
868)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10
29)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
4013)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8
23)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.
java:903)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at
org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:7
6)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j
ava:488)
at
org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483
)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at
org.apache.catalina.core.StandardService.start(StandardService.java:480)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused by: org.acaosa.registration.servicelocator.ServiceLocatorException:
=: Cannot create resource instance
at
org.acaosa.registration.servicelocator.ServiceLocator.getDataSource(ServiceL
ocator.java:187)
at
org.acaosa.registration.util.dao.DAOUtility.getDataSource(DAOUtility.java:28
)
at
org.acaosa.registration.util.dao.DAOUtility.getDBConnection(DAOUtility.java:
39)
at

[OT?] JSF - struts-faces-20050728.zip - integrating with Tiles

2005-08-04 Thread GRamani
Hi all:

This is my first message to the list after a *very* long time so I 
apologize in advance if this is either considered OT (I couldn't find a 
JSF list??) or this topic has been recently discussed. I am trying to 
integrate my struts+tiles(+xdoclet) app with jsf and am having trouble 
with integration of tiles.

Anyways, I finally downloaded the struts-faces-20050728.zip from cvs, and 
am trying to get struts-faces-example2.war to work. (since this is 
supposed to deal with tiles, right..?)

When i go to http://localhost:8080/struts-faces-example2/ I see two nice 
links saying Log On and Register but when I click on them nothing 
happens..? *Is* something supposed to?? The source for this page has, for 
example,

form id=menu:_id5 name=registrationForm 
action=/struts-faces-example2/layout.do method=post
input type=hidden name=menu:_id5 value=menu:_id5 /
a id=menu:_id5:register href=# 
onclick=document.forms['menu:_id5']['menu:_id5:_idcl'].value='menu:_id5:register';
 
document.forms['menu:_id5'].submit(); return false;Register/ainput 
type=hidden name=menu:_id5 value=menu:_id5 /
/form

so I imagine something should happen..? Or is this example not done yet? 


Many thanks in advance for all help!
Geeta

P.S. I have searched the archives, googled a lot, and have tried out a lot 
of dated advice (!), but have basically been spinning my wheels for three 
days now, hence this note..

help on plugin and i18n

2005-08-04 Thread peeths @struts
hi all,
i'm new to struts , i just come up with the concept and i would like
to know where i'll get struts plugin for eclipse for jboss server in
linux .

i'm working on internationalization , i deployed an application but
i'm getting an error message in the index.jsp page
javax.servlet.ServletException: Missing message for key app.username

i have defined applicationresources property file and also other
property file , but i'm not able to  run the program . what can be the
problem

regards
Anoop

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



[Request] Struts documentation update

2005-08-04 Thread Konrad Billewicz
Hello,

I propose to modify Struts documentation named Realm Configuration HOW-TO 
located at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html.

Today I spent at work 4 hours (!) fighting with DataSourceRealm. I had a 
continuously error: javax.naming.NameNotFoundException: Name jdbc is not bound 
in this Context. I got really mad because data source was excellently 
configured. I searched tons of web pages using google and found only that many 
people have similar problem. Both colleague and I haven't got any idea what is 
wrong.

Finally, at home, 20 minutes ago (23:00 ;-), I figured out what was the reason. 
localDataSource parameter has to be set to true. I found this solution on 
usenet archive in Polish post written more that year ago. All the time I tried 
to make crazy things with this parameter because I thought that this had to be 
an JNDI address (or false), not true value!

In my opinion, confirmed with others problems, you should mark in documentation 
that this is boolean parameter and for context-defined data sources it should 
be 
set to true.

This is a common problem. I wish to help novice Struts developers who will face 
it in the future. So far you were helping me and it is time to start paying 
back. ;-)

Best regards,
Konrad Billewicz



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



Re: DTOs are evil

2005-08-04 Thread Michael Jouravlev
On 8/4/05, Laurie Harper [EMAIL PROTECTED] wrote:
 The idea of a DTO is to encapsulate the persistence logic so that it can be
 independent of the model representation and business logic, and easily
 replaceable.

I thought that this is the idea of DAO.

 There's nothing saying you can't put an update() method on
 your business objects and have it delegate to a DTO but you risk having an
 explosion of data access methods on your business objects that way. Since
 persistence is typically a quite separate concern from other domain logic,
 it makes sense to separate it out.

This I agree with, moving persistence details to DAO is good. But DAO
is not DTO ;-)
 
 Looking up lists of things is sort of a meta-concern; you're right, putting
 that on the Employee object would clutter things up, especially when you
 start needing more complex queries -- e.g.
 getEmployeesEligibleForPerformanceBonus() etc.

If I remeber correctly, EJB encouraged practice like that.

 Since these kinds of
 operations are a higher level concern (i.e. they aren't operations on
 employees but on the entire data class) they should typically live in a
 higher layer.

I would prefer other Rick's idea of having another business object
like ListOfEmployess with different finders.

 OO generally talks about grouping behaviour and data together, so factoring
 out the properties into a separate object would be less OO than factoring
 out a sub-set of the behaviour (the CRUD actions). In particular, CRUD
 actions are not behaviour of the business object ('save employee object to
 the database' is not an operation that makes sense in the context of the
 business domain, it's an implementation artifact [speaking broadly]).
 That's partly what makes them a good candidate for encapsulating separately.

Agree with that.

I would like to return back to the objects. I still think, that a user
works (at least wants to work) with objects, either with singletons or
with sets of objects. Real-life objects (the ones the user wants to
work with) are represented in the application, and OOP theory is all
about representing real objects with app objects. So, if the modeling
and representaion is done right, we do not need DTOs, because we
already store objects that are of interest for a user.

I can understand the idea of loading only 2 fields out of 20 or
aggregating several objects into one, but I really would not care
unless we loading a set of objects.

So, DTOs are useful where:
* model was done incorrectly
* in cases of really severe bandwidth contstraints
* for sets (lists) of objects

Now what if you have list of objects, and you create another one? If
you use DTOs, you need to save DTO1 to database, and also to create
and insert DTO2 in the list. If you had real object, you just create
it, save it, and add to the list. One object instead of two. Of
course, you can reread the list after you save the object, but this is
unefficient, right?

On the other hand, application design is usually different for
read-only and for read-write applications (classic OLAP vs. OLTP
case).

I am for having persistence separate from business objects, but
factored-out persistence still needs to build proper SQL statement
depending on the object it saves... I am against putting validation
outside of business objects. Validation rules belong to business
objects, imho.

On 8/4/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 Then I had a special Action base class that worked against an XML file.
 So, in keeping with my examples from before, you might see:
 
 action name=action1
   function id=1createDTO:ClientDTO/function
   function id=2copyActionForm:ClientDTO/function
   function
 id=3callMethod:ClientHelper.isClientValid(ClientDTO)/function
   check sourceid=3
 if outcome=falsereturnForward:clientnotvalid/if
   /check
   function id=4callMethod:ClientFB.saveClient(ClientDTO)/function
   check sourceid=4
 if outcome=truereturnForward:goodsave/if
 if outcome=falsereturnForward:badsave/if
   /check
 /action
 
 The createDTO, copyActionForm, callMethod and returnForward were standard
 commands I could issue.  I got it working to this point, never took the
 exercise any further...

Hmm, my CRUDAction does almost exactly the same, but it has predefined
list of events (methods) and outcomes.

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



Re: {Spam?} help on plugin and i18n

2005-08-04 Thread GRamani
Hi Anoop:

Have you looked at this page:

http://www.systemmobile.com/articles/strutsMessageResources.html

Regards,
Geeta




peeths @struts [EMAIL PROTECTED] 
08/04/2005 04:08 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
{Spam?} help on plugin and i18n






hi all,
i'm new to struts , i just come up with the concept and i would like
to know where i'll get struts plugin for eclipse for jboss server in
linux .

i'm working on internationalization , i deployed an application but
i'm getting an error message in the index.jsp page
javax.servlet.ServletException: Missing message for key app.username

i have defined applicationresources property file and also other
property file , but i'm not able to  run the program . what can be the
problem

regards
Anoop

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


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



CONFIDENTIALITY NOTICE:This email is intended solely for the person or 
entity to which it is addressed and may contain confidential and/or 
protected health information.  Any duplication, dissemination, action 
taken in reliance upon, or other use of this information by persons or 
entities other than the intended recipient is prohibited and may violate 
applicable laws.  If this email has been received in error, please notify 
the sender and delete the information from your system.  The views 
expressed in this email are those of the sender and may not necessarily 
represent the views of IntelliCare.


Displaying a image from a MySQL Blob field

2005-08-04 Thread C.F. Scheidecker Antunes

Hello all,

I am writing a Struts application which needs to read a database, fetch 
an image inside a blob field and display it in a JSP page in two 
different ways:
- Within a thumbnail size inside a column of a normal html table. 
Which means the image needs to be resized for displaying purposes.
All images inside this table cannot exceed a maximum height and width in 
order to have a neat display.

- And using the image original size.

Hence, I would like to ask if is there any example code on how to 
accomplish this task.
I guess the image size could be configured through html/javascript but 
what I wonder is how to read from the database and send it to the view 
component, the JSP

page to have it displayed.

I appreciate any inputs on this issue.

Thanks in advance,

C.F.

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



Re: Displaying a image from a MySQL Blob field

2005-08-04 Thread Wendy Smoak

From: C.F. Scheidecker Antunes [EMAIL PROTECTED]

I am writing a Struts application which needs to read a database, fetch an 
image inside a blob field and display it in a JSP page in two different 
ways:
- Within a thumbnail size inside a column of a normal html table. Which 
means the image needs to be resized for displaying purposes.
All images inside this table cannot exceed a maximum height and width in 
order to have a neat display.

- And using the image original size.


When you put img src=.../ in an HTML page, the browser will make a 
separate request to get the image.  I would map that request to a plain old 
Servlet-- there's no reason to tie this to the Struts framework.


I do this now for an image that's generated by JFreeChart, but the same 
thing applies if you're going to retrieve binary data from a database and 
write it out to the browser.  Assuming you already know how to retrieve the 
image from the database, ask Google about images and servlets:

  http://www.google.com/search?q=java+image+servlet

I would get the full size image retrieval and display working first, then 
think about how to do the thumbnails.


--
Wendy Smoak 




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



Re: [OT] DTOs are evil

2005-08-04 Thread Leon Rosenberg

 -Ursprüngliche Nachricht-
 Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
 Gesendet: Donnerstag, 4. August 2005 23:27
 An: Struts Users Mailing List
 Betreff: Re: DTOs are evil


 So, DTOs are useful where:
 * model was done incorrectly
 * in cases of really severe bandwidth contstraints
 * for sets (lists) of objects
 

Sorry, but i can't resist replying.

In opposite to the above said, i'd postulate that 
each software system, which is large enough to be of interest (like in
Goedels theorem :-)) , must have DTOs (or ValueObjects)
or it was incorrectly modeled.

Each software system (which is large enough...) has more then one layer.
Different layers usually handles same data. Each of the layers has ist own
view on the data. The business layer, which has to calculate the salary of
an employee is not interested in employee's persistence capabilities. It's
not interested in internal object id (like the one generated by hibernate).
The presentation layer is not interested in employee's identity card
attribute, but solely in presentation issues, like name or similar.
According to the principles of data hiding, a layer should only be able to
access data, which it really needs. Therefore, there is no need that the
employee object which is used by the presentation layer is the same, which
is used by the business layer, and the same which knows everything about
underlying persistence capabilities, like oodb, rdb or file system.

Therefore the DTO object is the protocol, the language spoken between the
layers, and if you want to achieve a layer separation, you need to separate
the view from the data. (Olympic ring metaphor by Ted Husted).

You may say that the DTO's are not OO, because they only contain state and
no behaviour. That's right, but com'on, we are talking about java here, and
java isn't a simple OO language, but a component-oriented language, and DTOs
are part of the component definition.

As for Rod Johnson, he said that DTOs are evil if you don't want to
distribute the application (arguable point btw, because i believe we should
provide clean application design in any case), but as I said before, we are
talking about _LARGE_SYSTEMS and they are 99% distributed.

For a HelloWorld applet, or a small address management programm, I probably
don't need DTOs. As soon, as I have more then one component - I do.


Regards
Leon

P.S. By the way, Rod Johnson also said persistent objects that contain only
getters and setters are evil too (same page as dto, 27). In my understanding
it means hibernate and ibatis which use such objects are at least as evil?
How are you supposed to represent data anyway then?





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



Re: Displaying a image from a MySQL Blob field

2005-08-04 Thread Frank W. Zammetti
Because your dealing with a database, you may want to try the 
DownloadAction... it will deal with at least some of the details.  IIRC, 
somewhere on the Wiki is an example I wrote of using it specifically 
returning an object from a database.  II-DON'T-RC, ping me, I know I've 
done it at some point.


Frank

Wendy Smoak wrote:

From: C.F. Scheidecker Antunes [EMAIL PROTECTED]

I am writing a Struts application which needs to read a database, 
fetch an image inside a blob field and display it in a JSP page in two 
different ways:
- Within a thumbnail size inside a column of a normal html table. 
Which means the image needs to be resized for displaying purposes.
All images inside this table cannot exceed a maximum height and width 
in order to have a neat display.

- And using the image original size.



When you put img src=.../ in an HTML page, the browser will make a 
separate request to get the image.  I would map that request to a plain 
old Servlet-- there's no reason to tie this to the Struts framework.


I do this now for an image that's generated by JFreeChart, but the same 
thing applies if you're going to retrieve binary data from a database 
and write it out to the browser.  Assuming you already know how to 
retrieve the image from the database, ask Google about images and servlets:

  http://www.google.com/search?q=java+image+servlet

I would get the full size image retrieval and display working first, 
then think about how to do the thumbnails.




--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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



Re: DTOs are evil

2005-08-04 Thread Adam Hardy

Rick Reumann on 04/08/05 19:12, wrote:
In  particular, CRUD actions are not behaviour of the business object 
('save employee object to the database' is not an operation that makes 
sense in the context of the business domain, it's an implementation 
artifact [speaking broadly]). That's partly what makes them a good 
candidate for encapsulating separately.



I totally agree, yet this topic seems to come up a lot - where you'll 
see people state it's 'better design' and 'adheres more to standard OO' 
to do just the opposite (that is add these kind of CRUD methods to the 
object in question). I tend to agree that CRUD actions are NOT behaviors 
of business objects. For example, if working with Dog objects a save 
is much different than say performBark(). Barking, moving, eating 
owner's shoes, are behavior of a Dog - I don't see CRUD in the same light.


If a dog must save itself when it changes but cannot have the action as 
a behaviour, you immediately accept the necessity of a persistence 
layer. Hence Hibernate, EJB CMP, etc and the DAO pattern.


So where does that leave the DTO? By my way of thinking (a dangerous 
area indeed most likely) it is still very OO to have a class with 
business methods, but where the data is encapsulated within the DTO, 
which itself as a whole is a property or an item in a collection, rather 
than a whole series of getters, setters and private properties.


But it's getting late so I'm willing to be proved wrong.


Adam

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



Re: [OT] DTOs are evil

2005-08-04 Thread Michael Jouravlev
On 8/4/05, Leon Rosenberg [EMAIL PROTECTED] wrote:
 Each software system (which is large enough...) has more then one layer.
 Different layers usually handles same data. Each of the layers has ist own
 view on the data. The business layer, which has to calculate the salary of
 an employee is not interested in employee's persistence capabilities. It's
 not interested in internal object id (like the one generated by hibernate).
 The presentation layer is not interested in employee's identity card
 attribute, but solely in presentation issues, like name or similar.
 According to the principles of data hiding, a layer should only be able to
 access data, which it really needs. Therefore, there is no need that the
 employee object which is used by the presentation layer is the same, which
 is used by the business layer, and the same which knows everything about
 underlying persistence capabilities, like oodb, rdb or file system.

The employee object is employee object, it is the representation of a
real-life object. The view of employee object can be different. That
is what DTO is, it is a view.

 Therefore the DTO object is the protocol, the language spoken between the
 layers, and if you want to achieve a layer separation, you need to separate
 the view from the data. (Olympic ring metaphor by Ted Husted).

You mean, separate view from the business object, not from the data?
;-) Anyway, I am not sure that this separation is needed, unless view
layer is developed by an evil third party contractor.

 You may say that the DTO's are not OO, because they only contain state and
 no behaviour. That's right, but com'on, we are talking about java here, and
 java isn't a simple OO language, but a component-oriented language, and DTOs
 are part of the component definition.
 
 As for Rod Johnson, he said that DTOs are evil if you don't want to
 distribute the application (arguable point btw, because i believe we should
 provide clean application design in any case), but as I said before, we are
 talking about _LARGE_SYSTEMS and they are 99% distributed.

Rod (or what is Craig or David? I think it was Rod) said that by his
assessment, only about 15% of EJB apps are distributed. All other guys
simply spent hundreds of man-hours to make app distributable, for no
reason. I do not think that this percentage is higher for non-EJB
apps. What is really needed for distributed apps is Serializable
objects.

 For a HelloWorld applet, or a small address management programm, I probably
 don't need DTOs. As soon, as I have more then one component - I do.
 
 
 Regards
 Leon
 
 P.S. By the way, Rod Johnson also said persistent objects that contain only
 getters and setters are evil too (same page as dto, 27). In my understanding
 it means hibernate and ibatis which use such objects are at least as evil?
 How are you supposed to represent data anyway then?

If getters and setters do nothing more than simply read field or set
field, then they are evil, you do not need Rod Johnson to tell you
that ;) Problem with Java that it got a lot of new stuff in 1.5, but
it still does not have normal properties like Delphi has or at least
like C# has. If a class member could have different access modifiers
for read and write, then getters and setters would not be needed in
most of cases.

Delphi properties rule, Java getters/setters suck, this is for sure.

Michael.

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



Re: [OT] DTOs are evil

2005-08-04 Thread Frank W. Zammetti

Michael Jouravlev wrote:

If getters and setters do nothing more than simply read field or set
field, then they are evil, you do not need Rod Johnson to tell you
that ;) 


I think I may... why exactly is this evil?

We're talking, at the most basic level, about a construct that 
encapsulates properties of a modeled object behind a (theoretically) 
well-defined interface.  If you do it right you can change details of 
the implementation without altering client classes.


This is all nothing anyone reading this doesn't know of course :)

If you mean a class who's accessors and mutators simply do:

return this.field;

and

this.field = field;

...then, while I'm not sure I would call it evil, certainly that isn't 
using the concept to its full potential.  The public interface should 
also be well-behaved, i.e., should handle incorrect data types and 
nulls and things like that gracefully.


But even that argument seems to me less important than the basic concept 
of a well-organized data structure to describe some modeled object, and 
that's what you have even if the methods are doing nothing but like the 
above.


Why anyone would call that evil I don't understand.  Care to convince me 
it is? :)


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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



Re: [OT] DTOs are evil

2005-08-04 Thread Michael Jouravlev
On 8/4/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 Michael Jouravlev wrote:
  If getters and setters do nothing more than simply read field or set
  field, then they are evil, you do not need Rod Johnson to tell you
  that ;)
 
 I think I may... why exactly is this evil?
 
 We're talking, at the most basic level, about a construct that
 encapsulates properties of a modeled object behind a (theoretically)
 well-defined interface.  If you do it right you can change details of
 the implementation without altering client classes.
 
 This is all nothing anyone reading this doesn't know of course :)
 
 If you mean a class who's accessors and mutators simply do:
 
 return this.field;
 
 and
 
 this.field = field;
 
 ...then, while I'm not sure I would call it evil, certainly that isn't
 using the concept to its full potential.

Yes, this is exactly what I mean. This is evil. I take that you have
not used Object Pascal? It is not just for kiddies. Check this
article, for example:
http://www.informit.com/articles/printerfriendly.asp?p=26862

=== cut here ===
TCustomEdit = class(TWinControl)
  private
FMaxLength: Integer;
  protected
procedure SetMaxLength(Value: Integer);
  ...
  published
property MaxLength: Integer read FMaxLength write SetMaxLength default 0;
  ...
end;
=== cut here ===

Here TCustomEdit is a component, and MaxLength is a property (it does
not have to be published, but if it is, then it automatically shows in
IDE property editor). You can define either only getter, or only
setter or both. You can map private field directly or use method. You
can set default value as well. Indexed properties are supported too.

Java 5 got annotations and generics, but still does not have
properties, that are easy to use, and could be set from IDE. Oh,
right, original Javabean specification has something about that, but
getters and setters is all that really left from the spec. Probably
because it was not simple enough.

Considering the commenting style and how javadoc assign comments to
methods and groups them in the help file, one simple Java property is
at least half a screen of garbage. Instead I would prefer to have:

  property MaxLength: Integer read FMaxLength write SetMaxLength default 0;

Is this so hard to implement in the compiler?

 Why anyone would call that evil I don't understand.  Care to convince me
 it is? :)

See above ;-)

Michael.

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



Re: [OT] DTOs are evil

2005-08-04 Thread Frank W. Zammetti

Michael Jouravlev wrote:

Yes, this is exactly what I mean. This is evil. I take that you have
not used Object Pascal? 


I've actually seen it, although I can't say I've personally used it.


  property MaxLength: Integer read FMaxLength write SetMaxLength default 0;


There's nothing to stop you from doing:

private Integer MaxLength; public void setMaxLength(Integer MaxLength) { 
this.Maxlength = MaxLength; } public Integer getMaxLength() { return 
this.MaxLength(); }


Well, nothing except knowing it's a bad style :)  And no, I'm not trying 
to compare that single OPascal line and this, clearly the Pascal line is 
cleaner.



Is this so hard to implement in the compiler?


I certainly wouldn't think so.  I'd be willing to bet there is a reason 
it hasn't been done before though because I agree it would make a lot of 
sense.



Why anyone would call that evil I don't understand.  Care to convince me
it is? :)



See above ;-)


I guess I took the word evil quite literally :)  I agree what Java 
offers in this regard is probably sub-par, but I still think there is 
enough value in a class that does the bare minimum, just in terms of 
organization, to not want to attach the word evil to it... if you said 
non-optimal, I would agree :)



Michael.


Frank



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



[OT] The 'Jakarta' of Javascript?

2005-08-04 Thread Laurie Harper
When it comes to server-side Java components and libraries, I generally 
find most of what I need at Jakarta or elsewhere at Apache; it's certainly 
one of the first places I always look. Is there a 'Jakarta' of client-side 
components?


Lately I've been keeping my eye out for good Javascript resources, from 
AJAX frameworks to calendar controls like the one Wendy recently posted a 
link to [1] to cool visual effects [2] and dynamic UI components [3].


What are your favourite sources for this kind of thing? Do you have any 
particularly neat examples nestled amongst your bookmarks?


L.

[1] http://www.dynarch.com/projects/calendar/
[2] http://script.aculo.us/visual-effects
[3] http://openrico.org/rico/livegrid.page
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie
http://www.dynarch.com/projects/calendar/


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



Token handling in dispatch Action

2005-08-04 Thread Girish Kumar K. P.



Hi,

How do I implement token handling in dispatch Action?

Regards,

Girish

 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

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



Re: [OT] The 'Jakarta' of Javascript?

2005-08-04 Thread Frank W. Zammetti

www.dynamicdrive.com

I don't recall ever actually using anything from that site, I tend to 
write all my own client-side stuff, but I've very definitely gotten 
inspiration from some of the stuff there. :)


Frank

Laurie Harper wrote:
When it comes to server-side Java components and libraries, I generally 
find most of what I need at Jakarta or elsewhere at Apache; it's 
certainly one of the first places I always look. Is there a 'Jakarta' of 
client-side components?


Lately I've been keeping my eye out for good Javascript resources, from 
AJAX frameworks to calendar controls like the one Wendy recently posted 
a link to [1] to cool visual effects [2] and dynamic UI components [3].


What are your favourite sources for this kind of thing? Do you have any 
particularly neat examples nestled amongst your bookmarks?


L.

[1] http://www.dynarch.com/projects/calendar/
[2] http://script.aculo.us/visual-effects
[3] http://openrico.org/rico/livegrid.page


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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



help on plugin and i18n

2005-08-04 Thread peeths @struts
hi all,
i'm new to struts , i just come up with the concept and i would like
to know where i'll get struts plugin for eclipse for jboss server in
linux .

i'm working on internationalization , i deployed an application but
i'm getting an error message in the index.jsp page
javax.servlet.ServletException: Missing message for key app.username

i have defined applicationresources property file and also other
property file , but i'm not able to  run the program . what can be the
problem

regards
Anoop

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



Re: {Spam?} help on plugin and i18n

2005-08-04 Thread peeths @struts
hi Geeta ,

thanx for the link , which u have send me , i'll go through , thanx very much

regards
anoop

On 8/5/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi Anoop:
 
 Have you looked at this page:
 
 http://www.systemmobile.com/articles/strutsMessageResources.html
 
 Regards,
 Geeta
 
 
 
 
 peeths @struts [EMAIL PROTECTED]
 08/04/2005 04:08 PM
 Please respond to
 Struts Users Mailing List user@struts.apache.org
 
 
 To
 user@struts.apache.org
 cc
 
 Subject
 {Spam?} help on plugin and i18n
 
 
 
 
 
 
 hi all,
 i'm new to struts , i just come up with the concept and i would like
 to know where i'll get struts plugin for eclipse for jboss server in
 linux .
 
 i'm working on internationalization , i deployed an application but
 i'm getting an error message in the index.jsp page
 javax.servlet.ServletException: Missing message for key app.username
 
 i have defined applicationresources property file and also other
 property file , but i'm not able to  run the program . what can be the
 problem
 
 regards
 Anoop
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 
 
 
 CONFIDENTIALITY NOTICE:This email is intended solely for the person or
 entity to which it is addressed and may contain confidential and/or
 protected health information.  Any duplication, dissemination, action
 taken in reliance upon, or other use of this information by persons or
 entities other than the intended recipient is prohibited and may violate
 applicable laws.  If this email has been received in error, please notify
 the sender and delete the information from your system.  The views
 expressed in this email are those of the sender and may not necessarily
 represent the views of IntelliCare.
 


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



Re: help on plugin and i18n

2005-08-04 Thread d d
  
u can download MyEclipse (MyEclipse Enterprise Workbench) from Myeclipseside 
stie. It provides tools for handling struts.

For application resource:See if u have configured tag.message-resources in 
struts_config.xml
message-resources parameter=com.yourcompany.struts.ApplicationResources /

On Fri, 05 Aug 2005 [EMAIL PROTECTED] wrote :
hi all,
i'm new to struts , i just come up with the concept and i would like
to know where i'll get struts plugin for eclipse for jboss server in
linux .

i'm working on internationalization , i deployed an application but
i'm getting an error message in the index.jsp page
javax.servlet.ServletException: Missing message for key app.username

i have defined applicationresources property file and also other
property file , but i'm not able to  run the program . what can be the
problem

regards
Anoop

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



Re: Upload multiple files at once

2005-08-04 Thread KIRANKUMAR
Lionel cooll at free.fr writes:

 
 Deepak wrote:
  Hi,
  Is there a way to upload multiple files at once ?
 
 Zip them before.
 



hi u can take multiple FormFile in the form and u can do, i have tried  and i 
got, 





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



Custom Validation doesn't add

2005-08-04 Thread Franz-Josef Herpers

Hi,

I ran into a strange problem with the validation of form input that 
includes an uploaded file in Struts 1.2.7. I wrote a custom validation 
method for validating the file size of an uploaded file:


 public static boolean validateFile(Object bean,
   ValidatorAction validatorAction,
   Field field,
   ActionMessages messages,
   Validator validator,
   HttpServletRequest request) {
  
   Object o = 
request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);

   Boolean fileLengthExceeded = (Boolean) o;

   if ((fileLengthExceeded != null)  fileLengthExceeded.booleanValue()) {
 messages.add(field.getKey(),
Resources.getActionMessage(request, validatorAction, 
field));

 return false;
   }

   return true;

 }

I defined a validation rule in my validator-rules.xml:

   validator name=fileSize
  
classname=org.uba.iuclidx.gui.web.struts.validators.FormValidator

  method=validateFile
  methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest
  msg=errors.maxLengthFileExceeded/

And I added an entry for the form to be validated in validation.xml

 form name=iuclidExportForm
 field property=casNo depends=required
   msg name=required key=casNo.required/
 /field
 field property=blockTableNames depends=required
   msg name=required key=blockTableNames.required/
 /field
 field property=mapDescrFile depends=required,fileSize
   msg name=required key=mapDescrFile.required/
   msg name=fileSize key=maxLengthMapDescrFileExceeded/
 /field
   /form

Everything works fine, and the method is called. But if the file exceeds 
the file size defined in the controller element of struts-config.xml, I 
get the error messages of all fields for the required validation rule 
(including the file upload field!), but not the one for exceeding the 
file size. Additionally the fields contain no more values. As if the 
form has been reset after executing validateFile and then validated 
again.


Any ideas or hints?

Thanks in advance.
Franz


--
Franz-Josef Herpers

fjh consulting
Tel.: +49 30 2068 7154
Mobil: +49 173 54 23 666
VoIP: +49  948 625515
Fax: 01212 6 20687154
Puschkinallee 9A
12435 Berlin

Email: [EMAIL PROTECTED]
VoiceMail: 01212-6-20687154

http://www.fjh-consulting.de
__
http://www.openbc.com/go/invuid/FranzJosef_Herpers



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



Re: [OT] My O'Reilly Open Source Conference Talk

2005-08-04 Thread Craig A. Vanderborgh

Adam Hardy wrote:


Craig McClanahan on 03/08/05 23:10, wrote:


I just uploaded the slides from my OSCON talk this afternoon,
comparing several web frameworks on how they implement six major
architectural features.  Several people have asked for them, so here's
a link:

  http://people.apache.org/~craigmcc/oscon_2005_web_architectures.pdf



Can I summarise in a slightly Friday manner :)

(1) Struts: v1.3 should be better, in fact there are at least 5 major 
points that need addressing


(2) Webwork: kind of weird, has Actions but has unknowns like XWork, 
interceptor stacks, OGNL


(3) Spring MVC: totally flexible, configurable, wide variety of 
implementations - everything to everybody. Sounds like it can make 
coffee too. Good if you love XML config files.


This is kind of a breezy and under-informed synopsis.  Spring Web MVC is 
about the same in terms of XML configuration as Struts, but it has 
back-end infrastructure and really clean good design, both of which 
Struts lack.  Instead of being everything to everybody, it's exactly 
what people like us (and thousands of others) need.


If you're still stuck on Struts like we were, why?  It's 2005, and 
Struts is now O-L-D and it hasn't aged especially well.  Spring turns 
out a much better solution for most web applications than Struts.  To 
summarize more meaningfully, the primary benefits of Spring compared 
with Struts and other solutions are:


1. Spring is a much more complete application framework providing 
persistence infrastructure, AOP, lightweight container, etc. in addition 
to web MVC.
2. Spring is non-invasive and is a pick-and-choose framework.  It 
provides just about everything most people need, but you only have to 
learn about and use the things YOU need/want.
3. Spring is the right solution for those among us who are tired of 
being their own integrator.  With Spring, the infrastructure is already 
integrated and so this is a significant time saver for many projects.
4. Spring is a first-principles design framework.  It was very carefully 
and very elegantly designed from the ground up by Rod Johnson and 
Juergen Hoeller.  If you are even a little bit careful, these ideas will 
permeate your own application.  And these are great ideas.  So when you 
build a Spring application correctly you end up with something that is 
an intrinsically better and therefore more long-lasting and flexible 
piece of software.


Regards,
craig vanderborgh

(4) Tapestry: even weirder than Webwork, and you don't get to use 
JSPs, you have to write your HTML like ColdFusion


(5) JSF: obviously the dog's gonads

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



[OT] What to choose: Struts, JSF, Shale or Spring

2005-08-04 Thread bjester_2004
Hi Gurus,
 
Sorry for the OT. 
I have been working on jsp/servlets for a last four years to create web pages.  
Now that I have found out there is more out there, I am in a dilemma.  Which 
one should I learn and why?  I have a big web project coming up and was 
wondering which of these I should choose to work on.  This project needs good 
validation and object relational or sql mapping (hibernate or ibatis).  If you 
have any books or site links to name, please let me know.
 
Thanks,
 
Bob


-
 Start your day with Yahoo! - make it your home page