Re: request between actions

2004-12-01 Thread brenmcguire
It seems that a bug report connected to this problem has been posted. Take
a look to:
http://issues.apache.org/bugzilla/show_bug.cgi?id=32134
I think the way to work around to it is to put in the  tag the
attribute:
contextRelative="true"
Or maybe you could download the CVS version of Struts (ok ok I'm joking!).

Morales de Frías wrote:

>Thanks for your help, but it's still not working.
>
>i've changed struts config, from redirect="true" (ops..) to
redirect="false". And it's supossed that i will have my request's
parameters in second action, but it isn't true. I don's see any
parameters...
>
>What is the error??
>
>Best regards
>
>
>
>-Mensaje original-
>De: Ram Venkataswamy [mailto:[EMAIL PROTECTED]
>Enviado el: martes, 30 de noviembre de 2004 21:33
>Para: Struts Users Mailing List
>Asunto: RE: request between actions
>
>
>Set to "true" if a redirect instruction should be issued to the
user-agent so that a new request is issued for this forward's resource. If
true, RequestDispatcher.Redirect is called. If "false",
RequestDispatcher.forward is called instead. [false].
>
>
>
>The culprit is redirect=true - check the definition above
>
>
>
>
>
>-Original Message-
>From: Morales de Frías, David [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 30, 2004 12:17 PM
>To: [EMAIL PROTECTED]
>Subject: request between actions
>
>
>
>Hi all¡¡
>
>
>
>I need your help, please.
>
>
>
>I have an action that forwards to another action, and i'm loosing request
parameters.
>
>
>
>I have in struts-config this lines:
>
>
>
>
>
>
>
>but it doesn't work.
>
>
>
>Can you help me?
>


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



Re: message-resources in struts-config.xml won't work!

2004-12-01 Thread René Thol
Hello again,
Lane, Brad schrieb:
Use 
key=""/> 
 

Unfortunately this did not change anything. I'm still getting this error.
Kind regards
--

René Thol
E-Mail: [EMAIL PROTECTED]


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


RE: Using a key as var-value in validator

2004-12-01 Thread Kinjal Sonpal
Ram,

Thanks for replying back.

> If you have defined resource bundle in struts config & are able to
> access key from jsp then no additional step/configuration
> is required to
> access them in validation file. The arg/msg lookup resource bundle
> defined for the application and then pick up value

Yeah, this is fine. But I also need to access the key in defining
 tag of the  tag. Right now I have to do a
workaround by using a global constant. I want to avoid multiple points
of updation.

Thanks and regards,
Kinjal Sonpal

"In the real world, the right thing never happens in the right place
at the right time. It is the task of journalists and historians to
rectify this error."
Mark Twain




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



RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread David G. Friedman
Niall,

Derek isn't crazy and this looks like a bug to me IF your args try to use
'resource="true"'.  I duplicated the problem using Struts 1.2.4 with the
commons validator 1.1.3 and 1.1.4 jars.  Sadly, the java code suggests
resource="true" works in 1.1.4 but I can't get it to work even with a new
1.1.4 testing jar AND fully stopping/restarting Tomcat 5.5.4.  Essentially,
I'm seeing resource="true" use the message resources to fill out the error
fields on both the client and server sides, just not populating the vars for
the client or server side validations to be able to use them.

For example, using this rule, call it "rule A", everything works normally on
the client and server sides:






minlength7
maxlength20



Modifying this into "rule B", the validation will not work on the client
side OR the server side, BUT the error messages show the appropriate message
resources numbers and words (for the arg0 field name, for example).  Here is
"rule B":









My message resources file works properly (tested thoroughly) with:
testingForm.name=Name
testingForm.name.min=7
testingForm.name.max=20

At: /WEB-INF/classes/resources/Application.properties
In struts-config.xml as:


Here is the lower level stuff showing the problem.  With "rule A", our
Validation methods set maxlength, minlength, etc. properties as expected in
the JavaScript such as:

function ValidationForm_required () {
 this.a0 = new Array("name", "Name is required.", new Function
("varName", "this.maxlength='20'; this.minlength='7';  return
this[varName];"));
}

function ValidationForm_minlength () {
 this.a0 = new Array("name", "Name can not be less than 7 characters.",
new Function ("varName", "this.maxlength='20'; this.minlength='7';  return
this[varName];"));
}

function ValidationForm_maxlength () {
 this.a0 = new Array("name", "Name can not be greater than 20
characters.", new Function ("varName", "this.maxlength='20';
this.minlength='7';  return this[varName];"));
}

And in the server-side Java Field object:

Field:
key = name
property = name
indexedProperty = null
indexedListProperty = null
depends = required, minlength, maxlength
page = 0
fieldOrder = 0
Vars:
maxlength=Var: name=maxlength  value=20  jsType=null

minlength=Var: name=minlength  value=7  jsType=null

However, set the resource="true" as in "rule B", and you are missing that
information on both the client side and the server side:

 function ValidationForm_required () {
 this.a0 = new Array("name", "Name is required.", new Function
("varName", " return this[varName];"));
}

function ValidationForm_minlength () {
 this.a0 = new Array("name", "Name can not be less than 7 characters.",
new Function ("varName", " return this[varName];"));
}

function ValidationForm_maxlength () {
 this.a0 = new Array("name", "Name can not be greater than 20
characters.", new Function ("varName", " return this[varName];"));
}

And for the server-side your Field object ALSO lacks the variables:

Field:
key = name
property = name
indexedProperty = null
indexedListProperty = null
depends = required, minlength, maxlength
page = 0
fieldOrder = 0
Vars:

End result, "rule A" works on both sides while "rule B" fails on both sides
but does correctly populate the error fields with the message parameters.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Additionally, I don't like the redundancy.  Using the above illustrations,
this.a0 is set in EVERY method.  Can't we consolidate this so it is setup
once something like the below and have that put into the main
"validateWhateverForm(form)" method after checking that bCancel is false and
before the validation checks?

this.a0 = new Array("name", new Function ("varName", "this.maxlength='20';
this.minlength='7';  this.error.minlength='Name can not be less than 7
characters.'; this.error.maxlength='Name can not be greater than 20
characters.';return this[varName];"));

The 2 differences being:

a) All errors are in one place under this.error.VALIDATIONTYPE such as
this.error.minlength, this.error.maxlength, this.error.required,
this.error.intRange, etc. instead of being Array index 1 (if starting from a
zero array index position)

b) Initialization for each object is in one place.  Since the JavaScript
appears to look for an object matching the first name of the Array anyway,
wouldn't this be cleaner and less redundant?

Should I post the top part and/or the bottom part to Buzilla?  Which one?
Commons or Struts?  Opinions are requested on this one plus a few more
people to triple check this by performing their own simp

RE: nested tiles

2004-12-01 Thread David G. Friedman
Bill,

That was very nice of you.  I'll have to add a complementary post about
using html tags with the name="SomeBeanInAScopeName" to access various beans
inside the various tiles.  I posted about how to do that just this week.

Regards,
David

-Original Message-
From: Bill Keese [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 02, 2004 12:43 AM
To: Struts Users Mailing List
Subject: Re: nested tiles


FYI, I went ahead and added a wiki page for this.  Apparently this is
the first wiki page on general tile use (?)

http://wiki.apache.org/struts/StrutsDocTiles

(if you see any mistakes please correct them.  or if anyone has any
other tips on tiles please add them.)

Bill

>

-
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: request between actions

2004-12-01 Thread Bill Keese
>I have an action that forwards to another action, and i'm loosing 
request parameters.

If you need to pass parameters to the 2nd action (either the same 
parameters or different ones), AND you need to forward using 
redirect="true" (because you want the URL displayed in the browser URL 
bar to be changed),  then you should try using MyActionForward 
(http://wiki.apache.org/struts/ForwardingWithDifferentParameter). 

Bill
 

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


Re: nested tiles

2004-12-01 Thread Bill Keese
FYI, I went ahead and added a wiki page for this.  Apparently this is 
the first wiki page on general tile use (?)

http://wiki.apache.org/struts/StrutsDocTiles
(if you see any mistakes please correct them.  or if anyone has any 
other tips on tiles please add them.)

Bill

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


RE: problem with required validation

2004-12-01 Thread David G. Friedman
Rajesh,

What version of Struts or commons validator are you using?  I'm on Struts
1.2.4 (it has the Commons Validator 1.1.3) and both the JavaScript AND the
server-side Java class trim off leading and trailing  white space characters
for the "required" validation.  Yes, I read the code in both places tonight
because I'm researching something on my own with the validation framework.
Lucky me I'm reading the code you're asking about.  :)

Regards,
David

-Original Message-
From: Rajesh [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 11:25 PM
To: 'Struts Users Mailing List'
Subject: problem with required validation


Hai all

in validation of required field

when user gives just a spaces it considereds it as charectors

i want to stop this that even if user types blank speces i need to specify
that he must type letters of numbers i dont want to use mask here

Regards,

Rajmahendra R. Hegde
GK Bharani Software Pvt. Ltd.

There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies.
-- C.A.R. Hoare



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



problem with required validation

2004-12-01 Thread Rajesh
Hai all
 
in validation of required field 
 
when user gives just a spaces it considereds it as charectors
 
i want to stop this that even if user types blank speces i need to specify
that he must type letters of numbers i dont want to use mask here
 
Regards,
 
Rajmahendra R. Hegde
GK Bharani Software Pvt. Ltd.
 
There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies. 
-- C.A.R. Hoare
 


problem with required validation

2004-12-01 Thread Rajesh
Hai all
 
in validation of required field 
 
when user gives just a spaces it considereds it as charectors
 
i want to stop this that even if user types blank speces i need to specify
that he must type letters of numbers i dont want to use mask here
 
Regards,
 
Rajmahendra R. Hegde
GK Bharani Software Pvt. Ltd.
 
There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies. 
-- C.A.R. Hoare
 


Re: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Niall Pemberton
You need to specify maxlength and minlength variables.

  




 minlength10


 maxlength20


Alternatively, if its an integer field you could use the intRange validator
instead

  




 min10


 max20



Niall

- Original Message - 
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 02, 2004 12:46 AM
Subject: RE: Problem with validation using both minlength and maxlength on
the same field


> Derek,
>
> I'm seeing the same thing you described.  I'm sorry I didn't believe you.
> Sadly, I'm having a HELL of a time figuring out what's wrong because I
> recently upgraded my development setup to Struts 1.2.4 and Tomcat 5.5.4
and
> haven't used validation in a while.  Trying the 1.1.4 validator binary
> didn't help any.  I'm feeling really stupid since used to be able to get
> this to work.  Too many variables have changed on me. *sigh*
>
> Regards,
> David
>
> -Original Message-
> From: Derek Broughton [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 1:18 PM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
>
> On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> > I'm trying to validate a simple field.  I want to validate that the
field
> > is an integer, and meets the min and max length requirements.  In the
same
> > application I am able to correctly validate a date field so I'm
confident
> > my overall struts setup is correct.  However when I try to do both a min
> > and max length check on the same field, the max length check doesn't
work.
> >  If I exceed the max length I get the min length message.  Below is a
> > snippet from my validation.xml file.  I've setup my properties file to
> > include the min and max length constants.
> >
> > validation.xml
> > ...
> > ...
> >   >property="myField"
> >depends="minlength, maxlength, integer">
> >
> >
> >
>
> Despite two other good looking answers, I'd have to say that it seems
> unlikely
> that these should _both_ be "arg1" :-)
> --
> derek
>
> -
> 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: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread David G. Friedman
Derek,

I'm seeing the same thing you described.  I'm sorry I didn't believe you.
Sadly, I'm having a HELL of a time figuring out what's wrong because I
recently upgraded my development setup to Struts 1.2.4 and Tomcat 5.5.4 and
haven't used validation in a while.  Trying the 1.1.4 validator binary
didn't help any.  I'm feeling really stupid since used to be able to get
this to work.  Too many variables have changed on me. *sigh*

Regards,
David

-Original Message-
From: Derek Broughton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 1:18 PM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> I'm trying to validate a simple field.  I want to validate that the field
> is an integer, and meets the min and max length requirements.  In the same
> application I am able to correctly validate a date field so I'm confident
> my overall struts setup is correct.  However when I try to do both a min
> and max length check on the same field, the max length check doesn't work.
>  If I exceed the max length I get the min length message.  Below is a
> snippet from my validation.xml file.  I've setup my properties file to
> include the min and max length constants.
>
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>
>

Despite two other good looking answers, I'd have to say that it seems
unlikely
that these should _both_ be "arg1" :-)
--
derek

-
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: doc URL/struts hosts

2004-12-01 Thread Kevin Burke
D. Stimits wrote:
I'm looking at:
http://struts.apache.org/faqs/kickstart.html
On this it mentions a URL for struts hosting:
http://struts.sourceforge.net/commnity/index.html
Unfortunately that doesn't exist. I'm wondering if there is an updated 
list of various hosting services that make struts available.

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

.
Maybe this page:
http://struts.sourceforge.net/community/hosts.html
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


doc URL/struts hosts

2004-12-01 Thread D. Stimits
I'm looking at:
http://struts.apache.org/faqs/kickstart.html
On this it mentions a URL for struts hosting:
http://struts.sourceforge.net/commnity/index.html
Unfortunately that doesn't exist. I'm wondering if there is an updated 
list of various hosting services that make struts available.

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


RE: Adding rows (beans) to dynamic form

2004-12-01 Thread Jim Barrows
> -Original Message-
> From: Daffin, Miles (Company IT) 
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 2:27 PM
> To: Struts Users Mailing List
> Subject: Adding rows (beans) to dynamic form
> 
> 
> Hi All,
>  
> I apologise in advance for this question - but I have 
> searched/tried all
> day without nailing a solution.
>  
> I am using DynaValidatorActionForm. One of the fields is a list of
> qualifications. Each qualification has three fields (I have 
> implemented
> this as a simple custom bean).
>  
> I want the user to be able to add qualifications to the list
> dynamically. Initially there will be a table with three text 
> inputs. If
> the user presses a 'Save' button on the same row as the 
> inputs the form
> will be submitted and reloaded. The user will then see a row for the
> data they just added (with a delete button), followed by the row of
> three empty inputs as before. The user can then go on adding
> qualifications to the list before finally submitting the whole form
> (different dispatch).






rinse, repeat



blah
Then the action you submit to takes the input params, folds, spindles and 
mutilates as appropriate, eventually adding it to the list in the session.
The save action, grabs this list from the session and then folds, spindles and 
mutilates the list as appropriate.



>  
> I have done this before without struts (a hideous combination of
> javascript and jsp scriptlets). Can anyone point me a example 
> of how to
> do this kind of thing cleanly with tags/struts? I feel I may be
> overcomplicating things.
>  
> Many thanks.
>  
> -Miles
>  
> Miles Daffin
> Morgan Stanley
> 20 Cabot Square | Canary Wharf | London E14 4QA | UK
> Tel: +44 (0) 20 767 75119
> [EMAIL PROTECTED] 
 

 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited. 
 

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



Re: nested tiles

2004-12-01 Thread Stefan Clos
Yes it works.
Here is my working configuration.
Thank you very much.
tiles-def.xml:
---
   
   
   
   
   

   
   
   
layout.jsp
--
   
 

 
   

Bill Keese schrieb:
Yeah, I also wish there was more documentation on this.
I think I found the flaw in your original design.  In layout.jsp you 
want to take the "body" attribute defined in tiles-def.xml and pass it 
on to bodyFrame.jsp as "bodypage".  So you need to use beanName, right?

tiles-def.xml:
---
  
  
  
  

layout.jsp
--
  
 
  

bodyFrame.jsp

  
Does that work for you?
Stefan Clos wrote:
thanks Bill,
your way to make nested tiles works fine. (After i changed "extends" 
to "template" in the second definition).

It has the advantage that the jsp´s are smaller and easier to 
understand, but at the cost you
need 2 definitions for each page. If you are only use one BodyFrame, 
you need a little more code i think.

I hope there are coming a better documentation about nested tiles 
with some best practics in future.

Stefan
Bill Keese schrieb:
Interesting.  I'm not sure why your code doesn't work.  Maybe the 
value attribute in  should 
be /WEB-INF/pgs/startpage.jsp.

Anyway, I haven't done nested tiles in the same way as you do.  This 
is how I do nested tiles.  Maybe someone can comment on which way is 
better.

  
  
  
  
  

  
  
  
  

   
  
  
  
Bill
Stefan Clos wrote:
hi,
i have a problem with nested tiles. I found not much about it in 
the struts doc.
the problem is that it not displays the correct body page.I get a 
directory listing there.
At the definition startpage i have the value "/startpage.jsp"
This should be displayed at my page. But it doesn´t  :(

I am using Struts 1.2 with Tomcat 5.
Thank you all very much for your answers, a link to helpful 
documentation in the internet,
is also welcome.

Stefan Clos
tiles-def.xml:
---
   
   
   
   
   

   
  <--- put the 
page here
   

layout.jsp
--
   <%-- Header incl.  --%>
   
   <%-- complete navigation --%>
   
   <%-- Rest of the Page (everything after the navigation) --%>
   
 
< put it here
   

bodyFrame.jsp

   
   
   Community
   
   
 <- should 
be at this point, but tomcat show me a directory listing there, 
funny but not what i want
   
   


---



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


Adding rows (beans) to dynamic form

2004-12-01 Thread Daffin, Miles (Company IT)
Hi All,
 
I apologise in advance for this question - but I have searched/tried all
day without nailing a solution.
 
I am using DynaValidatorActionForm. One of the fields is a list of
qualifications. Each qualification has three fields (I have implemented
this as a simple custom bean).
 
I want the user to be able to add qualifications to the list
dynamically. Initially there will be a table with three text inputs. If
the user presses a 'Save' button on the same row as the inputs the form
will be submitted and reloaded. The user will then see a row for the
data they just added (with a delete button), followed by the row of
three empty inputs as before. The user can then go on adding
qualifications to the list before finally submitting the whole form
(different dispatch).
 
I have done this before without struts (a hideous combination of
javascript and jsp scriptlets). Can anyone point me a example of how to
do this kind of thing cleanly with tags/struts? I feel I may be
overcomplicating things.
 
Many thanks.
 
-Miles
 
Miles Daffin
Morgan Stanley
20 Cabot Square | Canary Wharf | London E14 4QA | UK
Tel: +44 (0) 20 767 75119
[EMAIL PROTECTED]  

 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited. 
 


RE: Checking radio button based on object value

2004-12-01 Thread Jim Barrows


> -Original Message-
> From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 12:11 PM
> To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> Subject: RE: Checking radio button based on object value
> 
> 
> Ok sounds like this could solve my problem. How do I get the 
> object from the
> session and populate the form? My ActionForm does not have the
> HttpServletRequest visible to it as it is created with a no parameter
> constructor.

Simple... in the action that forwards to the jsp you do have an action 
forwarding to the jsp right? :)
Something like
if( object in session) {
copy object to form;
}
forward to jsp

> 
> public OptionsForm()
> {
> }
> 
> My question now is how/where can I call
> 
> Options options = 
> (Options)request.getSession().getAttribute("userOptions");
> 
> From within my ActionForm class
> 
> Thanks
> 
> -Original Message-
> From: Lee Harrington [mailto:[EMAIL PROTECTED] 
> Sent: 01 December 2004 18:58
> To: Struts Users Mailing List
> Subject: Re: Checking radio button based on object value
> 
> I'll describe the scenario where you are using a database.
> 
> In the action that is displaying "existing values" (ones in 
> the database)
>   1.  Retrieve record from database
>   2.  Populate form bean with values from database
>   3.  Forward to the jsp
> 
> If you are not getting your values from the database, but rather from
> a session variable -- then replace step 2 with "populate form bean
> with values from session object"
> 
> Lee
> 
> 
> On Wed, 1 Dec 2004 18:50:20 -, Ciaran Hanley
> <[EMAIL PROTECTED]> wrote:
> > optionOne, optionTwo are two groups consisting of two buttons each.
> > Basically each is an on and off switch, "true" or "false".
> > 
> > I can set the default values in my form bean ok, I set them 
> all to false
> > initially.
> > 
> > The problem is once updated options have been submitted and 
> saved in the
> > session I need to reproduce the users choices the next time 
> they visit the
> > same JSP.
> > 
> > So the next time into the JSP "true" and "false" values 
> should be checked
> to
> > reflect the users options. I am trying to figure out how to do this
> > 
> > CH
> > 
> > -Original Message-
> > From: t t [mailto:[EMAIL PROTECTED]
> > Sent: 01 December 2004 18:39
> > To: Struts Users Mailing List
> > Subject: Re: Checking radio button based on object value
> > 
> > Not sure if your optionOne and optionTwo is two groups of 
> radio button or
> > two radio button in one group. I give you an example to 
> illustrate how to
> > set default values:
> > 
> > Suppose I have a group (group1) of radio buttons, say 3. I want to
> preselect
> > the first one.
> > In my JSP file. I do this:
> > 
> > 
> > 
> > 
> > 
> > In the form bean file, I will have a property called 
> "group1", and default
> > value is "rb1"
> > private String group1="rb1";
> > 
> > Hope this helps.
> > 
> > Tong
> > 
> > 
> > Ciaran Hanley <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > I have a form consisting of several radio buttons. Upon 
> form generation I
> > need radio buttons in the form to be checked based on the 
> attribute of a
> > bean stored in the session. If the beans property is true then a
> particular
> > radio button value of "true" should be checked.
> > 
> > Option One
> > 
> > 
> > Option Two
> > 
> > 
> > I want these preselected based on a bean which has 
> variables corresponding
> > to each radio button
> > 
> > boolean optionOne = false;
> > 
> > boolean optionTwo = true;
> > 
> > How can I achieve this?
> > 
> > Thanks,
> > 
> > CH
> > 
> > 
> > -
> > Do you Yahoo!?
> >  Meet the all-new My Yahoo! - Try it today!
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Derek Broughton
On Wednesday 01 December 2004 14:28, David G. Friedman wrote:

> P.S. Question for the Day: Why do so many questions lately seem to be
> clearly answered in the UserGuides yet always asked?

Because very little is _clearly_ answered in the UserGuides, particularly that 
question.  In hindsight, he was trying to do something that is probably 
illegal, but it's a matter of "what isn't specifically allowed is 
disallowed". I had the impression it was possible to do what he was doing 
too.  In further hindsight, I see Jim actually said what I meant (I seem to 
have omitted a "not"), anyway...

> -Original Message-
> From: Derek Broughton [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 1:18 PM
> To: Struts Users Mailing List
> Subject: Re: Problem with validation using both minlength and maxlength
> on the same field
>
> On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> > I'm trying to validate a simple field.  I want to validate that the field
> > is an integer, and meets the min and max length requirements.  In the
> > same application I am able to correctly validate a date field so I'm
> > confident my overall struts setup is correct.  However when I try to do
> > both a min and max length check on the same field, the max length check
> > doesn't work. If I exceed the max length I get the min length message. 
> > Below is a snippet from my validation.xml file.  I've setup my properties
> > file to include the min and max length constants.
> >
> > validation.xml
> > ...
> > ...
> >   >property="myField"
> >depends="minlength, maxlength, integer">
> >
> >
> >

-- 
derek

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



RE: Checking radio button based on object value

2004-12-01 Thread t t
To my opinion, using "true" and "false" as radio buttons' value is not a good 
idea. Try to do that as shown in my example. If your form bean's scope 
is"session", there should be no problem. it will reproduce what the user 
selected.
tong

Ciaran Hanley <[EMAIL PROTECTED]> wrote:
optionOne, optionTwo are two groups consisting of two buttons each.
Basically each is an on and off switch, "true" or "false".

I can set the default values in my form bean ok, I set them all to false
initially. 

The problem is once updated options have been submitted and saved in the
session I need to reproduce the users choices the next time they visit the
same JSP.

So the next time into the JSP "true" and "false" values should be checked to
reflect the users options. I am trying to figure out how to do this

CH

-Original Message-
From: t t [mailto:[EMAIL PROTECTED] 
Sent: 01 December 2004 18:39
To: Struts Users Mailing List
Subject: Re: Checking radio button based on object value

Not sure if your optionOne and optionTwo is two groups of radio button or
two radio button in one group. I give you an example to illustrate how to
set default values:

Suppose I have a group (group1) of radio buttons, say 3. I want to preselect
the first one.
In my JSP file. I do this:





In the form bean file, I will have a property called "group1", and default
value is "rb1"
private String group1="rb1";

Hope this helps.

Tong


Ciaran Hanley wrote:
Hi,



I have a form consisting of several radio buttons. Upon form generation I
need radio buttons in the form to be checked based on the attribute of a
bean stored in the session. If the beans property is true then a particular
radio button value of "true" should be checked.



Option One







Option Two







I want these preselected based on a bean which has variables corresponding
to each radio button



boolean optionOne = false;

boolean optionTwo = true;





How can I achieve this?

Thanks,

CH



-
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today! 



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



-
Do you Yahoo!?
 All your favorites on one personal page – Try My Yahoo!

RE: Checking radio button based on object value

2004-12-01 Thread Ciaran Hanley
Ok sounds like this could solve my problem. How do I get the object from the
session and populate the form? My ActionForm does not have the
HttpServletRequest visible to it as it is created with a no parameter
constructor.

public OptionsForm()
{
}

My question now is how/where can I call

Options options = (Options)request.getSession().getAttribute("userOptions");

>From within my ActionForm class

Thanks

-Original Message-
From: Lee Harrington [mailto:[EMAIL PROTECTED] 
Sent: 01 December 2004 18:58
To: Struts Users Mailing List
Subject: Re: Checking radio button based on object value

I'll describe the scenario where you are using a database.

In the action that is displaying "existing values" (ones in the database)
  1.  Retrieve record from database
  2.  Populate form bean with values from database
  3.  Forward to the jsp

If you are not getting your values from the database, but rather from
a session variable -- then replace step 2 with "populate form bean
with values from session object"

Lee


On Wed, 1 Dec 2004 18:50:20 -, Ciaran Hanley
<[EMAIL PROTECTED]> wrote:
> optionOne, optionTwo are two groups consisting of two buttons each.
> Basically each is an on and off switch, "true" or "false".
> 
> I can set the default values in my form bean ok, I set them all to false
> initially.
> 
> The problem is once updated options have been submitted and saved in the
> session I need to reproduce the users choices the next time they visit the
> same JSP.
> 
> So the next time into the JSP "true" and "false" values should be checked
to
> reflect the users options. I am trying to figure out how to do this
> 
> CH
> 
> -Original Message-
> From: t t [mailto:[EMAIL PROTECTED]
> Sent: 01 December 2004 18:39
> To: Struts Users Mailing List
> Subject: Re: Checking radio button based on object value
> 
> Not sure if your optionOne and optionTwo is two groups of radio button or
> two radio button in one group. I give you an example to illustrate how to
> set default values:
> 
> Suppose I have a group (group1) of radio buttons, say 3. I want to
preselect
> the first one.
> In my JSP file. I do this:
> 
> 
> 
> 
> 
> In the form bean file, I will have a property called "group1", and default
> value is "rb1"
> private String group1="rb1";
> 
> Hope this helps.
> 
> Tong
> 
> 
> Ciaran Hanley <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a form consisting of several radio buttons. Upon form generation I
> need radio buttons in the form to be checked based on the attribute of a
> bean stored in the session. If the beans property is true then a
particular
> radio button value of "true" should be checked.
> 
> Option One
> 
> 
> Option Two
> 
> 
> I want these preselected based on a bean which has variables corresponding
> to each radio button
> 
> boolean optionOne = false;
> 
> boolean optionTwo = true;
> 
> How can I achieve this?
> 
> Thanks,
> 
> CH
> 
> 
> -
> Do you Yahoo!?
>  Meet the all-new My Yahoo! - Try it today!
> 
> -
> 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: Checking radio button based on object value

2004-12-01 Thread Lee Harrington
I'll describe the scenario where you are using a database.

In the action that is displaying "existing values" (ones in the database)
  1.  Retrieve record from database
  2.  Populate form bean with values from database
  3.  Forward to the jsp

If you are not getting your values from the database, but rather from
a session variable -- then replace step 2 with "populate form bean
with values from session object"

Lee


On Wed, 1 Dec 2004 18:50:20 -, Ciaran Hanley
<[EMAIL PROTECTED]> wrote:
> optionOne, optionTwo are two groups consisting of two buttons each.
> Basically each is an on and off switch, "true" or "false".
> 
> I can set the default values in my form bean ok, I set them all to false
> initially.
> 
> The problem is once updated options have been submitted and saved in the
> session I need to reproduce the users choices the next time they visit the
> same JSP.
> 
> So the next time into the JSP "true" and "false" values should be checked to
> reflect the users options. I am trying to figure out how to do this
> 
> CH
> 
> -Original Message-
> From: t t [mailto:[EMAIL PROTECTED]
> Sent: 01 December 2004 18:39
> To: Struts Users Mailing List
> Subject: Re: Checking radio button based on object value
> 
> Not sure if your optionOne and optionTwo is two groups of radio button or
> two radio button in one group. I give you an example to illustrate how to
> set default values:
> 
> Suppose I have a group (group1) of radio buttons, say 3. I want to preselect
> the first one.
> In my JSP file. I do this:
> 
> 
> 
> 
> 
> In the form bean file, I will have a property called "group1", and default
> value is "rb1"
> private String group1="rb1";
> 
> Hope this helps.
> 
> Tong
> 
> 
> Ciaran Hanley <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a form consisting of several radio buttons. Upon form generation I
> need radio buttons in the form to be checked based on the attribute of a
> bean stored in the session. If the beans property is true then a particular
> radio button value of "true" should be checked.
> 
> Option One
> 
> 
> Option Two
> 
> 
> I want these preselected based on a bean which has variables corresponding
> to each radio button
> 
> boolean optionOne = false;
> 
> boolean optionTwo = true;
> 
> How can I achieve this?
> 
> Thanks,
> 
> CH
> 
> 
> -
> Do you Yahoo!?
>  Meet the all-new My Yahoo! - Try it today!
> 
> -
> 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: Hibernate for data caching

2004-12-01 Thread David G. Friedman
I've dabbled with ehCache, using default settings, for caching query results, 
not for individual items.  I've had no trouble with cached queries.

Regards,
David 

-Original Message-
From: Sudip Shrestha [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 1:51 PM
To: Struts Users Mailing List
Subject: Re: Hibernate for data caching


Ashish:
Try: ehCache
There are others too...check Hibernate doc site.
http://www.hibernate.org/158.html
http://ehcache.sourceforge.net/


On Wed, 1 Dec 2004 09:40:59 -0800 (PST), Ashish Kulkarni
<[EMAIL PROTECTED]> wrote:
> Hi
> Has anyone used Hibernation for data caching, i have a
> table in DB2 on AS400 which has about 1 records i
> want to cache this data in my web application so can
> improve performance
> 
> Ashish
> 
> __
> Do you Yahoo!?
> All your favorites on one personal page â Try My Yahoo!
> http://my.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Thanx,
Sudip Shrestha
Bellevue, NE 68005

-
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: Hibernate for data caching

2004-12-01 Thread Sudip Shrestha
Ashish:
Try: ehCache
There are others too...check Hibernate doc site.
http://www.hibernate.org/158.html
http://ehcache.sourceforge.net/


On Wed, 1 Dec 2004 09:40:59 -0800 (PST), Ashish Kulkarni
<[EMAIL PROTECTED]> wrote:
> Hi
> Has anyone used Hibernation for data caching, i have a
> table in DB2 on AS400 which has about 1 records i
> want to cache this data in my web application so can
> improve performance
> 
> Ashish
> 
> __
> Do you Yahoo!?
> All your favorites on one personal page â Try My Yahoo!
> http://my.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Thanx,
Sudip Shrestha
Bellevue, NE 68005

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



RE: Checking radio button based on object value

2004-12-01 Thread Ciaran Hanley
optionOne, optionTwo are two groups consisting of two buttons each.
Basically each is an on and off switch, "true" or "false".

I can set the default values in my form bean ok, I set them all to false
initially. 

The problem is once updated options have been submitted and saved in the
session I need to reproduce the users choices the next time they visit the
same JSP.

So the next time into the JSP "true" and "false" values should be checked to
reflect the users options. I am trying to figure out how to do this

CH

-Original Message-
From: t t [mailto:[EMAIL PROTECTED] 
Sent: 01 December 2004 18:39
To: Struts Users Mailing List
Subject: Re: Checking radio button based on object value

Not sure if your optionOne and optionTwo is two groups of radio button or
two radio button in one group. I give you an example to illustrate how to
set default values:
 
Suppose I have a group (group1) of radio buttons, say 3. I want to preselect
the first one.
In my JSP file. I do this:
 



 
In the form bean file, I will have a property called "group1", and default
value is "rb1"
private String group1="rb1";
 
Hope this helps.
 
Tong


Ciaran Hanley <[EMAIL PROTECTED]> wrote:
Hi,



I have a form consisting of several radio buttons. Upon form generation I
need radio buttons in the form to be checked based on the attribute of a
bean stored in the session. If the beans property is true then a particular
radio button value of "true" should be checked.



Option One







Option Two







I want these preselected based on a bean which has variables corresponding
to each radio button



boolean optionOne = false;

boolean optionTwo = true;





How can I achieve this?

Thanks,

CH



-
Do you Yahoo!?
 Meet the all-new My Yahoo! - Try it today! 



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



Re: Checking radio button based on object value

2004-12-01 Thread Lee Harrington
If you have 

and "fromBean" has properties "optionOne/optionTwo" -- then they
should automatically be valued at whatever the bean properties are.

Lee


On Wed, 1 Dec 2004 18:19:09 -, Ciaran Hanley
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a form consisting of several radio buttons. Upon form generation I
> need radio buttons in the form to be checked based on the attribute of a
> bean stored in the session. If the beans property is true then a particular
> radio button value of "true" should be checked.
> 
> Option One
> 
> 
> 
> 
> 
> Option Two
> 
> 
> 
> 
> 
> I want these preselected based on a bean which has variables corresponding
> to each radio button
> 
> boolean optionOne = false;
> 
> boolean optionTwo = true;
> 
> How can I achieve this?
> 
> Thanks,
> 
> CH
> 
>

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



Re: Checking radio button based on object value

2004-12-01 Thread t t
Not sure if your optionOne and optionTwo is two groups of radio button or two 
radio button in one group. I give you an example to illustrate how to set 
default values:
 
Suppose I have a group (group1) of radio buttons, say 3. I want to preselect 
the first one.
In my JSP file. I do this:
 



 
In the form bean file, I will have a property called "group1", and default 
value is "rb1"
private String group1="rb1";
 
Hope this helps.
 
Tong


Ciaran Hanley <[EMAIL PROTECTED]> wrote:
Hi,



I have a form consisting of several radio buttons. Upon form generation I
need radio buttons in the form to be checked based on the attribute of a
bean stored in the session. If the beans property is true then a particular
radio button value of "true" should be checked.



Option One







Option Two







I want these preselected based on a bean which has variables corresponding
to each radio button



boolean optionOne = false;

boolean optionTwo = true;





How can I achieve this?

Thanks,

CH



-
Do you Yahoo!?
 Meet the all-new My Yahoo! – Try it today! 

RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread David G. Friedman
Actually, they are both arg1 for their respective validators... See the
docs:
http://struts.apache.org/userGuide/dev_validator.html

minlength - validate input data isn't less than a specified minimum length.
Requires a minlength variable.




minlength3


maxlength - validate input data doesn't exceed a specified maximum length.
Requires a maxlength variable.




maxlength30


Regards,
David

P.S. Question for the Day: Why do so many questions lately seem to be
clearly answered in the UserGuides yet always asked?

-Original Message-
From: Derek Broughton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 1:18 PM
To: Struts Users Mailing List
Subject: Re: Problem with validation using both minlength and maxlength
on the same field


On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> I'm trying to validate a simple field.  I want to validate that the field
> is an integer, and meets the min and max length requirements.  In the same
> application I am able to correctly validate a date field so I'm confident
> my overall struts setup is correct.  However when I try to do both a min
> and max length check on the same field, the max length check doesn't work.
>  If I exceed the max length I get the min length message.  Below is a
> snippet from my validation.xml file.  I've setup my properties file to
> include the min and max length constants.
>
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>
>

Despite two other good looking answers, I'd have to say that it seems
unlikely
that these should _both_ be "arg1" :-)
--
derek

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



Checking radio button based on object value

2004-12-01 Thread Ciaran Hanley
Hi,

 

I have a form consisting of several radio buttons. Upon form generation I
need radio buttons in the form to be checked based on the attribute of a
bean stored in the session. If the beans property is true then a particular
radio button value of "true" should be checked.

 

Option One





 

Option Two





 

I want these preselected based on a bean which has variables corresponding
to each radio button

 

boolean optionOne = false;

boolean optionTwo = true;

 

 

How can I achieve this?

Thanks,

CH



Re: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Derek Broughton
On Wednesday 01 December 2004 13:49, [EMAIL PROTECTED] wrote:
> I'm trying to validate a simple field.  I want to validate that the field
> is an integer, and meets the min and max length requirements.  In the same
> application I am able to correctly validate a date field so I'm confident
> my overall struts setup is correct.  However when I try to do both a min
> and max length check on the same field, the max length check doesn't work.
>  If I exceed the max length I get the min length message.  Below is a
> snippet from my validation.xml file.  I've setup my properties file to
> include the min and max length constants.
>
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>
>

Despite two other good looking answers, I'd have to say that it seems unlikely 
that these should _both_ be "arg1" :-)
-- 
derek

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



RE: Where to store and how to retrieve Images for web app

2004-12-01 Thread Woodchuck
hihi,

yea i also keep images on the fileserver.  it's nice and simple.  as
many others have said already, all that needs to go to the database is
any meta info about the image you require and any other info needed to
construct the image link for display.

no need for any servlet image<-->blob business.  when you need to
deploy or redeploy, just zip up the the images folder or just war the
whole thing and away you go.  can't get simpler than that.

i have also found websphere to be slower than tomcat.  it's not as
zippity as tomcat.  i'm willing to bet that it's because websphere has
a lot of @[EMAIL PROTECTED]@$&@% code in it.

woodchuck


--- Jim Barrows <[EMAIL PROTECTED]> wrote:

> 
> 
> > -Original Message-
> > From: Brady Hegberg [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, December 01, 2004 10:40 AM
> > To: Struts Users Mailing List
> > Subject: RE: Where to store and how to retrieve Images for web app
> > 
> 
> 
> > 
> > Does anyone know if there are advantages in particular app-servers
> to
> > keeping your graphics on the filesystem versus in the database?
> 
> Well...let's see... local to server file system, no data xfer across
> network. Store image in DB and you have to pull image across net,
> then shove it out to user.
> 
> Depending on image size and network latency, the container won't make
> any difference at all to performance.  
> 
> If you're doing a lot of images, then you probably want to put Apache
> in front.  I have told apache to redirect certain requests to the
> images directory, while letting my web app write their.  Beats ths
> stuffin out of writing a pass through servlet.  If apache and
> app-server can't reside on same box, share drives or use something
> like rsync to keep both boxes up to date.
> 
> As for app-server speed... I've found Websphere to be somewhat slower
> the Tomcat then again.. it could be the @[EMAIL PROTECTED]@$&@% legacy 
> code
> I'm dealing with too.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




__ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

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



RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Ram Venkataswamy
This is do with argument number - change errors.maxlength={0} can not be
greater than {1} characters. 

To 

errors.maxlength={0} can not be greater than {2} characters.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 9:49 AM
To: [EMAIL PROTECTED]
Subject: Problem with validation using both minlength and maxlength on
the same field

I'm trying to validate a simple field.  I want to validate that the
field 
is an integer, and meets the min and max length requirements.  In the
same 
application I am able to correctly validate a date field so I'm
confident 
my overall struts setup is correct.  However when I try to do both a min

and max length check on the same field, the max length check doesn't
work. 
 If I exceed the max length I get the min length message.  Below is a 
snippet from my validation.xml file.  I've setup my properties file to 
include the min and max length constants.

validation.xml
...
...
 
   
   
   
 
...
...

SampleApp.properties
...
...
   errors.required={0} is required.
   errors.minlength={0} can not be less than {1} characters.
   errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.

   errors.byte={0} must be a byte.
   errors.short={0} must be a short.
   errors.integer={0} must be an integer.
   errors.long={0} must be a long.
   errors.float={0} must be a float.
   errors.double={0} must be a double.

   errors.date={0} is not a date.
   errors.range={0} is not in the range {1} through {2}.
   errors.creditcard={0} is an invalid credit card number.
   errors.email={0} is an invalid e-mail address.
...
...
   sampleApp.myField.label=My field:
   sampleApp.myField.minLen=5
   sampleApp.myField.maxLen=5



If I enter 8 charcters in myField and submit I get "My field: can not be

less than 5 characters."

Any ideas what's wrong?

Thanks,

James

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


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



RE: Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread Jim Barrows
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 10:49 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with validation using both minlength and maxlength on
> the same field
> 
> 
> validation.xml
> ...
> ...
>  property="myField"
>depends="minlength, maxlength, integer">
>
>

One of these is not correct.. arg1 for both, probably confusing 
Validator.

>


minlength3

maxlength30

>  

have you thought of intRange instead?  Probably closer to what you're 
looking for.  Error message would make more sense maybe.  Number must be fewer 
then X characters is odder then Number must be between X and XX.  Or maybe 
not...


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



RE: Where to store and how to retrieve Images for web app

2004-12-01 Thread Jim Barrows


> -Original Message-
> From: Brady Hegberg [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 01, 2004 10:40 AM
> To: Struts Users Mailing List
> Subject: RE: Where to store and how to retrieve Images for web app
> 


> 
> Does anyone know if there are advantages in particular app-servers to
> keeping your graphics on the filesystem versus in the database?

Well...let's see... local to server file system, no data xfer across network. 
Store image in DB and you have to pull image across net, then shove it out to 
user.

Depending on image size and network latency, the container won't make any 
difference at all to performance.  

If you're doing a lot of images, then you probably want to put Apache in front. 
 I have told apache to redirect certain requests to the images directory, while 
letting my web app write their.  Beats ths stuffin out of writing a pass 
through servlet.  If apache and app-server can't reside on same box, share 
drives or use something like rsync to keep both boxes up to date.

As for app-server speed... I've found Websphere to be somewhat slower the 
Tomcat then again.. it could be the @[EMAIL PROTECTED]@$&@% legacy code I'm 
dealing with too.

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



Problem with validation using both minlength and maxlength on the same field

2004-12-01 Thread jesnook
I'm trying to validate a simple field.  I want to validate that the field 
is an integer, and meets the min and max length requirements.  In the same 
application I am able to correctly validate a date field so I'm confident 
my overall struts setup is correct.  However when I try to do both a min 
and max length check on the same field, the max length check doesn't work. 
 If I exceed the max length I get the min length message.  Below is a 
snippet from my validation.xml file.  I've setup my properties file to 
include the min and max length constants.

validation.xml
...
...
 
   
   
   
 
...
...

SampleApp.properties
...
...
   errors.required={0} is required.
   errors.minlength={0} can not be less than {1} characters.
   errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.

   errors.byte={0} must be a byte.
   errors.short={0} must be a short.
   errors.integer={0} must be an integer.
   errors.long={0} must be a long.
   errors.float={0} must be a float.
   errors.double={0} must be a double.

   errors.date={0} is not a date.
   errors.range={0} is not in the range {1} through {2}.
   errors.creditcard={0} is an invalid credit card number.
   errors.email={0} is an invalid e-mail address.
...
...
   sampleApp.myField.label=My field:
   sampleApp.myField.minLen=5
   sampleApp.myField.maxLen=5



If I enter 8 charcters in myField and submit I get "My field: can not be 
less than 5 characters."

Any ideas what's wrong?

Thanks,

James

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



RE: Using a key as var-value in validator

2004-12-01 Thread Ram Venkataswamy
Hi,

If you have defined resource bundle in struts config & are able to
access key from jsp then no additional step/configuration is required to
access them in validation file. The arg/msg lookup resource bundle
defined for the application and then pick up value

FYI: 
 There is glitch though the resource key's specified in the "msg" tag as
well as the validator's "msg" attribute are found regardless of their
bundle. The field arg tag however does not behave the same way, even
when the bundle attribute is specified (it seems that the bundle
attribute is ignored).
 

-Original Message-
From: Kinjal Sonpal [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 3:07 AM
To: Struts User List
Subject: Using a key as var-value in validator

Dear all,

I'm using Struts 1.2.4 with Validator 1.1.3 for my application. I need
to access the Date Format stirng across the application at many
places.

Instead of hard-coding format string everywhere I would like to use a
key from the Resource Bundle for the purpose. I can access the key
from all of my Java, Jsp code, but how do I access it the
validation.xml file?

Please share your views on this.

Thanks and regards,
Kinjal Sonpal

"In the real world, the right thing never happens in the right place
at the right time. It is the task of journalists and historians to
rectify this error."
Mark Twain





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



Hibernate for data caching

2004-12-01 Thread Ashish Kulkarni
Hi
Has anyone used Hibernation for data caching, i have a
table in DB2 on AS400 which has about 1 records i
want to cache this data in my web application so can
improve performance

Ashish



__ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

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



RE: Where to store and how to retrieve Images for web app

2004-12-01 Thread Brady Hegberg
We've tried a couple different approaches.  One of them involves a
pass-through servlet that grabs the image from the filesystem and sends
it to the browser on request.  It works well, in some cases.  However it
seems to cause some problems with caching - reloading the page is slow
and causes the graphics to flicker.  I wonder if people have run into
the same problems with storing pictures in mySQL.

Another possibility that I've considered is to have a directory of
images on the filesystem and copy them into your app at deploy time.  As
images are uploaded they would be saved to the filesystem and then
copied to the app.

Does anyone know if there are advantages in particular app-servers to
keeping your graphics on the filesystem versus in the database?

Brady

> John,
> 
> I have also had this issue, and I can come at the problem from a different 
> angle.
> 
> I allow users to upload images, and they get persisted to the file system 
> under a directory in the Web App. A pointer to the image also gets placed in 
> mysql.
> 
> I will be migrating to storing the data in Mysql and at application startup 
> I will write the data out to the filesystem for my files that reference 
> them. My main reason for doing this is that in deployment I don't want any 
> environment specific content being overwritten, or even having to worry 
> about it. I know that I can safely clear out the Webapp directory and I know 
> that my database is backed up (And therefore so are the images).
> 
> As a second point I would be interested to know if anyone has any code 
> snippets to persist (Create and Read) the data to MySQl.
> 
> 
> Original Message Follows
> From: [EMAIL PROTECTED]
> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Subject: Where to store and how to retrieve Images for web app
> Date: Wed, 1 Dec 2004 09:23:05 -0500
> 
> 
> 
> 
> 
> My web app will have about 300 users, each of whom will be allowed to
> upload a max of 5 images/digital pictures.  I am using the Struts-upload
> package.  I considered storing the images in MySQL as blobs, but have read
> lots of advice that this is more trouble than it's worth / overkill.
> However, I am perplexed (I am a newbie) as to where I should store them on
> the file system and then how I would retrieve them and get them displayed
> in a browser.  What is a "best practice" for this?
> 
> It would be easy to store them in a subdirectory of the web app, which
> would allow me to include them in my JSPs with a simple HREF tag.  However,
> does this cause problems with the size of the web app, maybe the start-up
> and reload speeds of the container, etc.?  I trialed this by storing 1500
> images in myWebApp/Pictures, starting Tomcat and retrieving images with a
> HREF tag in a JSP.  I didn't notice any impact on startup time or
> performance, but I want to make sure I'm not missing some other problem...
> 
> If I store them in the filesystem outside of the web app directory
> structure, I can't just refer to them in my JSPs with an HREF tag, right?
> It would be more work to have an action servlet retrieve the image file and
> return it to the browser in the response object.  That seems to be just as
> much work as storing them in MySQL, so why not just use MySQL?   What are
> your opinions?
> 
> 
> 
> 
> -
> 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]
> 
-- 
Brady Hegberg <[EMAIL PROTECTED]>


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



Re: Where to store and how to retrieve Images for web app

2004-12-01 Thread fzlists
I have faced this situation on a number of ocassions.  Speaking as someone who 
has done it just about every which way, I offer this "best practice"...

I suggest storing them on the file system OUTSIDE the webapp directory.  I then 
suggest creating an action specifically for returning images.  All you need to 
do in your JSPs are have normal  tags, but the src is your action, i.e., 
something like:



The action itself to return the images is really pretty trivial... Open the 
file, read it in and send it along to the ServletOutputStream of your Response 
object, returning null as the ActionForward from the Action so as to not 
forward anywhere since the response is complete at that point.

I make this suggestion for a couple of reasons...

(1) Storing and retrieving from a database, which I've done, is a little bit 
more complicated, but not terribly so.  More importantly though, dealing with 
BLOBs will usually lead to RDBMS-specific code.  I try to avoid that whenever 
possible.  However, this approach is good if you have restrictions (as I did in 
one case) in a host environment where they don't want you writing to the local 
file system.  In any case, it's obviously more overhead per call.

(2) You don't want to store the file in the webapp directory, as another poster 
stated, because then you have to remember to replicate the files when you need 
to blow away the app and reinstall.  Why add that hassle?

(3) Doing it with an Action like this gives you a tad more control over how 
things work than just figuring out a way to let the web server in front of the 
app server (or the app server itself) serve the images.  You can pull that off 
of course, but the really pretty small amount of code involved gives you some 
added flexibility (i.e., you can send in some sort of encoded ID for the image 
and get a real filename out of that, if security is a big concern, etc.).

Hope that helps!

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

On Wed, December 1, 2004 9:23 am, [EMAIL PROTECTED] said:
> 
> 
> 
> 
> My web app will have about 300 users, each of whom will be allowed to
> upload a max of 5 images/digital pictures.  I am using the Struts-upload
> package.  I considered storing the images in MySQL as blobs, but have read
> lots of advice that this is more trouble than it's worth / overkill.
> However, I am perplexed (I am a newbie) as to where I should store them on
> the file system and then how I would retrieve them and get them displayed
> in a browser.  What is a "best practice" for this?
> 
> It would be easy to store them in a subdirectory of the web app, which
> would allow me to include them in my JSPs with a simple HREF tag. 
> However,
> does this cause problems with the size of the web app, maybe the start-up
> and reload speeds of the container, etc.?  I trialed this by storing 1500
> images in myWebApp/Pictures, starting Tomcat and retrieving images with a
> HREF tag in a JSP.  I didn't notice any impact on startup time or
> performance, but I want to make sure I'm not missing some other problem...
> 
> If I store them in the filesystem outside of the web app directory
> structure, I can't just refer to them in my JSPs with an HREF tag, right?
> It would be more work to have an action servlet retrieve the image file
> and
> return it to the browser in the response object.  That seems to be just as
> much work as storing them in MySQL, so why not just use MySQL?   What are
> your opinions?
> 
> 
> 
> 
> -
> 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: message-resources in struts-config.xml won't work!

2004-12-01 Thread Lane, Brad
Use  

-Original Message-
From: René Thol [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 9:15 AM
To: Struts Users Mailing List
Subject: message-resources in struts-config.xml won't work!

Hello again everybody,

I just changed my application from having its message resources defined in
web.xml via init parameter to defining it in struts-config.xml using


I left my JSPs unchanged using  tags.

But now the JSPs won't be compiled anymore. I'm always getting:

Cannot find message resources under key org.apache.struts.action.MESSAGE

Why?

I can't find anything that is declared against specification?

Can please smbd. help here?

Many thanks in advance
Best regards

--

René Thol

E-Mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


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



Re: Where to store and how to retrieve Images for web app

2004-12-01 Thread Joe Germuska
It would be easy to store them in a subdirectory of the web app, which
would allow me to include them in my JSPs with a simple HREF tag.  However,
does this cause problems with the size of the web app, maybe the start-up
and reload speeds of the container, etc.?  I trialed this by storing 1500
images in myWebApp/Pictures, starting Tomcat and retrieving images with a
HREF tag in a JSP.  I didn't notice any impact on startup time or
performance, but I want to make sure I'm not missing some other problem...
I would definitely advise against storing them in your webapp; my 
experience is that you sometimes want to be able to completely delete 
your webapp and replace it with a "fresh" build, which you can't do 
if you are writing data into the directory.

If I store them in the filesystem outside of the web app directory
structure, I can't just refer to them in my JSPs with an HREF tag, right?
It would be more work to have an action servlet retrieve the image file and
return it to the browser in the response object.
In our deployment environment, we have a web server receive all HTTP 
requests, and the webserver proxies application requests to a J2EE 
server.  This allows the web server to deal with all the more routine 
requests like delivering images, stylesheets, and javascript.  The 
app would write uploaded images to a directory which is visible to 
the webserver, so that the app wouldn't be involved in servicing 
requests for images.  (I think this is more or less what Colin 
described.)

Most importantly, I'd advise writing an "image manager" class which 
encapsulates all this logic, so that most of your application is 
insulated from any changes you might have later.  This image manager 
class could be configured with a "filesystem path", a "web url 
prefix" and other such data, and then your actions can simply give it 
uploaded images as bytes or streams and "trust" that they'll be 
handled correctly, and then ask it to give them the right path for 
retrieving the image via URL, whether that is a path which is 
ultimately served by a web server going to the filesystem or whether 
it's a path to a servlet or Struts action which copies the bytes 
(from a DB BLOB column, a non-web accessible filesystem path, or 
wherever).  If you have metadata like Colin described, then this 
class would probably also have the responsibility for long-term 
persistence of the metadata.

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


message-resources in struts-config.xml won't work!

2004-12-01 Thread René Thol
Hello again everybody,
I just changed my application from having its message resources defined 
in web.xml via init parameter to defining it in struts-config.xml
using 

I left my JSPs unchanged using  tags.
But now the JSPs won't be compiled anymore. I'm always getting:
Cannot find message resources under key org.apache.struts.action.MESSAGE
Why?
I can't find anything that is declared against specification?
Can please smbd. help here?
Many thanks in advance
Best regards
--

René Thol
E-Mail: [EMAIL PROTECTED]


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


RE: disable validation of validator.xml & validator-rules.xml (partially OT now)

2004-12-01 Thread Joe Germuska
At 2:51 PM + 12/1/04, Marco Mistroni wrote:
Hello,
Thanx for suggestion... however WAS Studio is giving me problems
When building my application
I have specified following as DTD reference

Two things: first, I don't think that your DTD public identifier is 
one which was ever actually registered.  Where did you get the value 
"-//Apache Software Foundation//DTD Commons Validator Rules
Configuration 1.1.3//EN" ?

From the Validator CVS repository, the newest DTD is this one:

 "-//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.1//EN"
 "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>

That public ID ("-//Apache Software Foundation//DTD Commons Validator 
Rules Configuration 1.1//EN") is linked in the Validator code to a 
copy of the DTD which is included in the commons-validator JAR.  If 
you use this public ID, you shouldn't ever need to be online, because 
the configuration process will read the DTD from the JAR.

On the other hand, if you do want to specify a local path to a DTD in 
a DOCTYPE declaration, you probably need to specify it as a 
fully-qualified "file:///" URL (which has its own portability 
problems).  I'm not sure that there's a determinate way to predict 
how different XML processors will resolve a relative URL.

Joe

and WAS Studio keeps on telling me that it cannot find the dtd on
filesystems..
anyone had similar problems?
Regards marco

-Original Message-
From: Derek Broughton [mailto:[EMAIL PROTECTED]
Sent: 01 December 2004 14:05
To: Struts Users Mailing List
Subject: Re: disable validation of validator.xml & validator-rules.xml
On Wednesday 01 December 2004 08:36, Joe Germuska wrote:
 Ultimately, this is the responsibility of the commons-validator
 library which Struts uses.  For each config file, a
 "ValidatorResources" object is constructed.  This object uses
 commons-digester to process the XML config.

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/share/or
g/a
pache/commons/validator/ValidatorResources.java?view=markup
 This object exposes no way to turn off validation, but it does make
 use of Digester's facility for registering DTDs against copies in the
 classpath.  If your file uses one of the DTDs listed in
 the"registrations" array in ValidatorResources (see source at above
 URL) then you won't have any problem.  From a brief glance, I wonder
 if some new registrations need to be added?  If you have time to
 check, perhaps you could file a bug against commons-validator at
 http://issues.apache.org/bugzilla
 For the near term, the suggestion of specifying an alternate local
 URL for the DTD is probably best.
I had the same problem last week, and the simplest solution is to make
sure
you have the latest commons-validator jar.  1.1.3 validates properly
against
the DTD in the jar file, rather than needing to go to the web.
(But thanks for the more detailed explanation of _why_ going to 1.1.3
worked
for me, Joe)
--
derek
-
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]

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Re: Where to store and how to retrieve Images for web app

2004-12-01 Thread Colin Kilburn
John,
I typically store the images in a web-accessible directory.   I have 
done this in several different webapps (in several languages for that 
matter).  I typically have a table that holds any data about the image, 
most importantly, how to contruct a url for an image tag so I can 
display it on a page.   My scheme is generally to store the image with a 
file name of ..My table generally looks something like:

images (id, alt_text, type/file extension [, image dimensions])
This generally contains all I need to be able to display, create, update 
or delete the image.

The only advantage I see to storing them in a BLOB is the database 
backup benefit that Mark mentioned.   In my case this has not outweighed 
the simplicity of letting a web server serve images from the filesystem, 
which it does very well.

Hope this helps,
Colin
[EMAIL PROTECTED] wrote:

My web app will have about 300 users, each of whom will be allowed to
upload a max of 5 images/digital pictures.  I am using the Struts-upload
package.  I considered storing the images in MySQL as blobs, but have read
lots of advice that this is more trouble than it's worth / overkill.
However, I am perplexed (I am a newbie) as to where I should store them on
the file system and then how I would retrieve them and get them displayed
in a browser.  What is a "best practice" for this?
It would be easy to store them in a subdirectory of the web app, which
would allow me to include them in my JSPs with a simple HREF tag.  However,
does this cause problems with the size of the web app, maybe the start-up
and reload speeds of the container, etc.?  I trialed this by storing 1500
images in myWebApp/Pictures, starting Tomcat and retrieving images with a
HREF tag in a JSP.  I didn't notice any impact on startup time or
performance, but I want to make sure I'm not missing some other problem...
If I store them in the filesystem outside of the web app directory
structure, I can't just refer to them in my JSPs with an HREF tag, right?
It would be more work to have an action servlet retrieve the image file and
return it to the browser in the response object.  That seems to be just as
much work as storing them in MySQL, so why not just use MySQL?   What are
your opinions?

-
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: Where to store and how to retrieve Images for web app

2004-12-01 Thread Guillaume Cottenceau
"Mark Benussi"  writes:

> As a second point I would be interested to know if anyone has any code
> snippets to persist (Create and Read) the data to MySQl.

In the application we use at my company, we put images in a
postgres database and we have a servlet which can reply with
image content when giving a proper id.

-- 
Guillaume Cottenceau

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



html:form with modules

2004-12-01 Thread Daniel Massie
Again this may be easily solved, but I can't find an answer elsewhere.

Using a module I go through an action to a JSP containg a form (using 
html:form). The action attribute of this form
is the same as an action defined in the module's struts config ie /Login, but 
when the page is accessed the full form action is the ${default context}/Login 
rather than ${default context}/${module}/Login. 

Any help much appreciated.

Thanks
Daniel

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



RE: disable validation of validator.xml & validator-rules.xml (partially OT now)

2004-12-01 Thread Marco Mistroni
Hello,
Thanx for suggestion... however WAS Studio is giving me problems
When building my application

I have specified following as DTD reference




and WAS Studio keeps on telling me that it cannot find the dtd on
filesystems..

anyone had similar problems?

Regards marco



-Original Message-
From: Derek Broughton [mailto:[EMAIL PROTECTED] 
Sent: 01 December 2004 14:05
To: Struts Users Mailing List
Subject: Re: disable validation of validator.xml & validator-rules.xml

On Wednesday 01 December 2004 08:36, Joe Germuska wrote:
> Ultimately, this is the responsibility of the commons-validator
> library which Struts uses.  For each config file, a
> "ValidatorResources" object is constructed.  This object uses
> commons-digester to process the XML config.
>
>
http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/share/or
g/a
>pache/commons/validator/ValidatorResources.java?view=markup
>
> This object exposes no way to turn off validation, but it does make
> use of Digester's facility for registering DTDs against copies in the
> classpath.  If your file uses one of the DTDs listed in
> the"registrations" array in ValidatorResources (see source at above
> URL) then you won't have any problem.  From a brief glance, I wonder
> if some new registrations need to be added?  If you have time to
> check, perhaps you could file a bug against commons-validator at
> http://issues.apache.org/bugzilla
>
> For the near term, the suggestion of specifying an alternate local
> URL for the DTD is probably best.

I had the same problem last week, and the simplest solution is to make
sure 
you have the latest commons-validator jar.  1.1.3 validates properly
against 
the DTD in the jar file, rather than needing to go to the web.

(But thanks for the more detailed explanation of _why_ going to 1.1.3
worked 
for me, Joe)
-- 
derek

-
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: view controller

2004-12-01 Thread Joe Germuska
Yes but only half. Regarding the first point, since struts is 
actually able to accept and deal with a second action mapping in 
that mapping's "input" (or "forward") param, then somehow struts 
must be designed for it. It can't possibly have been a happy 
coincidence, surely? I don't know about tests.
Not really; it's just a side effect.  Struts is merely calling 
requestDispatcher.forward(...)If Struts were designed for it, you 
wouldn't be including the ".do" in the value of input, in the same 
way in which you don't have to include it in the "action" attribute 
of an html:form tag.

To say that Struts isn't "tested" for it may be overplaying the kind 
of testing we have, but it is true that in general, action chaining 
is considered "unsupported."  As you'll see below, deeper changes 
underway in Struts should obsolete the need to chain using multiple 
calls to requestDispatcher.forward(...) (with repeated runs through 
the entire request processing cycle).  The whole request processing 
cycle is going to be much more open and flexible.

I appreciate your direction though. Do you envisage being in a 
position to completely disable chaining in struts? Let me describe 
the situation I had at my last project where it was useful (and 
justified IMHO):

The screens were complex and were not under my control. Each screen 
contained up to 3 completely seperate bits of functionality, e.g. 
hotel bank account number, hotel billing address and hotel billing 
options. These were handled by different session facade calls.

I had already experienced alot of scope creep and I knew that these 
would change, and in fact I was pushing to get control of the screen 
designs, in which case I would simply have put the 3 different bits 
on different screens - so when coding the mappings, I made 3 
mappings and chained them together, so I could seperate out the 
Action classes and hopefully actually seperate out the page too in 
the future.

I didn't get the opportunity to seperate out the pages, but I was 
still happy that I could chain the mappings and have seperate Action 
classes.
I think that this is a good use case for the commons-chain library, 
and probably for the "ChainAction" that Craig recently wrote.  The 
ChainAction is meant as a way for users to delegate Action processing 
to a commons-chain command (which itself may be a chain of commands) 
in a way that would have allowed you to rearrange the "plumbing" just 
by editing config files.  Using these things right now is still a 
little cutting-edge, as there is still a lot of documentation to 
write, and probably some better support for multiple 
chain-configuration files...  we're hoping to push these things into 
the Struts core CVS as soon as commons-chain makes its 1.0 release 
(any day now).

Strictly speaking, this is all kind of tangential to a view 
controller, and in fact, if you were using ChainAction, you could 
slot in commands that each had any balance of responsibilities 
between "action processing" and "view preparation" that you liked. 
We might find ourselves looking for some good ways to standardize 
things like instantiation or location of the form bean which might 
need to be prepopulated for the destination view, which is one of the 
reasons I like the idea of formalizing view preparation.

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


RE: Where to store and how to retrieve Images for web app

2004-12-01 Thread Mark Benussi
John,
I have also had this issue, and I can come at the problem from a different 
angle.

I allow users to upload images, and they get persisted to the file system 
under a directory in the Web App. A pointer to the image also gets placed in 
mysql.

I will be migrating to storing the data in Mysql and at application startup 
I will write the data out to the filesystem for my files that reference 
them. My main reason for doing this is that in deployment I don't want any 
environment specific content being overwritten, or even having to worry 
about it. I know that I can safely clear out the Webapp directory and I know 
that my database is backed up (And therefore so are the images).

As a second point I would be interested to know if anyone has any code 
snippets to persist (Create and Read) the data to MySQl.

Original Message Follows
From: [EMAIL PROTECTED]
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Where to store and how to retrieve Images for web app
Date: Wed, 1 Dec 2004 09:23:05 -0500


My web app will have about 300 users, each of whom will be allowed to
upload a max of 5 images/digital pictures.  I am using the Struts-upload
package.  I considered storing the images in MySQL as blobs, but have read
lots of advice that this is more trouble than it's worth / overkill.
However, I am perplexed (I am a newbie) as to where I should store them on
the file system and then how I would retrieve them and get them displayed
in a browser.  What is a "best practice" for this?
It would be easy to store them in a subdirectory of the web app, which
would allow me to include them in my JSPs with a simple HREF tag.  However,
does this cause problems with the size of the web app, maybe the start-up
and reload speeds of the container, etc.?  I trialed this by storing 1500
images in myWebApp/Pictures, starting Tomcat and retrieving images with a
HREF tag in a JSP.  I didn't notice any impact on startup time or
performance, but I want to make sure I'm not missing some other problem...
If I store them in the filesystem outside of the web app directory
structure, I can't just refer to them in my JSPs with an HREF tag, right?
It would be more work to have an action servlet retrieve the image file and
return it to the browser in the response object.  That seems to be just as
much work as storing them in MySQL, so why not just use MySQL?   What are
your opinions?

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


Where to store and how to retrieve Images for web app

2004-12-01 Thread john . chesher




My web app will have about 300 users, each of whom will be allowed to
upload a max of 5 images/digital pictures.  I am using the Struts-upload
package.  I considered storing the images in MySQL as blobs, but have read
lots of advice that this is more trouble than it's worth / overkill.
However, I am perplexed (I am a newbie) as to where I should store them on
the file system and then how I would retrieve them and get them displayed
in a browser.  What is a "best practice" for this?

It would be easy to store them in a subdirectory of the web app, which
would allow me to include them in my JSPs with a simple HREF tag.  However,
does this cause problems with the size of the web app, maybe the start-up
and reload speeds of the container, etc.?  I trialed this by storing 1500
images in myWebApp/Pictures, starting Tomcat and retrieving images with a
HREF tag in a JSP.  I didn't notice any impact on startup time or
performance, but I want to make sure I'm not missing some other problem...

If I store them in the filesystem outside of the web app directory
structure, I can't just refer to them in my JSPs with an HREF tag, right?
It would be more work to have an action servlet retrieve the image file and
return it to the browser in the response object.  That seems to be just as
much work as storing them in MySQL, so why not just use MySQL?   What are
your opinions?




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



Re: disable validation of validator.xml & validator-rules.xml

2004-12-01 Thread Derek Broughton
On Wednesday 01 December 2004 08:36, Joe Germuska wrote:
> Ultimately, this is the responsibility of the commons-validator
> library which Struts uses.  For each config file, a
> "ValidatorResources" object is constructed.  This object uses
> commons-digester to process the XML config.
>
> http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/share/org/a
>pache/commons/validator/ValidatorResources.java?view=markup
>
> This object exposes no way to turn off validation, but it does make
> use of Digester's facility for registering DTDs against copies in the
> classpath.  If your file uses one of the DTDs listed in
> the"registrations" array in ValidatorResources (see source at above
> URL) then you won't have any problem.  From a brief glance, I wonder
> if some new registrations need to be added?  If you have time to
> check, perhaps you could file a bug against commons-validator at
> http://issues.apache.org/bugzilla
>
> For the near term, the suggestion of specifying an alternate local
> URL for the DTD is probably best.

I had the same problem last week, and the simplest solution is to make sure 
you have the latest commons-validator jar.  1.1.3 validates properly against 
the DTD in the jar file, rather than needing to go to the web.

(But thanks for the more detailed explanation of _why_ going to 1.1.3 worked 
for me, Joe)
-- 
derek

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



Re: disable validation of validator.xml & validator-rules.xml

2004-12-01 Thread Joe Germuska
Ultimately, this is the responsibility of the commons-validator 
library which Struts uses.  For each config file, a 
"ValidatorResources" object is constructed.  This object uses 
commons-digester to process the XML config.

http://cvs.apache.org/viewcvs.cgi/jakarta-commons/validator/src/share/org/apache/commons/validator/ValidatorResources.java?view=markup
This object exposes no way to turn off validation, but it does make 
use of Digester's facility for registering DTDs against copies in the 
classpath.  If your file uses one of the DTDs listed in 
the"registrations" array in ValidatorResources (see source at above 
URL) then you won't have any problem.  From a brief glance, I wonder 
if some new registrations need to be added?  If you have time to 
check, perhaps you could file a bug against commons-validator at 
http://issues.apache.org/bugzilla

For the near term, the suggestion of specifying an alternate local 
URL for the DTD is probably best.

Joe

At 10:28 AM + 12/1/04, Marco Mistroni wrote:
Hello all,
Does anyone know how to disable the validation of the two files
mentioned in the subject?
Looks like struts, when loaded, is trying to validate those files
against the DTD... and if by mistake my internet connection goes down,
then code
Won\t work. (meaning, I am using WAS Studio, and it complaints that it
cannot validate the two files... and without tht I cannot build my
webapp..)
Any help?
Regards
marco

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

RE: Placing JSPs under WEB-INF using modules

2004-12-01 Thread Daniel Massie
what about for the path attribute of action mappings in the struts config 
files? 

Daniel

-Original Message-
From: Daniel Perry [mailto:[EMAIL PROTECTED]
Sent: 01 December 2004 13:04
To: Struts Users Mailing List
Subject: RE: Placing JSPs under WEB-INF using modules


Yeah, it's no problem.

Just use forwards like:



Daniel.

> -Original Message-
> From: Daniel Massie [mailto:[EMAIL PROTECTED]
> Sent: 01 December 2004 11:58
> To: [EMAIL PROTECTED]
> Subject: Placing JSPs under WEB-INF using modules
>
>
> I have a module called admin, and wish to locate JSPs in
> /WEB-INF/pages/admin. This however is relative to the default
> context rather than /admin.
>
> Is it possible to place JSPs under the WEB-INF directory when
> using modules?
>
> Thanks
> Daniel
>
> -
> 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: Placing JSPs under WEB-INF using modules

2004-12-01 Thread Daniel Perry
Yeah, it's no problem.

Just use forwards like:



Daniel.

> -Original Message-
> From: Daniel Massie [mailto:[EMAIL PROTECTED]
> Sent: 01 December 2004 11:58
> To: [EMAIL PROTECTED]
> Subject: Placing JSPs under WEB-INF using modules
>
>
> I have a module called admin, and wish to locate JSPs in
> /WEB-INF/pages/admin. This however is relative to the default
> context rather than /admin.
>
> Is it possible to place JSPs under the WEB-INF directory when
> using modules?
>
> Thanks
> Daniel
>
> -
> 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: simple html:select issue

2004-12-01 Thread Mark Lowe
Corey's suggestion could work with arraylist. 

If you use your code

 wrote:
> Andy,
> 
> I believe you are after something like this:
> 
> 
> 
> 
> Regards,
> Corey
> 
> 
> 
> On Wed, 01 Dec 2004 11:18:33 +, andy wix <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I am trying to use  select and options tags in the simplest way where I have
> > an ArrayList of Strings in the request (Logs) and I wish the one selected to
> > end up in the form's logName variable.
> > According to page 296 of Struts in action I think this should work:
> >
> > 
> >  
> > 
> >
> > but I get:
> >
> > [ServletException in:/selectLog.jsp] No name specified'
> > java.lang.IllegalArgumentException: No name specified at
> > org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
> > at
> > org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
> > at
> >
> > etc
> >
> > Thanks,
> > Andy
> >
> > _
> > It's fast, it's easy and it's free. Get MSN Messenger today!
> > http://www.msn.co.uk/messenger
> >
> > -
> > 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: simple html:select issue

2004-12-01 Thread Corey Scott
Andy,

I believe you are after something like this:




Regards,
Corey

On Wed, 01 Dec 2004 11:18:33 +, andy wix <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am trying to use  select and options tags in the simplest way where I have
> an ArrayList of Strings in the request (Logs) and I wish the one selected to
> end up in the form's logName variable.
> According to page 296 of Struts in action I think this should work:
> 
> 
>  
> 
> 
> but I get:
> 
> [ServletException in:/selectLog.jsp] No name specified'
> java.lang.IllegalArgumentException: No name specified at
> org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721)
> at
> org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
> at
> 
> etc
> 
> Thanks,
> Andy
> 
> _
> It's fast, it's easy and it's free. Get MSN Messenger today!
> http://www.msn.co.uk/messenger
> 
> -
> 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]



Placing JSPs under WEB-INF using modules

2004-12-01 Thread Daniel Massie
I have a module called admin, and wish to locate JSPs in /WEB-INF/pages/admin. 
This however is relative to the default context rather than /admin. 

Is it possible to place JSPs under the WEB-INF directory when using modules?

Thanks
Daniel

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



Totally stuck handling forms

2004-12-01 Thread Alexander Czernay
I'm still trying to find a nice way for handling standard 
list/create/edit/delete-forms...

After browsing through all the hints and tips I got from here, I started 
building an initial form-setup-action using DispatchAction with a 
parameter dispatch that should be set to list, create, edit or delete, 
depending on the action wanted. That form-setup-action should 
pre-populate the form as needed and then forward to the apropriate 
action for display. There are two further actions; one for listing all 
existing entries (form-list-action, a LookupDispatchAction) and another 
for displaying an individual entry for editing (form-edit-action).

Now I tried to stick it all together passing parameters around. But 
exactly that doesn't work as expected: On the list-form I present a list 
of all entries available together with submit-buttons for 
edit/delete-actions for each individual entry. There also is a single 
create button for creating new entries. Pressing the create-button 
invokes a create-method in the form-list-action that calls a forward 
named "create". That forward points back to the form-setup-action with 
"?dispatch=create" added to the path. The form-setup-action should then 
forward to the appropriate form-create-action, but it looks like the 
dispatch parameter isn't passed on to the form-setup-action.

I wonder if this approach is ok or if there are better ones? How could 
the parameters be passed from one action to another (I couldn't find any 
parameter one could add to a -tag to pass paramaters that way.

Thanks for your help,
Alexander
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Automatic logging

2004-12-01 Thread Eddie Bush
- Original Message - 
From: "Kinjal Sonpal" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 01, 2004 1:03 AM
Subject: RE: Automatic logging


On the other hand, I don't find it all that burdensome to
establish a
static log instance for each class and toss around a few
log.debug(...) lines, especially when I'm working on figuring out
someone elses ill-documented code!
Hmm.. It appears to me that there are no frequently used or
established patterns for my requirements. May be I should also divert
my efforts into the same directions as mentioned by you. Can you or
someone suggest something for my requirements? My experience with
struts is relatively intermediate and we do not have any Tech.
consultants or Architects for my project.
Yeah ... each catch block put in something that tells you that you had an 
exception, gives you the state of things that may have caused the exception, 
and prints a stack trace :-)  It's nice to include context information about 
where the logging is coming from.  Using something like commons-logging + 
log4j -- or just log4j, if you don't care about ever changing -- works well 
for this.

You're welcome and good luck ;-)
Eddie Bush
Thanks and Regards,
Kinjal Sonpal

"In the real world, the right thing never happens in the right place
at the right time. It is the task of journalists and historians to
rectify this error."
--Mark Twain 

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0449-0, 11/30/2004
Tested on: 12/1/2004 5:33:42 AM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com

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


simple html:select issue

2004-12-01 Thread andy wix
Hi,
I am trying to use  select and options tags in the simplest way where I have 
an ArrayList of Strings in the request (Logs) and I wish the one selected to 
end up in the form's logName variable.
According to page 296 of Struts in action I think this should work:


 

but I get:
[ServletException in:/selectLog.jsp] No name specified' 
java.lang.IllegalArgumentException: No name specified at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721) 
at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) 
at

etc
Thanks,
Andy
_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

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


Re: view controller

2004-12-01 Thread Adam Hardy
On 11/28/2004 04:40 PM Joe Germuska wrote:
At 11:31 AM + 11/24/04, Adam Hardy wrote:
On 11/23/2004 02:20 PM Joe Germuska wrote:
Your action isn't executed if validation fails.  However, the 
validation is performed on a second request, so the object placed 
into the scope before the form was presented is no longer there.

If your categories are really relatively static, consider managing 
them in Application scope rather than request.  I often have one or 
more plugins which initialize common menus like states and provinces 
or months of the year and place them into the application scope (I 
like to use the DigestingPlugIn).  Your code doesn't look like 
there's anything particularly request-sensitive about the category tree.

Some people make lists a property of the form itself.  This is also 
one of the core use cases for some kind of view controller registered 
against the input forward's path, which is one of my goals to 
implement in a Struts 1.3.x timeframe.

Joe

Joe,
I hope you don't think I'm labouring a point after the big discussion 
last week, but regarding a view controller registered against the 
input forward's path, I just don't get the paradigm.

It seems like an unnecessary complexity when you can do what Matt 
suggested and point the input attribute at a 'loader' action mapping.

As Struts is designed now, setting the "input" attribute of an action 
mapping to point to another action mapping results in two passes through 
the request processor for a single HTTP request.  This is not a use case 
for which Struts is designed or tested, and which could have strange 
side effects.  Certainly, many people use it today without problems, but 
why not move Struts towards a clearly defined usage pattern which 
doesn't involve any grey areas like this?

Having a loader action decouples it from the validation+processing 
action, which seems friendly and OO to me. Then you can use that 
loader action from anywhere - can you say the same about your view 
controller registered against the input forward path?

When I say that it's registered against the input forward path, I don't 
mean that it's connected to the validating action mapping.  I mean that 
the system is configured so that any time it is headed to the path 
defined as the input forward path, it will execute one or more view 
controllers.  Therefore, it doesn't matter whether you are presenting 
the form for the first time or on a subsequent pass; the view controller 
code would still be executed.  To me this seems "more OO" because it 
associates the processing code with the context in which it is used.  No 
one needs to remember a sequence of actions which must be chained; they 
just trust that the request context (including the session and 
application) have the right data in the right places, and then small 
adjustments necessary to rendering the view can be encapsulated cleanly.

Does that help at all?
Joe
Yes but only half. Regarding the first point, since struts is actually 
able to accept and deal with a second action mapping in that mapping's 
"input" (or "forward") param, then somehow struts must be designed for 
it. It can't possibly have been a happy coincidence, surely? I don't 
know about tests.

I appreciate your direction though. Do you envisage being in a position 
to completely disable chaining in struts? Let me describe the situation 
I had at my last project where it was useful (and justified IMHO):

The screens were complex and were not under my control. Each screen 
contained up to 3 completely seperate bits of functionality, e.g. hotel 
bank account number, hotel billing address and hotel billing options. 
These were handled by different session facade calls.

I had already experienced alot of scope creep and I knew that these 
would change, and in fact I was pushing to get control of the screen 
designs, in which case I would simply have put the 3 different bits on 
different screens - so when coding the mappings, I made 3 mappings and 
chained them together, so I could seperate out the Action classes and 
hopefully actually seperate out the page too in the future.

I didn't get the opportunity to seperate out the pages, but I was still 
happy that I could chain the mappings and have seperate Action classes.

Do you see what I mean?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Problem using MessageResources

2004-12-01 Thread René Thol
Hello everybody,
I'm still using struts1.0.2 (I have to) and have a problem regarding 
message resources.

The locale in my requests is always de and I'm setting a de_DE locale 
using the following:

session.setAttribute(Action.LOCALE_KEY, locale);
But when I'm fetching my messages a line later in this manner:
MessageResources messages = getResources();
and access them I only get the texts of my default properties file but 
not of my de-propertyfile.

Why?
Can please somebody tell me what went wrong and where I can get (webpage 
etc.) an insight in
strut's modus operandi regarding Message Resources and Locales?

I did not yet find a webpage where this behaviour of struts is 
described. Which locale do I have to set where
in order to get the corresponding MessagaResources by calling 
getResources() within my Action class.

Kind regards
--

René Thol
E-Mail: [EMAIL PROTECTED]


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


Using a key as var-value in validator

2004-12-01 Thread Kinjal Sonpal
Dear all,

I'm using Struts 1.2.4 with Validator 1.1.3 for my application. I need
to access the Date Format stirng across the application at many
places.

Instead of hard-coding format string everywhere I would like to use a
key from the Resource Bundle for the purpose. I can access the key
from all of my Java, Jsp code, but how do I access it the
validation.xml file?

Please share your views on this.

Thanks and regards,
Kinjal Sonpal

"In the real world, the right thing never happens in the right place
at the right time. It is the task of journalists and historians to
rectify this error."
Mark Twain





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



Re: disable validation of validator.xml & validator-rules.xml

2004-12-01 Thread Guillaume Cottenceau
"Marco Mistroni"  writes:

> Hello all,
>   Does anyone know how to disable the validation of the two files
> mentioned in the subject?
> Looks like struts, when loaded, is trying to validate those files
> against the DTD... and if by mistake my internet connection goes down,
> then code
> Won\t work. (meaning, I am using WAS Studio, and it complaints that it
> cannot validate the two files... and without tht I cannot build my
> webapp..)
> 
> Any help?

Substitute the URL pointing to the DTD by a URI pointing to a
local file?

-- 
Guillaume Cottenceau

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



disable validation of validator.xml & validator-rules.xml

2004-12-01 Thread Marco Mistroni
Hello all,
Does anyone know how to disable the validation of the two files
mentioned in the subject?
Looks like struts, when loaded, is trying to validate those files
against the DTD... and if by mistake my internet connection goes down,
then code
Won\t work. (meaning, I am using WAS Studio, and it complaints that it
cannot validate the two files... and without tht I cannot build my
webapp..)

Any help?

Regards
marco




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



retrieve hidden fields value after validation error

2004-12-01 Thread Johannes Wolfgang Woger
Hi, 

I have a small form, with some strings and some numbers to be inserted.

Strings are validated to be required and numbers have to be integer.

 

There is a hidden field:

 



 

A   shows that its value is not present anymore

after a validation error (after error messages are shown).

 

Where does the value go, and what can I do to retrieve the value of the
select field?

 

Wolfgang

 



RE: request between actions

2004-12-01 Thread Morales de Frías, David
Thanks for your help, but it's still not working.

i've changed struts config, from redirect="true" (ops..) to redirect="false". 
And it's supossed that i will have my request's parameters in second action, 
but it isn't true. I don's see any parameters...

What is the error??

Best regards



-Mensaje original-
De: Ram Venkataswamy [mailto:[EMAIL PROTECTED]
Enviado el: martes, 30 de noviembre de 2004 21:33
Para: Struts Users Mailing List
Asunto: RE: request between actions


Set to "true" if a redirect instruction should be issued to the user-agent so 
that a new request is issued for this forward's resource. If true, 
RequestDispatcher.Redirect is called. If "false", RequestDispatcher.forward is 
called instead. [false]. 

 

The culprit is redirect=true - check the definition above 

 

 

-Original Message-
From: Morales de Frías, David [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 30, 2004 12:17 PM
To: [EMAIL PROTECTED]
Subject: request between actions

 

Hi all¡¡

 

I need your help, please.

 

I have an action that forwards to another action, and i'm loosing request 
parameters.

 

I have in struts-config this lines:

 



 

but it doesn't work.

 

Can you help me?


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