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 n

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 Action.MESSAGES_K

RE: Formatting numbers in text field

2006-12-07 Thread chamal desilva
ys for dealing with the > same problem in > DynaActionForms that I don't know of. > > Hope this helps > > Richard > > -Original Message- > From: chamal desilva [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 05, 2006 8:52 AM > To: user@struts.apache.org >

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

Re: help?

2006-11-21 Thread chamal desilva
Hi, U can do like this, Division is a form bean. allTeams is the vector which contains the objects. Vector contains team objects which has teamRef and teamName properties. division form bean also contains a property for teamRef. "" So when this teamRef is equal to teamRef of one of the te

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. Custo

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: > &g

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-09-30 Thread chamal desilva
Hi, Is there a Struts tag to search and print a value of a map for example a tag like this where mapname is the name of map in session or request and key is the key in map to be found. Thanking You, Chamal. __ Do You Yahoo!? Tired of spam? Ya

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. We tried this. But the HTML is generated as onclick="hilightButton2('<%=myval%>');" The value of myval variable is not printed in html. Plz help us to solve this problem. Best Regards, Chamal. __

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 class

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. How can I retireve values in properties file from my action classes in order to display them using tag. Thanking You, Chamal.

Struts and AJAX

2006-07-02 Thread chamal desilva
Hi, Can I use struts with AJAX. Does struts has classes and tags for AJAX or do I have write my own code. Thanking You, Chamal. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -

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 http://mail

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). Do

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

Re: Controlling Reset method

2006-06-04 Thread chamal desilva
m(Account) of vector 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 > li

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 try