formatKey negative numbers

2007-05-17 Thread chamal desilva
Hi, I am using bean:write tag to display properties (return type Double) of my form bean. I am also using formatKey attribute to format the output. This is the format key I have mentioned in ApplicationResources.properties file. display.currency=#,## 0.00 Formatting works fine. But negative

Creating an instance of an action a class

2007-01-25 Thread chamal desilva
Hi, Is it safe to create an instance of a action class in another action class and use. For example .. public NewAction extends Action { public ActionForward execute () { OtherAction oact = new OtherAction(); oact.execute(); } } Thanking you, Chamal.

Accessing Application Resources file

2006-12-21 Thread chamal desilva
Hi, I want to retireve a message from application resources file. This is my code.. resources =(MessageResources)pageContext.getRequest().getAttribute( Action.MESSAGES_KEY ); format = (String) resources.getMessage(display.currency ); This works fine. But only issue is that

RE: Formatting numbers in text field

2006-12-07 Thread chamal desilva
Message- From: chamal desilva [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 05, 2006 8:52 AM To: user@struts.apache.org Subject: Formatting numbers in text field Hi, Is there a way display numbers in a text field in a formatted way. For example I want to display 100 as 1,000

Comparing dates

2006-12-06 Thread chamal desilva
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 logic:equals name=FormBeanName property=addedDate value=What should I put here Thanking You, Chamal.

Formatting numbers in text field

2006-12-05 Thread chamal desilva
Hi, Is there a way display numbers in a text field in a formatted way. For example I want to display 100 as 1,000 in a text field. My form field attribute type is Double. Thanking You, Chamal. Do you

Re: html:options / help?

2006-11-21 Thread chamal desilva
Hi, U can do like this, html:select name=division property=teamRef html:optionsCollection name=division property=allTeams value=teamRef label=teamName/ /html:select Division is a form bean. allTeams is the vector which contains the objects. Vector contains team objects which has teamRef and

setInput method of ActionMapping

2006-11-13 Thread chamal desilva
Hi, I want to call mapping .setInput() method inside my validate method of a form bean. But it throws an Exception. java.lang.IllegalStateException: Configuration is frozen at org.apache.struts.config.ActionConfig.setInput(ActionC

Validating a form bean

2006-11-02 Thread chamal desilva
Hi, I have a form bean as this one public class CustomerForm extends ActionForm { private AccountForm accForm = null; // other attributes and methods } My JSP looks like this. It has a form which contains details of CustomerForm as well as AccountForm inside CustomerForm. html:form

Re: Forwarding to a url

2006-10-05 Thread chamal desilva
Thanks Antonio Petrelli, But I can't define a forward, since the forward url and id are not static. URL can be any page and id can be any number. Is there a way to do it without forwards. Chamal. --- Antonio Petrelli [EMAIL PROTECTED] wrote: chamal desilva ha scritto: Hi, Is it possible

Forwarding to a url

2006-10-03 Thread chamal desilva
Hi, Is it possible to forward to a url rather than forwaring to a forward in struts.config file from a action class. For example we can do like this from servlets. req.getRequestDispatcher(page.jsp?id=10).forward(req,resp); Can we do the same with struts. Thanking You, Chamal.

Print value of a map

2006-10-01 Thread chamal desilva
Hi, Is there a Struts tag to search and print a value of a map for example a tag like this c:mapvalue mapname='mymap' key='mykey'/ where mapname is the name of map in session or request and key is the key in map to be found. Thanking You, Chamal.

Submit Button Tag passing an expression to onclik attribute

2006-09-19 Thread chamal desilva
Hi, Can we pass an expression to onclick handler of struts html:submit tag. html:submit styleClass=headerclk property=submit value=%=String.valueOf(ArrEmpList.get(i))% styleId='%=String.valueOf(ArrEmpList.get(i))%' onclick=hilightButton2('%=myval%'); /html:submit We tried this. But the HTML is

html:options Hashtable

2006-09-03 Thread chamal desilva
Hi, Can we display the values of a hashtable in a html drop down menu using struts tags. Thanking You, Chamal. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

BeanUtils copyProperties - copying vector

2006-08-03 Thread chamal desilva
Hi, I have four classes. public class AccountForm { private String accNum; } public class Account { private String accNum; } public class CustomerForm { private String custRef = ; private Vector accounts= null;//Contains objects of AccountForms classes //Get, set methods }

Grouping common actions

2006-07-17 Thread chamal desilva
Hi, I need to group actions to a common action class. We dont have EventActionDispatcher since we have struts version 1.1. DispatchAction class needs button names to have the save name as method names. And is there a way that we can add common functionality to all methods in DIspatchAction

Using properties files other than ApplicationProperties

2006-07-07 Thread chamal desilva
Hi, I want store all messages in a properties file called MessageProperties. I added this line to struts config file. message-resources key=messages parameter=arweb.resources.MessageResources/message-resources How can I retireve values in properties file from my action classes in order to

Checkling Security

2006-06-18 Thread chamal desilva
Hi, How should we test wether a user has permission for an action. Can we do it in action class or do we have to do it in EJB tier. Thanking You, Chamal. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around

ActionForm and EJB

2006-06-08 Thread chamal desilva
Hi, I read few articles on struts. They recommend not to send action form class to EJBs as data holders. They recommend we should use general classes for holding data to decople web tier with EJBs. What they say must be correct but I still have few doubts (Maybe b'cause I am not experienced).

Organizing action classes

2006-06-07 Thread chamal desilva
Hi, I have few action mapings. /get_admin_tasks /add_task /ass_user etc. /get_add_data /save_customer_data /save_account_data etc. Is it necessary to write Action classes for each of these actions or can we group several actions in to one Action class. What is the best way to

Re: Controlling Reset method

2006-06-04 Thread chamal desilva
will be reset when struts reset the data. Thanking You, Chamal. --- Scott Van Wart [EMAIL PROTECTED] wrote: chamal desilva wrote: For examle let's think there are four Accounts in accounts vector. The first action displays this list on a JSP. User clicks on first account and views

Re: Controlling Reset method

2006-06-04 Thread chamal desilva
Hi Scott, Thanks a lot for your reply. It was very useful. Thanking You, Chamal. --- Scott Van Wart [EMAIL PROTECTED] wrote: chamal desilva wrote: Dear Scott , Thanks for your reply. If you're viewing the second account, why would you need data for the first account? If it's

Controlling Reset method

2006-06-03 Thread chamal desilva
Hi, As I know the reset method of a form bean is called automatically when a action tries to add the form bean to session or retrieve it. Is there a way that we can stop the reset method being called. This is what I am