Re: Two questions.

2006-01-30 Thread digant . k . joshi
Hubert:
Thanks for your response !
As I haven't got any answer for my 2nd question, if you can 
respond with this thread or newer thread would give me jump start on issue 
of  application properties file.
In my application I need to read from application properties file 
very specific to application and pass it to my application configuration 
object
so I can initialize MQ Series Q and DB and so forth.
Pls. let me know how would I read more than one properties file. 
and can have access to file from Action Class so I can pass this handle to 
properties file to another helper class.
Thanks.
Digant




Hubert Rabago [EMAIL PROTECTED]
01/30/2006 10:42 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List user@struts.apache.org
cc: 
Subject:Re: Two questions.


On 1/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 Very simple two questions .

 1. How do I get struts log4j messages on my console/my log ?
 2. How do I read application specific properties file in struts
 application?

Instructions on how to use and configure Log4j are available on
http://logging.apache.org/log4j/docs/documentation.html

Once you've familiarized yourself with it, you can configure Struts
logs using org.apache.struts keys:

# Print only messages of level WARN or above from Struts.
log4j.logger.org.apache.struts=WARN

And you're already discussing Item #2 in another thread so I'll skip that.

Hubert

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




This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein 
do not necessarily reflect those of JPMorgan Chase  Co., its subsidiaries 
and affiliates



RE: Two questions.

2006-01-30 Thread Marco Mistroni
Hello, 

You want to configure MQ series Q and DB? 
For which purpose?
Aren't htosep roperties  server-related properties?

If your code is dependent on those things, write a plugIn that read
A configuration file and initializes your objects with proper values..
Ideally, those values should have application scope..so Struts PlugIn
Should do what you need

Rgds
marco

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 30 January 2006 16:38
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: Re: Two questions.

Hubert:
Thanks for your response !
As I haven't got any answer for my 2nd question, if you can 
respond with this thread or newer thread would give me jump start on issue 
of  application properties file.
In my application I need to read from application properties file 
very specific to application and pass it to my application configuration 
object
so I can initialize MQ Series Q and DB and so forth.
Pls. let me know how would I read more than one properties file. 
and can have access to file from Action Class so I can pass this handle to 
properties file to another helper class.
Thanks.
Digant




Hubert Rabago [EMAIL PROTECTED]
01/30/2006 10:42 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List user@struts.apache.org
cc: 
Subject:Re: Two questions.


On 1/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 Very simple two questions .

 1. How do I get struts log4j messages on my console/my log ?
 2. How do I read application specific properties file in struts
 application?

Instructions on how to use and configure Log4j are available on
http://logging.apache.org/log4j/docs/documentation.html

Once you've familiarized yourself with it, you can configure Struts
logs using org.apache.struts keys:

# Print only messages of level WARN or above from Struts.
log4j.logger.org.apache.struts=WARN

And you're already discussing Item #2 in another thread so I'll skip that.

Hubert

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




This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market
prices,
data and other information are not warranted as to completeness or accuracy
and
are subject to change without notice. Any comments or statements made herein

do not necessarily reflect those of JPMorgan Chase  Co., its subsidiaries 
and affiliates



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



RE: Two questions.

2006-01-30 Thread digant . k . joshi
I am relatively new to struts based application development , I have basic 
app up. 
Now based my application requirement.

I have to do following 
1.  I have to put different browser request in a Request Q(SonicMQ) 
and then get reply by reading from Reply Q.
I already have utility config classes written which reads 
application properties file and establish Q connection and DB 
connection(DB   connection for  reading  some config info.)
2.  What I would like to do is from setup action obtain  application 
properties file handle and pass this Application properties file handle to 
config  utility class which  establishes Q and DB connection.
3.  This Q and DB connection then should be available for application 
life for that browser session.

I am not sure If I am proceeding right direction by writing Dao object 
which reads from Action class what is request and initializing Q/DB and 
processing request by putting/reading from Q.

I didn't understand how/what should i do to write a struts plug-in.
Thanks for looking at this.


Digant 




Marco Mistroni [EMAIL PROTECTED]
01/30/2006 11:59 AM
Please respond to Struts Users Mailing List

 
To: 'Struts Users Mailing List' user@struts.apache.org
cc: 
Subject:RE: Two questions.


Hello, 

You want to configure MQ series Q and DB? 
For which purpose?
Aren't htosep roperties  server-related properties?

If your code is dependent on those things, write a plugIn that read
A configuration file and initializes your objects with proper values..
Ideally, those values should have application scope..so Struts PlugIn
Should do what you need

Rgds
 marco

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 30 January 2006 16:38
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: Re: Two questions.

Hubert:
Thanks for your response !
As I haven't got any answer for my 2nd question, if you can 
respond with this thread or newer thread would give me jump start on issue 

of  application properties file.
In my application I need to read from application properties file 
very specific to application and pass it to my application configuration 
object
so I can initialize MQ Series Q and DB and so forth.
Pls. let me know how would I read more than one properties file. 
and can have access to file from Action Class so I can pass this handle to 

properties file to another helper class.
Thanks.
Digant




Hubert Rabago [EMAIL PROTECTED]
01/30/2006 10:42 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List user@struts.apache.org
cc: 
Subject:Re: Two questions.


On 1/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 Very simple two questions .

 1. How do I get struts log4j messages on my console/my log ?
 2. How do I read application specific properties file in struts
 application?

Instructions on how to use and configure Log4j are available on
http://logging.apache.org/log4j/docs/documentation.html

Once you've familiarized yourself with it, you can configure Struts
logs using org.apache.struts keys:

# Print only messages of level WARN or above from Struts.
log4j.logger.org.apache.struts=WARN

And you're already discussing Item #2 in another thread so I'll skip that.

Hubert

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




This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market
prices,
data and other information are not warranted as to completeness or 
accuracy
and
are subject to change without notice. Any comments or statements made 
herein

do not necessarily reflect those of JPMorgan Chase  Co., its subsidiaries 

and affiliates



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




This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein 
do not necessarily reflect those of JPMorgan Chase  Co., its subsidiaries 
and affiliates



RE: Two questions.

2006-01-30 Thread Marco Mistroni
Hello,
Not sure then If I gave you right advice
With struts plugin, code that executes in the plugin is executed only 
ONCE Per application lifecycle.
You can load your properties int hat plugIn and stored them In the 
servletContext,s ot hat every action can then call
servlet.getServletcontext().getAttribute(your properties)

pls have a look at struts docs...

rgds
marco

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 30 January 2006 17:34
To: Struts Users Mailing List
Subject: RE: Two questions.

I am relatively new to struts based application development , I have basic 
app up. 
Now based my application requirement.

I have to do following 
1.  I have to put different browser request in a Request Q(SonicMQ) 
and then get reply by reading from Reply Q.
I already have utility config classes written which reads 
application properties file and establish Q connection and DB 
connection(DB   connection for  reading  some config info.)
2.  What I would like to do is from setup action obtain  application 
properties file handle and pass this Application properties file handle to 
config  utility class which  establishes Q and DB connection.
3.  This Q and DB connection then should be available for application 
life for that browser session.

I am not sure If I am proceeding right direction by writing Dao object 
which reads from Action class what is request and initializing Q/DB and 
processing request by putting/reading from Q.

I didn't understand how/what should i do to write a struts plug-in.
Thanks for looking at this.


Digant 




Marco Mistroni [EMAIL PROTECTED]
01/30/2006 11:59 AM
Please respond to Struts Users Mailing List

 
To: 'Struts Users Mailing List' user@struts.apache.org
cc: 
Subject:RE: Two questions.


Hello, 

You want to configure MQ series Q and DB? 
For which purpose?
Aren't htosep roperties  server-related properties?

If your code is dependent on those things, write a plugIn that read
A configuration file and initializes your objects with proper values..
Ideally, those values should have application scope..so Struts PlugIn
Should do what you need

Rgds
 marco

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 30 January 2006 16:38
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: Re: Two questions.

Hubert:
Thanks for your response !
As I haven't got any answer for my 2nd question, if you can 
respond with this thread or newer thread would give me jump start on issue 

of  application properties file.
In my application I need to read from application properties file 
very specific to application and pass it to my application configuration 
object
so I can initialize MQ Series Q and DB and so forth.
Pls. let me know how would I read more than one properties file. 
and can have access to file from Action Class so I can pass this handle to 

properties file to another helper class.
Thanks.
Digant




Hubert Rabago [EMAIL PROTECTED]
01/30/2006 10:42 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List user@struts.apache.org
cc: 
Subject:Re: Two questions.


On 1/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 Very simple two questions .

 1. How do I get struts log4j messages on my console/my log ?
 2. How do I read application specific properties file in struts
 application?

Instructions on how to use and configure Log4j are available on
http://logging.apache.org/log4j/docs/documentation.html

Once you've familiarized yourself with it, you can configure Struts
logs using org.apache.struts keys:

# Print only messages of level WARN or above from Struts.
log4j.logger.org.apache.struts=WARN

And you're already discussing Item #2 in another thread so I'll skip that.

Hubert

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




This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market
prices,
data and other information are not warranted as to completeness or 
accuracy
and
are subject to change without notice. Any comments or statements made 
herein

do not necessarily reflect those of JPMorgan Chase  Co., its subsidiaries 

and affiliates



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




This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any

Re: Two questions: validation

2004-06-20 Thread Niall Pemberton
1) You could either validate the page number in each of your Actions or in
the ActionForm. If you do it in the ActionForm the validate() method has the
ActionMapping, so you could check if the mapping name ties up with the page
number.

String action = mapping.getName();
   if (page == 1  !(/myFirstAction.equals(action)))
   errors.add(...)

Or you could do it in each of your actions in the execute() method...

   public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest,

HttpServletResponse) {

 ActionErrors errors = new ActionErrors();
 if (form.getPage() != 4) {
 errors.add();
 }
 saveErrors(request, errors);
 if (errors.size()  0)
return mapping.getInputForward();

 }

2) I think it would be a pain to access validator using the Struts
functions - they need it to be configured first, which is done in the XML
file. You could access the Commons Validator functions yourself directly
though:

 Float result = GenericTypeValidator.formatFloat(value);
 if (result == null) {
errors.add(field.getKey(), Resources.getActionMessage(request,
va, field));
}

Niall

- Original Message - 
From: Jacob Weber [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, June 20, 2004 3:26 PM
Subject: Two questions: validation


 I have two questions on Struts' validation.

 1. Let's say I have a multi-page form. Each JSP in the form points to a
 different action (or a different method of a DispatchAction), and passes
 the current page value to the action. It's possible for someone to
 pass the wrong value of page to an action (e.g. by passing it in the
 URL). This means that someone could call the final action in the
 sequence, pass page=0, and bypass all the validation. What's the
 recommended way to prevent this?

 2. I have some validation rules that should only be checked under
 certain conditions. So I'm overriding the ValidatorForm.validate()
 method. Is there a clean way to access Struts' validation functions like
 validateFloat from this method, so I don't have to rewrite them?

 Thanks for any help,
 Jacob


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