Apna Apana

+ Follow
since May 01, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Apna Apana

Hi All,

Can some one tell me where to put the jsp precompilation build file(build.xml) in the Tomcat 7 structure.
I have a web application called myapp which is inside webapps folder and has bunch of jsp files, I want to precompile them using the following script.

Right now I have this build file called build.xml inside the build folder in myapp. So final structure is myapp has bunch of jsp files and a build folder with build.xml to precompile the jsps.
When I run the above build.xml using ant I get the following error.

I have debugged the jasper.jar code and identified that the build.xml is not finding the jsp files. Please correct me if I'm wrong .
So my question what is wrong with my build.xml and why is that jasper 2 task not finding the jsp files and how to tell the jasper2 task about the jsp files.

Thanks in Advance!!!
Please Help me
I am stuck and eagerly waiting for the reply.

11 years ago

First of all Thanks for you reply.
I know that Streams are capable of dealing with character data. But how can I create a OutPutStream writer object or PrintWriterObject with out using files.
Another question is if I use ByteOutputStream is chinese data going to be messed up as ???.

Thanks in Advance
11 years ago
Hi All,

I need an OutPutStreamObject or even PrintWriter object with out using files and which supports chinese characters(unicode)

Thanks in Advance

11 years ago
Hi suresh,
you are correct.Please give me the clear explanation for the error.
Hi all,

The following code gives error:

public static int m1()
int i;
return 1;

Please clarify my doubt.

Thanks in advance.
Hi Ramesh,
I forget that point.Anyhow thank you.
Hi Manfred Klug,
Ya i got it but what is the difference between
Frog f;
Frog f=null;

Thanks in advance
Actually my doubt is when we create a reference means why don't we call the static members of the class referenced i.e., of class type(as K&B said)
According to K&B,

class Frog {
static int frogCount = 0; // Declare and initialize static variable
public Frog() {
frogCount += 1; // Modify the value in the constructor
class TestFrog {
public static void main (String [] args) {
new Frog();
new Frog();
new Frog();
System.out.print("frogCount:"+Frog.frogCount); //Access static variable

The book says that,we can access Static Member as follow:
Frog f = new Frog();
int frogs = f.getFrogCount;
ans explanation is given that:This is merely a syntax trick to let you use an object reference
variable (but not the object it refers to) to get to a static method or variable, but the
static member is still unaware of the particular instance used to invoke the static
member. In the Frog example, the compiler knows that the reference variable f is of
type Frog, and so the Frog class static method is run with no awareness or concern
for the Frog instance at the other end of the f reference.

My doubt is (according to above statement) i cannot access the getFrogCount as:
Frog f;
int frogs = f.getFrogCount;
This gives me a compiler error:the local object f is may not have been intialise.I feel that as getFrogCount is static ,we don't want it to be intialised.

Thanks in advance
Sorry I didn't see FAQs

Anyhow Thank You!!!
Can you please explain abt Synchronization and thread communication.
Actually i have seen an example like this:

class JSC202 {
static byte m1() {final short s1 = 2; return s1;} // 1
static byte m2(final short s2) {return s2;} // 2
public static void main(String[] args) {
short s3 = 4;
System.out.print(""+m1()+m2(s3)); // 3

where is error?
Ans: Compile time Error at line 2.

Please justify the answer.

Is it that any final variable is a compile time constant or a static final variable is only the compile time constant.