Re: Understanding Struts2 Internals : Result Configuration

2013-09-06 Thread Lukasz Lenart
Hi, Just to clarify my comment on SO - action can directly return instance of Result instead of simple String. Then ActionInvocation.getResult will contain that result then. So actions are not limited just to Strings but can be used to dynamically build response. Regards -- Łukasz + 48 606 323

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Leonidas Papadakis
Hi there, webwork used to have a class that would easily read external sources like xml files, but i do not recall the class name now. If you want to read from simple property files you could use something like : String path = ServletActionContext.getServletContext().getRealPath(""); Properties

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Chris
Thanks  , I 'll try with commons-configuration De : Umesh Awasthi À : Struts Users Mailing List ; Chris Envoyé le : Vendredi 6 septembre 2013 13h45 Objet : Re: Struts 2.3.15.1 How to read external properties files or conf files Have you tried http://common

Re: Inquiry

2013-09-06 Thread Hernán
Ok, thank you for your response. I will add some code snippets in order you can help me. First of all the hierarchy that extends ActionSupport, then the most important fragments. I hope you can help me. Thank you. Attached: (extends = ->) GenericPresentationAction -> CreateReadUpdateRemoveDeleteA

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Dave Newton
I don't understand the problem. Reading a file is trivial. Is the issue getting the values *out* of the file? I mean, Java provides its own properties handling that can read classpath resources. Dave On Fri, Sep 6, 2013 at 7:40 AM, Chris wrote: > In fact the problem is how to declare and use

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Umesh Awasthi
Have you tried http://commons.apache.org/proper/commons-configuration/ it can read various type of property files On Fri, Sep 6, 2013 at 5:10 PM, Chris wrote: > In fact the problem is how to declare and use external files to work with > external properties. > > host=xxx.xxx.xxx.xxx > port=

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Chris
In fact the problem is how to declare and use external files to work with external properties. host=xxx.xxx.xxx.xxx port= ...etc Should I understand that only few people use  external configuration files with struts web applications ? De : Dave Newton À

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Chris
Hi, OK for refactoring database access out of the action. But the problem is still there :  How to find a good framework to read external files in a struts web application ? De : Miguel Almeida À : Chris Cc : "umeshawas...@gmail.com" ; Struts Users Mailing

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Chris
Well, I have absolutely no problem with log4j.properties as I said above. I'm just trying to find a framework for all other external files  ( .properties or .configuration or unname.properties files ) De : Martin Gainty À : Struts Users Mailing List Envoyé

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Dave Newton
How are you trying to load them? As a resource on the classpath? Dave On Sep 6, 2013 5:51 AM, "Chris" wrote: > Where : server side , in action , like ActionSupport > > First example : Login.java ( like in struts-2.3.15.1-blank ) > class Login extends com.opensymphony.xwork2.ActionSupport > to c

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Miguel Almeida
Without any code it's hard to know what's happening. I do ask you to seriously reconsider refactoring database access out of the action or you'll end up with a huge, very hard to test action class. Miguel Almeida On Fri, 2013-09-06 at 10:50 +0100, Chris wrote: > Where : server side , in action

RE: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Martin Gainty
if you did not place log4j.properties on classpath then Set the resource string variable to the value of the log4j.configuration system property. The preferred way to specify the default initialization file is through the log4j.configuration system property. In case the system property log4j.c

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Chris
Where : server side , in action , like ActionSupport First  example : Login.java ( like in struts-2.3.15.1-blank ) class Login extends com.opensymphony.xwork2.ActionSupport to check and validate user/password ( I need access to LDAP or database ) Second Example: A User Request After success

Re: Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread umeshawasthi
Log4j file will be ready by Log4j framework and not exactly by struts2 Can you define where and how you want to read your property files? Sent from BlackBerry® on Airtel -Original Message- From: Chris Date: Fri, 6 Sep 2013 09:40:03 To: Struts Users Mailing List Reply-To: "Struts Users

Struts 2.3.15.1 How to read external properties files or conf files

2013-09-06 Thread Chris
Using log4j.properties instead of log4j.xml is not a problem with Struts 2.3.15.1 ( or should it be ? ) But with my own properties files ( jdbc.properties ) or configuration files ( ldap.conf ) it doesn't work. Is there any example with external files . Not an upload  file by input forms. .