RE: logic:iterate for arraylist of beans

2006-12-13 Thread mano dasanayake
Hi,
As I understood what you have to do is,
Iterate through your list and add checkboxes as folllwing...



")" />





Regards,
Mano




-Original Message-
From: Kranti Parisa [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 13, 2006 2:07 PM
To: Struts Users Mailing List
Subject: logic:iterate for arraylist of beans

hi,

i am facing proble for the following
=
assigning value to check box

say logic:iterate is having arraylist
this arraylist is with beans
means for example employee bean
i want to view all emps in jsp
what we will do is we create a bean for each employee
and add tht bean to arraylist
so tht we have this arraylist in jsp
then we use logic:iterate
to iterate the arraylist
now we need to print the rows
each row contains a check box
this check box should get the value as empid
so tht when i select the checkbox
we can do delete or modify..etc


plz suggest/help from this.
stuck up completely with this.



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



RE: logic:iterate for arraylist of beans

2006-12-13 Thread mano dasanayake
Hi ,
I'm using 1.2 any how...what I mean in the Iterate code is that you simply 
Define an ID for the bean that you are about to iterate...

For an instance,







So you'r going to iterate thru your "EmplyList" and refer 
Each of ur bean by name "EMp".
 Then you can get whatever the attribute you want from your Bean,(Employee).

For this case I think better to use ,,,
Can you explain your requirement specifically?

Regards,
Mano







-Original Message-
From: Kranti Parisa [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 13, 2006 3:06 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate for arraylist of beans

Hi Mano,

In the code you have written 

"Emp" should be the name of the ArrayList right?

and in logic:iterate type is there? i hope you mean to say collection="" ..

and i need to submit the form after selecting what ever checkboxes that i
need to delete and then click on the detele button.but in the code that you
gave me will submit the orm when i click on the checkbox i think.

the problem is for the "value" of the checkbox
i should assign the value of the checkbox as empid. so that when i submit
the form we can capture all the checked empid using req.gerParamaterValues

please suggest something


On 12/14/06, mano dasanayake <[EMAIL PROTECTED]> wrote:
>
> Hi,
> As I understood what you have to do is,
> Iterate through your list and add checkboxes as folllwing...
>
> 
>
>  onclick="submitForm("editaction.do?id= property="ID"/>")" />
> 
>
>
> 
>
> Regards,
> Mano
>
>
>
>
> -Original Message-
> From: Kranti Parisa [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 13, 2006 2:07 PM
> To: Struts Users Mailing List
> Subject: logic:iterate for arraylist of beans
>
> hi,
>
> i am facing proble for the following
> =
> assigning value to check box
>
> say logic:iterate is having arraylist
> this arraylist is with beans
> means for example employee bean
> i want to view all emps in jsp
> what we will do is we create a bean for each employee
> and add tht bean to arraylist
> so tht we have this arraylist in jsp
> then we use logic:iterate
> to iterate the arraylist
> now we need to print the rows
> each row contains a check box
> this check box should get the value as empid
> so tht when i select the checkbox
> we can do delete or modify..etc
> 
>
> plz suggest/help from this.
> stuck up completely with this.
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
--
Best Regards
Kranti Kiran Kumar Parisa
Mobile: +91 - 9849 - 625 - 625 +91 - 9391 - 438 - 738



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



RE: DynaValidatorForm - cannot find bean

2006-12-17 Thread mano dasanayake
Hi,
Use PropertyUtils.setSimpleProperty(yourForm,"proptyName",object);

And 

PropertyUtils.getsimplePropert(yourform,"proprtyname") --> cast it to the
required type..

Have a look
http://www.ingrid.org/jajakarta/struts/struts1.0/en/target/documentation/api
/org/apache/struts/util/PropertyUtils.html#getSimpleProperty(java.lang.Objec
t,%20java.lang.String)


Regards,
Mano

-Original Message-
From: Pille [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 18, 2006 5:48 AM
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm - cannot find bean

how can i access the getters and setters in of a DynaValidatorForm from
within an action method?

when i had a own form class i could do the following in a action method:

productForm = (MyOwnForm)form;

productForm.setComboArrayList(comboArrayListWithBeans);

with a dynamic form i cannot cast anymore or do i have to cast to a
DynaValidatorForm? is it actually possible to do a cast or do i have to
implement a ValidatorForm instead of using a DynaValidatorForm?
thank you


Pille wrote:
> 
> Christopher Schultz wrote:
>> Philippe,
>>
>> Pille wrote:
>>> but after submitting the form with wrong input and returning
>>> to the jsp-page i get the following exception:
>>> javax.servlet.jsp.JspException: Cannot find bean under name countries at
>>>
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:374)
>>> after submitting the form with wrong parameters and returning to the
>>> page the beans are gone. is there any possibility to set the beans with
>>> request.setAttribute() again?
>> You are encountering a common problem with a simple solution. In order
>> to display the form the first time, you are loading "extra" data such as
>> the list of countries. When validation fails, Struts will send you back
>> to the "input" page to try again. If your "input" page is just your
>> form, you will be missing that "extra" information.
>>
>> What I usually do is create two actions: one that loads the information
>> to be edited (the actual content of the form) and another to "prepare"
>> the display. This "prepare" action loads this "extra" information such
>> as a country list.
>>
>> So, I'd have something like this:
>>
>> 
>> 
>> 
>> 
>> 
>> 
>> > validate="true" input="/prepare.do">
>> 
>> 
>>
>> As you can see, the "input" for SaveAction is now set to the "prepare"
>> action which loads that extra information, so it's available for the
>> form in case any validation errors occur.
>>
>> -chris
> 
> ok. i understand.
> 
> how can i set a property of the form, that is used and needed in the jsp
> of the form after editing?
> how can i set a property of a dyna form from within an action? how do i
> make sure that this property will be still set after submission and
> redirecting over 2 sites?
> 
> the problem is that i have 4 dynamic combo boxes and i always need to
> iterate over the request parameters with a Regexp to get and reset all
> the parameters of the combo boxes. the contents of the 4 combo boxes
> depend on the previously made selection.
> one row of the combo boxes is hold in an ArrayList which is a property
> of the DynaValidatorForm. the ArrayList itself holds the Beans. after
> making a selection in the last combo box, i call the action and add a
> new element in the array list. in the jsp i iterate over this ArrayList
> and a second line with no selection is displayed. for each combo box i
> submit the form with the javascript onchange event to generate new
> values (or maybe a new row with combo boxes).
> i have one row of 4 combo boxes. after a selection in the last combo box
> of the last row i create a new arraylist item and a new line with new
> combo boxes is displayed.
> the selection possibilities are stored in the bean (ArrayList with
> Beans) too because some selection possibilities are different from
> others e.g. in the third combo box in the first row there are different
> selection values than in the third combo box in second row because of
> different selections in second combo in first and second row. difficult
> to explain, sorry, hope you understand.
> 
> -
> 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: read/display image from Database using struts

2006-12-18 Thread mano dasanayake
Hi kranti,

You have to use BLOB's to store images in the DB..


Get the Out Stream from the BLOB and then write the byte[] to it..

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


Regards,
Mano

-Original Message-
From: Kranti [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 18, 2006 2:21 PM
To: Struts Users Mailing List
Subject: read/display image from Database using struts

Hi,

How should I read/display image from Database...which is stored interms of
bytes in the Database.

Please suggest me some way to render the image in JSP.



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



RE: initialize a DynaValidatorForm property

2006-12-18 Thread mano dasanayake

Hi,
Yes you can initiate an attribute of type arrayList in the DynaForm as
follows,



And in the action mapping specify the name of the Form Bean that you are
about to use. In this case the form bean that contains the List you'r going
to initiate..

Regards,
Mano


-Original Message-
From: Pille [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 5:12 AM
To: user@struts.apache.org
Subject: initialize a DynaValidatorForm property

hi,
how can i initialize a property of type ArrayList in a DynaValidatorForm?
i saw that i can do some simple initialization with the initial
attribute in the form-peoperty tag in struts-config.

at the moment i do some initialization in a prepare action that sets the
attributes some combo boxes.




it seems that a form of type DynaValidatorFrom doesn´t allow the
attribute name="formName" in the prepare action statement. do i need
this attribute to access the form bean?
i always get a ForwardConfig exception when i try to do this but i need
to initialize a form property (ArrayList) in the action statement. i
think i need an instance of the form bean to set a property with
PropertyUtils.setSimpleProperty(yourForm,"propertyName",object);
in a action method. is that right?

which data types can i use in a DynaValidatorForm? i have a book here
and the author says that only arrays, lists and maps of primitive data
types are allowed. is it possible to use a java.util.ArrayList with my
own beans of same type as elements?
thank you

regards
philippe

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





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



RE: How to hide scrollbars from jsp's displayed using struts

2007-01-08 Thread mano dasanayake


Your table here,,,


Regards,
Mano
-Original Message-
From: Joseph McGranaghan [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 08, 2007 6:12 PM
To: Struts Users Mailing List
Subject: Re: How to hide scrollbars from jsp's displayed using struts

If I understand you correctly, that is a CSS question, not struts.

Set the 'overflow' property to 'hidden' or 'visible' on the 
containing your inserted content.

-Joe

Mohsin I. Hakak wrote:
> How to hide scrollbars from jsp's displayed using struts in case they
> appear??
>
>
>   

-
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: Two Struts actions in one jsp

2007-01-11 Thread mano dasanayake
As I know, it's possible...
As you have mentioned I suppose you are using hyperlinks to initiate those
Actions. So that you can prepare your action URL's as to initiate relevant
actions.
Thanks & Regards,
Mano 

-Original Message-
From: Krishna, Hari (FTT-CInternet) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 11, 2007 2:21 PM
To: user@struts.apache.org
Subject: Two Struts actions in one jsp

Hi 

i have a jsp where i put 2 forms and 2 actions which belong to two action
classes.But i am getting does not contain specified
method:java.lang.NoSuchMethodException:

Is it possible in one jsp to have 2 different actions and making switch over
based on the hyperlink we are clicking?

Regards,
I.HariKrishna | Software Engineer | Franklin Templeton International
Services (India) Pvt. Ltd. | Franklin Templeton Centre,1st Floor, No.7,Third
Cross Street, Kasturba Nagar, Adyar, Chennai 600020
| Tel: +91 44 24407000 | Fax: +91 44 24453661 | Mobile: +91 9884528587 |
www.franklintempleton.com 

Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.

-
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: Comparing dates

2006-12-06 Thread mano dasanayake
Hi Chamal,
Try


 where "thedate" is a date Obj...

Best regards,
Mano



-Original Message-
From: chamal desilva [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 06, 2006 3:00 PM
To: user@struts.apache.org
Subject: Comparing dates

Hi,

Is it possible to compare dates with logic equals tag.

My form bean has a property called addedDate.

I need to compare it with date 2006-12-24

how should I write the equals tag



Thanking You,
Chamal.  


 


Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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





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



RE: OT: file download without opening a window

2006-12-07 Thread mano dasanayake
Hi,
As per my knowledge, what you have to do is opening an out stream from your
action.
 Something like...

response.setContentType("application/x-file-download");



response.setHeader(
"Content-disposition",
"attachment; filename=" + "Appfile.xml);
response.setHeader("Cache-Control", "max-age=" +
2);

ServletOutputStream outStream = null;
try {
outStream = response.getOutputStream();
} catch (IOException e1) {

e1.printStackTrace();
}


//call to your backend to get the real out stream for this file..
try {
getFileData(outStream);  //write the
outstraem here..
} catch (FileNotFoundException e2) {
e2.printStackTrace();
}


//and finally 


try {

outStream.flush();
} catch (IOException e3) { 

e3.printStackTrace();
}


return null;  //return Null...so that user will see
a Download popup...

Thanks & regards,
Mano


-Original Message-
From: Søren Blidorf [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 07, 2006 1:06 PM
To: Martin Gainty; Struts Users Mailing List
Subject: Re: OT: file download without opening a window

What I need is for system users to be able to download a specifik xml file
on my server.

The download should start when the user clicks on a button. The click on the
button should copy the action of right-clicking on a link to the xml file
and choosing "Save target as". I dont want a new window to open or a
redirect off the page.

Please let me know if I need to explain againg

Br.

Soren


- Original Message -
From: "Martin Gainty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 07, 2006 2:30 AM
Subject: Re: OT: file download without opening a window


> Goddag Søren
>
> forsøge-
>
> http://upload.thinfile.com/put/
>
> med venlig hilsen
>
> Martin --
>
> This e-mail communication and any attachments may contain confidential and
privileged information for the use of the
> designated recipients named above. If you are not the intended recipient,
you are hereby notified that you have received
> this communication in error and that any review, disclosure,
dissemination, distribution or copying of it or its
> contents
> - Original Message -
> From: "Mitchell James" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Sent: Wednesday, December 06, 2006 7:23 PM
> Subject: Re: OT: file download without opening a window
>
>
> Can you restate what you want?  It's not exactly clear what you are
> asking.
>
>
> --
> James Mitchell
> 678.910.8017
>
>
>
>
> On Dec 6, 2006, at 4:56 PM, Søren Blidorf wrote:
>
> > Does anybody know how to make a form button, that starts
> > downloading myFile.xml
> >
> > What I want is to make an onclick = "Save target as"
> >
> >
> > Med venlig hilsen
> >
> > Søren Blidorf
> > Nolas Consulting
> > Web:  http://www.nolas.dk
> > Mobil: +45 61676513
>
>
> -
> 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]