venkatesh loganathan

Greenhorn
+ Follow
since Aug 24, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by venkatesh loganathan

Hi all
Iam not able to log messages to a file when i try to access log information froma file.I have a log4jconfig -- file like below
---------------------------------------------------------------------------

log4j.rootLogger=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F\:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
---------------------------------------------------------------------------

And my program which reads this file for logging goes like this



final Logger logger = Logger.getLogger(EditShopperAction.class);
PropertyConfigurator.configure("LogConfig.properties");
logger.debug("Here is some DEBUG");
logger.info("Here is some INFO");
logger.warn("Here is some WARN");
logger.error("Here is some ERROR");
logger.fatal("Here is some FATAL");



Can someone help me in this.

Thanks in advance

Venkatesh Loganthan
17 years ago
Hi all
I have to sort a collection of objects based onthe object property.If the object has firstname as a member then sortg should be based on that.Any hep regarding this.

Venkatesh Loganthan.
17 years ago
Hi all
I have to sort a collection of objects based onthe object property.If the object has firstname as a member then sortg should be based on that.Any hep regarding this.

Venkatesh Loganthan.
17 years ago
Hi all
Iam not able to log messages to a file when i try to access log information froma file.I have a log4jconfig -- file like below
---------------------------------------------------------------------------

log4j.rootLogger=debug, stdout, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F\:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
---------------------------------------------------------------------------

And my program which reads this file for logging goes like this



final Logger logger = Logger.getLogger(EditShopperAction.class);
PropertyConfigurator.configure("LogConfig.properties");
logger.debug("Here is some DEBUG");
logger.info("Here is some INFO");
logger.warn("Here is some WARN");
logger.error("Here is some ERROR");
logger.fatal("Here is some FATAL");



Can someone help me in this.

Thanks in advance

Venkatesh Loganthan
17 years ago
Hi all
Iam not able to log messages to a file when i try to access log information froma file.I have a log4jconfig -- Logconfig.xml file like below
---------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<appender name="cmeAppender"
class="org.apache.log4j.FileAppender">
<param name="File" value="Indentify-Log.txt"/>
<param name="Append" value="false"/>

<layout class="org.apache.log4j.PatternLayout"/>
</appender>

<root>
<priority value="debug" />
<appender-ref ref="cmeAppender"/>
</root>

</log4j:configuration>
---------------------------------------------------------------------------

And my program which reads this file for logging goes like this



final Logger logger = Logger.getLogger(EditShopperAction.class);
PropertyConfigurator.configure("LogConfig.xml");
logger.debug("Here is some DEBUG");
logger.info("Here is some INFO");
logger.warn("Here is some WARN");
logger.error("Here is some ERROR");
logger.fatal("Here is some FATAL");

---------------------------------------------------------------------------

Both my xml and jav pgm are in the same path .Even then iam not able to record the log messages int oa file.

When not specified in external configuration its working fine (i.e programatically logging) .What could be the resaon for this.Can anybody help me out regarding this .Do i need to make any other entry in struts-config.xml etc...

Iam using xdoclet and ant for JBoss 3.2.4 server.


Thanks in advance

Venkatesh Loganathan
17 years ago
Hi all
Iam using validation.xml for validation.The problem here is if i have a Action class and its corresponding form (which has an entry in validation.xml)

Eg:
-------------------------------------------------------------------------
/*@struts.action path = "/editCustomer" name = "editForm" scope = "request" validate="true" input="ErrorEdit"
*
* * @struts.action-forward name = "ErrorEdit" path="editShopperTile"
*
*/
public class EditShopperAction extends AbstractAction{
public void execute(StrutsActionContext actionContext) {
---------------------------------------------------------------------------
Form Bean

/**
* @struts.form name="editForm"
*/
public class EditForm extends ValidatorForm {
private String etelephone;
/**
* @struts.validator type="required" msgkey="CustomerForm.telephone"
**/
public void setEtelephone(String etelephone) {
this.etelephone = etelephone;
}
---------------------------------------------------------------------------

Problem
-------
When my action class gets loaded it checks fro validate =true and validation is performed before entering values.Here for eg telephone ..while the form is loaded telephone =null and hence it showing me the validation failure result.

How to skip validation in this case.

Im using two action class for this.One for displaying the filling form and other to check validation.

Can anyone give me a solution to this

Thanks in advance

Venkatesh Loganathan
17 years ago
Hi all

I have two fields my form bean.I want to validate for any of them should be not be null i.e either of them should be selected.

Im using validatorForm.

Any help regarding this

Venkatesh Loganathan
17 years ago
This is regd my previous mail on list box validation .FYI im using one form for all of my action classes.
17 years ago
Hi all
Im having a search page .USer selects the serach criteria from the list box(say telephone and zip are the criteria) and enters the value in a text box.

I want to validate for the user should select atleast one criteria from that and the value he entered should be validated for valid telephone or zip.

Can anyone help me out.

Thanks in advance
Venkatesh Loganathan
17 years ago
Hi all
My code is working.The problem was with input attrbute for which i made a separate entry in to my struts-config.xml using relative path

Any idea o email validation.Shud we need to ad our own rules n validator-rules.xml

Thanks
17 years ago
Hi
This is my 3rd message to the forum.I think my super class validate() is not returning any error thats y the im not directed to the page indicated by the input attribute
17 years ago
On validation failure my struts application is displaying a blank page

No exceptions or errors are thrown

I have included <html:errors> in the jsp which is used fpr the input attribute.

Any help regarding this

Thanks in advance

Venkatesh Loganathan
17 years ago
Hi
Iam trying to validate a field for null in my form(Shopperform).When i give null values to it and submit the validation is taking place but no error page is displayed

I have generated all the required in struts-config.xml.When the input attribute is set to some tile iam getting a blank page if i remove the inut attribute its showing me 404 error.

Iam attcahing all the required files .can anyone pls help me out ..really i didnt sleep for the past 3 dys

Shopperform extends validatorForm
-------------
/**
* @param telephone
*
* @struts.validator type="required" msgkey="CustomerForm.telephone"
*/
public void setTelephone(String telephone) {
this.telephone = telephone;
}

Strtus-config
-------------
<action
path="/createCustomer"
type="com.cme.customer.CreateShopperAction"
name="customerForm"
scope="request"
input="showShopperTile"
unknown="false"
validate="true"
>

The pblm is with the input attribute.ITs not taking to that page.


My Action Class that saves customer Info ...Pls see whether the info i entered is correct
17 years ago
Hi
Iam trying to validate a field for null in my form(Shopperform).When i give null values to it and submit the validation is taking place but no error page is displayed

I have generated all the required in struts-config.xml.When the input attribute is set to some tile iam getting a blank page if i remove the inut attribute its showing me 404 error.

Iam attcahing all the required files .can anyone pls help me out ..really i didnt sleep for the past 3 dys

Shopperform extends validatorForm
-------------
/**
* @param telephone
*
* @struts.validator type="required" msgkey="CustomerForm.telephone"
*/
public void setTelephone(String telephone) {
this.telephone = telephone;
}

Strtus-config
-------------
<action
path="/createCustomer"
type="com.cme.customer.CreateShopperAction"
name="customerForm"
scope="request"
input="showShopperTile"
unknown="false"
validate="true"
>

The pblm is with the input attribute.ITs not taking to that page.


My Action Class that saves customer Info ...Pls see whether the info i entered is correct
17 years ago