struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parveen Kumar Hooda" <pho...@ggn.aithent.com>
Subject Re: Help with Multiple Input!
Date Thu, 05 Dec 2002 03:57:26 GMT

Hi

try the following code.

import  org.apache.struts.util  package in your form bean

String sub =StrutsValidatorUtil.getMessage(request,"your message key");

hope this will help you.

----- Original Message -----
From: "Jana Navaneethan" <jana.navaneethan@labs.gte.com>
To: <Sri.Sankaran@sas.com>
Cc: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, December 05, 2002 1:42 AM
Subject: Re: Help with Multiple Input!


> Hi,
>      Thanks for your valuable suggestion. It solved my problem. I have a
> basic question, How can I retrieve messages from my properties file in my
> form bean? I need to do this for some checkbox labels and values I want to
> use the messages from the ApplicationResources.properties file.
>
> Your help will be greatly appreciated!
>
> Thanks,
> Jana.
>
>
>
> ----- Original Message -----
> From: "Sri Sankaran" <Sri.Sankaran@sas.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Tuesday, December 03, 2002 3:03 PM
> Subject: RE: Help with Multiple Input!
>
>
> >
> >
> > > -----Original Message-----
> > > From: Jana Navaneethan [mailto:jana.navaneethan@labs.gte.com]
> > > Sent: Tuesday, December 03, 2002 2:57 PM
> > > To: Wendy.Smoak@asu.edu
> > > Cc: Struts Users Mailing List
> > > Subject: Re: Help with Multiple Input!
> > >
> > >
> > > Hi Wendy,
> > >                  All I am trying to do is to avoid repeating
> > > the HTML code. I am trying to do something like
> > > <html:checkbox property="dayFlag<%= i %>"/> where i is an
> > > integer 1 thru 7 and in my form bean I will have getter like
> > > getDayFlag1(), etc. Now the problem is with the static text
> > > ie Monday which should be displayed from the message
> > > resources, I dont know how to do that? I am trying some thing
> > > like <bean:message key="businesslisting.message5<%= i %>"/>
> > > which is not working, Could you please tell me any work
> > > around for this?
> > >
> >
> > Just answering your current question, you cannot specify a tag attribute
> with a combination of a literal and a JSP expression.  That is,
> >
> > <bean:message key="foo<%=bar%>"/>
> >
> > is a no-no.  Instead code it as
> >
> > <bean:message key='<%="foo"+bar%>'/>
> >
> > So, your specific example would look like
> >
> > <bean:message key='<%="businesslisting.message5" + i %>'/>
> >
> > > Thanks,
> > > Jana.
> >
> > Sri
> > >
> > > ----- Original Message -----
> > > From: "Wendy Smoak" <Wendy.Smoak@asu.edu>
> > > To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
> > > Sent: Tuesday, December 03, 2002 2:36 PM
> > > Subject: RE: Help with Multiple Input!
> > >
> > >
> > > > > I have a form in which I am collecting multiple input
> > > from the user,
> > > > > for example for each day of the week I am collecting opening hour
> > > > > and closing hour something in the format of day -  checkbox -
> > > > > select/option - select/option , I want to do this in
> > > a
> > > > > loop for all 7 days of the week. I couldn't find any good
> > > examples
> > > > > or tutorials for this. Please let me know the right way of doing
> > > > > this or
> > > any
> > > > > sample would be greatly appreciated!
> > > >
> > > > JMO, but since this is a fixed number of form fields, I
> > > wouldn't try
> > > > to do
> > > a
> > > > loop to present them, just name them 'monday' 'mondayOpen' and
> > > > 'mondayClose', etc.
> > > >
> > > > Only the successful (checked) checkboxes will be present in the
> > > > request,
> > > so
> > > > you can check for the existence of each one, and if it's
> > > there, then
> > > > go
> > > look
> > > > for the open/close fields.
> > > >
> > > > I'm sure it could be done more elegantly, but I think you might be
> > > > making
> > > it
> > > > more complicated than it has to be.  Loops are good when
> > > you have no
> > > > idea how many rows you'll need to present, or if there are
> > > many items.
> > > >
> > > > --
> > > > Wendy Smoak
> > > > Applications Systems Analyst, Sr.
> > > > Arizona State University PA Information Resources Management
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> > > For
> > > additional commands,
> > > e-mail: <mailto:struts-user-help@jakarta.apache.org>
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message