Tarun Oohri

Ranch Hand
+ Follow
since Feb 20, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
13
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tarun Oohri

Hello Everyone
I am trying to give page number to merged pdf , but when i do so , it disturbs the font of the original document. Following is the code i am using to print page number. Is is possible to somehow print page number without mentioning the font name ?

Thanks in Advance

Matthew Brown wrote:Reflection is the way to do this - in particular you'd want to look at the methods in the java.lang.Class class.

But reflection isn't really a beginners topic, and it's entirely possible that the best solution to what you want doesn't involve dynamic class names at all. If you explain why you're trying to do this we may be able to suggest a better approach.



Thank you Sir for replying . Actually i have 3 classes, ExtractPDF_1,ExtractPDF_2,ExtractPDF_3, each of which extract data from the uploaded PDF...Now if a user upload a PDF,
by default it goes for extraction to ExtractPDF_1...Now if this file is not able to extract fully ...it should go to other file and so on ... for this i want instantiate in for loop...Hope i am able to clarify what i want to do..
8 years ago
Hello Everyone
I want to create an object of a class dynamically in a for loop...eg:
I have 3 classes...MyClass1, MyClass2, MyClass3....Now, i want to create an object of it using for loop ..eg :
for(int i = 1; i < 4 ; i++){
MyClass+i obj+i = new MyClass+i();
}
i Know my code is completely wrong .... but not able to get the solution....Reflection concept also not giving the solution ...
Thanks in Advance!!!
8 years ago
Hello Everyone,
I was just going through 'Isolation' property of Transaction (ACID). It states that, No two transaction should occur at the same time so as to avoid mixing up of intermediate data. So another transaction should start when the former has been completed on that database. So my question is that, should we keep the 'transaction' code in Synchronized block, so that only one request could do transaction at a time ?
Regards

Paul Clapham wrote:Yes, that's the next thing I expected to have to say. Why do you have a list of different types of objects? In fact why do you have a list at all?


Actually this list is being used to show set of data from the database, showing it in tabular way. That's why using list.
9 years ago
JSP

Paul Clapham wrote:Okay, then why don't you convert it to an integer when you add it to the list?


Thanks Paul , this could be possible solution. Actually that is is like List<String>, so have to remove this type safety and allow list to contain different type of objects .... Is that what you are trying to say ?
9 years ago
JSP

Thanks Bear Sir for replying .. 'totalAmount' is a String because it is being iterate from a list containing String objects , 'totalAmount' is one of the values from that list. Secondly i am using 'set' action so i could use it as a variable eg: <c:when test=""> tag. I would like to add that both the above code statements were not written in such order...2nd statement is written somewhere below , thats why i put 'totalAmount' value in a variable.

Any solution to this please?
9 years ago
JSP
Hello Everybody,
I am having problem in converting JSTL variable into integer type in JSP (not using Spring). I am looking to do something like below:

Thanks In Advance!!
Cheers
9 years ago
JSP
Hello Everyone,
I am trying to generate a pdf file using Jasper Report tool in NetBeans. The problem i am facing is that, we have hindi entry in database..In order to show that data in JSP i have set page content to UTF-8 and its showing properly.
But while generating its pdf report, i am exporting the data in bytes using ServletOutputStream & in Jasper Report i am using 'Mangal' font..the point is it is not showing exact data as saved in database.
9 years ago
Hello Everyone,
Following is the code i am facing problem to understand. Here we are making 2 threads from the 'main' thread , which contains Input Stream & Output Stream of the Socket respectively.


Now when i run both files (ie. server side & client side) & try to send data from server to client through console , following is the output of the server

Question1. On the 7th line of the output , when the 'Server Input Thread' stops executing & the 'main' thread comes in 'Waiting for Client to connect...' gets printed by the main thread, then why doesnt the next line ' Client connected. IP: /192.168.1.15' got printed. Is it because at that perticular time 'Server Input Thread' started executing ?
Question2. When i sent 'Hello Client'...Everything goes fine but when i enter 'Tarun' , then why doesnt the following gets print before printing 3 ?
"2 Current Thread is : Server Output Thread
AFTER TAKING INPUT FROM CONSOLE "

Thanks In Advance!!!
Hi Vikram, i want to know that, such kind of making a thread and invoking a start() ... Does it confirm that the thread's run() will be invoked right after start() is executed ?

In the above code , ServerResponder & ServerResponseReader are classes which extends Runnable interface. Is it sure that run() of ServerResponder will be executed before that of ServerResponseReader class ?

Thanks In Advance
Thanks Vikram for your feedback...i will go through anonymous class & shall try to understand in that prospective.
Regards!!!
Hello Everybody
What i know is that to make a thread , we need a Thread class Object

I want to know how the following code functions. We are making an object of Thread class. In parameters we are suppose to pass the object of the class which implements Runnable interface. But here we are passing the object of interface... How can we make an object of an interface usng new keyword ?? How is this run() override here. Please explain me the code.

Thanks In Advance !!
Hello Everyone
I am making a web application based on servlet, JSP, JSTL.
I am applying security based on the roles, So i want a dynamic menu bar based on the role assigned. Please help me to know how to do it.
Thanks in Advance!!
Tarun
9 years ago
Thank you everybody for making me understand ... I really apritiate your help...but I could not understand one thing ...
class A{}
class B extends A{}
class C extends B{
public static void main(String...s){
C c = (new C())(new B())new C();
}
}
Here we are first casting c into b...which is OK.. Now at this stage ..the object is of b...ie.
C c = (new C())b; where b refers to B object.
Now how can we cast B into C ???
9 years ago