Win a copy of Terraform in Action this week in the Cloud forum!

swati mittal

Ranch Hand
+ Follow
since Oct 21, 2008
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 swati mittal

hi
i am implementing a functionality where user can browse his picture in the midlet form i.e user's profile which is having fields like user name, first name, last name , photo etc.
Please tell me how to add a picture in midlet form which is there in user's phone.

Thanks in advance
12 years ago
I am new for J2ME so please tell me how we will connect using servlet.
can you send me the sample code or relevant link.
12 years ago
I am working on application where i need to connect J2ME with mySql database.
How to make this connectivity.
Please let me know ASAP.

thanks in advance []
12 years ago

Moojid Hamid wrote:

swati mittal wrote:

Vinoth Thirunavukarasu wrote:The bellow code will help you.

Example
give your functionality bellow run method will run at the specified time.



I am trying to run the example given by you.
but it is giving error --

The java class could not be loaded. java.lang.UnsupportedClassVersionError: Schedule (Unsupported major.minor version 49.0)


please help me how i can run the same program as it is.



It means you are running a java class file that was compiled with newer version of JDK. You need to upgrade to newer version to be able to run this code. If you are already running latest version check your PATH and JAVA_HOME environment variables.




Thanks a lot......
I was using wrong jre libraries.
12 years ago

Vinoth Thirunavukarasu wrote:The bellow code will help you.

Example
give your functionality bellow run method will run at the specified time.



I am trying to run the example given by you.
but it is giving error --

The java class could not be loaded. java.lang.UnsupportedClassVersionError: Schedule (Unsupported major.minor version 49.0)


please help me how i can run the same program as it is.
12 years ago

Vinoth Thirunavukarasu wrote:Thanks for your reply.
Yes, I want to make log4j.


Using Log4j :
Download the log4j software (http://logging.apache.org/log4j/1.2/download.html) and extract log4j.jar out of it. Include log4j.jar in your application's classpath so that logging methods can find the needed classes. Save the following sample code in a file named TestLogging.java somewhere in the classpath.
import org.apache.log4j.*;

// How to use log4j
public class TestLogging {

Static Logger logger=Logger.getLogger (TestLogging.class);
public static void main(String args []) {
// Try a few logging methods
logger.debug ("Start of main ()");
logger.info("Just testing a log message with priority set to INFO");
logger.warn("Just testing a log message with priority set to WARN");
logger.error("Just testing a log message with priority set to ERROR");
logger.fatal("Just testing a log message with priority set to FATAL");
}
}
Log4j by default can log messages with five priority levels.
1. Use debug to write debugging messages which should not be printed when the application is in production.
2. Use info for messages similar to the "verbose" mode of many applications.
3. Use warn for warning messages which are logged to some log but the application is able to carry on without a problem.
4. Use error for application error messages which are also logged to some log but, still, the application can hobble along. Such as when some administrator-supplied configuration parameter is incorrect and you fall back to using some hard-coded default value.
5. Use fatal for critical messages, after logging of which the application quits abnormally.
The default file which configures log4j is log4j.properties in the same directory as TestLogging.class.
Sample log4j.properties is :

# ROOT CATEGORY is used to set level of logger and appender name
log4j.rootCategory=DEBUG, CA, RA
# DEBUG is a root level and FA, CA, DA are appender name (appender name can be different)

# ---------- CA is set to be a ConsoleAppender ----------

# Write to Console(stdout or stderr).
log4j.appender.CA=org.apache.log4j.ConsoleAppender
# This appender will only log messages with priority equal to or higher than the one specified here
# hierarchy of level is (from lower to higher): DEBUG,INFO,WARN,ERROR,FATAL
log4j.appender.CA.Threshold=INFO
# appender layouts (log formats)
#log4j.appender.CA.layout=org.apache.log4j.SimpleLayout
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
# For a pattern layout, specify the pattern (Default is %m%n which is fastest)
log4j.appender.CA.layout.ConversionPattern=[%-5p] %c - %m%n

# ---------- RA is set to be a RollingFileAppender ----------

# Write log to a file, roll the file after some size
log4j.appender.RA=org.apache.log4j.RollingFileAppender
# This appender will only log messages with priority equal to or higher than the one specified here
log4j.appender.RA.Threshold=INFO
# The name of log file
log4j.appender.RA.File= C:/log4j.log
# The maximum log file size
log4j.appender.RA.MaxFileSize=100KB
# Don't append, overwrite
#log4j.appender.RA.Append=false
# Keep backup file(s) (backups will be in filename.1, .2 etc.)
log4j.appender.RA.MaxBackupIndex=1
# appender layouts (log formats)
#log4j.appender.RA.layout=org.apache.log4j.SimpleLayout
log4j.appender.RA.layout=org.apache.log4j.PatternLayout
# For a pattern layout, specify the pattern (Default is %m%n which is fastest)
log4j.appender.RA.layout.ConversionPattern=[%-5p] %c - %m%n

# ---------- DA is set to be a DailyRollingFileAppender ----------

# Write log to a file, roll the file every week
#log4j.appender.DA=org.apache.log4j.DailyRollingFileAppender
# This appender will only log messages with priority equal to or higher than the one specified here
#log4j.appender.DA.Threshold=ERROR
# The log file name
#log4j.appender.DA.File=C:/log4j.log
# Don't append, overwrite
#log4j.appender.DA.Append=false
# Rollover log file at the start of each week
#log4j.appender.DA.DatePattern='.'yyyy-ww
# appender layouts (log formats)
#log4j.appender.DA.layout=org.apache.log4j.SimpleLayout
#log4j.appender.DA.layout=org.apache.log4j.PatternLayout
# For a pattern layout, specify the pattern (Default is %m%n which is fastest)
#log4j.appender.DA.layout.ConversionPattern=[%-5p] %c - %m%n

ConsoleAppender will print logger at console. Here 2 more Appenders are used named RollingFileAppender, and DailyRollingFileAppender to print into file. At a time use one Appender according to the requirement. Here RollingFileAppender is used to print logger into a file at given path, here appender name RA is declared for RollingFileAppender. To use DailyRollingFileAppender declare the appender name in log4j.rootCategory DA instead of RA and open the comments of DailyRollingFileAppender.

12 years ago

Vinoth Thirunavukarasu wrote:

swati mittal wrote:

Vinoth Thirunavukarasu wrote:We can done this by using cron job.



but i am using linux environment and cron job works on linux.


Ya cron jobs works on linux.



sorry i want to say that i am using window environment.
12 years ago

Vinoth Thirunavukarasu wrote:We can done this by using cron job.



but i am using linux environment and cron job works on linux.
12 years ago
Hi,

I am going to make a program that will send the email to register user.
I just want to execute this program on monthly basis.
How it will be possible?
12 years ago

Bear Bibeault wrote:As with every other element, use the title attribute.



Thanks
Its working fine.
Hi,

I have one jsp page with some label and text field.
I want to show tooltip at any text box.
How i can implement tool tip in my page.

Thanks in advance.

Mansi. Mishra. wrote:

swati mittal wrote:thanks to both of you.

its working fine.
But My application is already using some other function at body onload so how i can use this one.
because there will be only one "onload"



you can have it semicolon separated....like this

<body onload="setFocusOnLoad();ajax(page,'scriptoutput');">

Mansi



Thanks mansi
12 years ago
thanks to both of you.

its working fine.
But My application is already using some other function at body onload so how i can use this one.
because there will be only one "onload"
12 years ago
@ lin qun

How i will call this javascript function.
Because I want to display date and time without clicking any where.
12 years ago