aspose file tools*
The moose likes Struts and the fly likes how to read properties file in struts 2 action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to read properties file in struts 2 action class" Watch "how to read properties file in struts 2 action class" New topic
Author

how to read properties file in struts 2 action class

zimbu bolleddu
Ranch Hand

Joined: Jan 14, 2008
Posts: 35
Dear all,

I'm new to struts 2.0, please help me while reading input from .properties file.

And one more thing how to distinguish two or more properties files which are having same sort of strings.

code examples are highly appreciated.

Thanks & Regards,
Zimbu
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Please choose an appropriate forum for your questions.Asking questions in an unrelated forum yields fewer and less useful response. Read this for more information.


SCJP, SCWCD.
|Asking Good Questions|
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170


Check Properties .. this will make it easier ..

Hope this helps ..
Sam Tsang
Greenhorn

Joined: Mar 26, 2009
Posts: 5
Just put the properties file in the package and use getText("property name"), then you can get the strings from the particular property name. But remember the properties file should be in the same package as your action class.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


by mistake post reply here... Sorry


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Ana Julia Fontoura
Greenhorn

Joined: Feb 23, 2011
Posts: 1

Is there a way to use "getText()" or another method like this, but placing the .properties file inside another package?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to read properties file in struts 2 action class