Win a copy of Head First Android this week in the Android forum!

Saurabh KumarD

Greenhorn
+ Follow
since Jul 23, 2009
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 Saurabh KumarD

Hi,
Can anyone please suggest any book which is good at core java concepts at JVM level. Such as how threading, collection etc and object creation/ destruction work at JVM level.

Please advise.

Thanks
Saurabh
11 years ago
Hi,

Could anyone please suggest any good book/ reading material/ online books / link etc on Java / J2EE performance optimization and code optimization.

Thanks
11 years ago
Hi,

I am working in a scenario in which on a JSP page, I am including static html files using jsp: include (Since jsp file names are to be determined at run time). These static html files have some text and some radio buttons.

On the page I select a radio button and submit. I am using struts framework. I reached to a next page. Where I have a button which takes me to previous page again using struts action.

I want that now again on reaching the page, my previously selected radio value should be displayed to me. I have tried setting the selected value in the form. But it didn’t work.

Can anyone please help me in this scenario?

Thanks
Saurabh
11 years ago
Hi,
I am working with a registration form.
Currently when I press submit button and if any input is wrong , I am redirected to same page with all the previously filled fields blank. I want that my previously filled value persist.

Can any one help me out , how to achieve this is Java. I am using Java, .page file and xsl for rendering things. I can't use PHP for this.
Either I can do this on my xsl file or on Java script.

Please help. I do urgently need this.

Thanks
Saurabh
12 years ago
Hi,

I want to write alert boxes/ pop up message in java, without using Java Script and Swing.

Can anyone please provide me the sample code snippet to do this.

Thanks
Saurabh
12 years ago

Rob Prime wrote:

David Newton wrote:Calling methods via reflection is pretty straight-forward; where are you stuck?


There is your answer: reflection. You get a property xxx, you capitalize it to Xxx, prepend get, and call the method through reflection.



Please explain the last part , how to call the method through reflcetion. Please put some sample code.

Thanks
12 years ago
Thanks for your help.
But actually my problem is different. I know the class , property and getter & setter names.

I want to dynamically call setter method.

Say in a loop I am getting xx=lastName, xx=fisrtName, xx=age, etc in different iteration.

I want to call setxx(); method for all these. And I want that It will take xx dynamically.

Please help.

12 years ago
I m not sure how to call. Please provide a illustration in the code.

Thanks your help would be much appriciated.
12 years ago
Hi,

I want to dynamically generate Setter Name in my Application. I am getting name of attributes somewhere in the class . I want to call corresponding setter name .
I know reflection can be helpful in this.

Please illustarte with some fine code.

Ex- Suppose I am getting retriving name,age, gender, height etc from some code in my class. Now I want to run setName() when I get name and setAge() when I get age . I want all this to happen dynamically.

Please help. I need this very urgent.

Thanks
12 years ago
Could you please illustrate what to do for ordered list by using some sample code.

Thanks please
12 years ago
List<a> A= some code here to retrive List A --- A has 11 elements
List<b> B= some code here to retrive List B --- B has 10 elements

Iterator<a> ItrA=A.iterator();
Iterator<b> ItrB=B.iterator();

int count=0;

while(A.hasNext()){

a=A.next();

System.out.println("Some Label corresponding to A" + a.someLabel);
while(B.hasNext()){

b= B.next();
System.out.println("Inner While Loop Count" + ++count);
System.out.println("Some ID for Corresponding Value in A"+ a.someGetID());
System.out.println("Some ID for Corresponding Value in B"+ b.someGetID());

// Apart from 1 problamatic case these ID's are equal

if(a.someid().equals(b.someid())){


Do something;

}



break;

}
}




Sample Output -

Label 0
Inner While Loop Count1
ID in A - 000
ID in B - 000

***********************************************************************************
Label 1
Inner While Loop Count2
ID in A - 001
ID in B - 001
***********************************************************************************
Label 2
Inner While Loop Count3
ID in A - 002
ID in B - 002
***********************************************************************************
Label 3
Inner While Loop Count4
ID in A - 003
ID in B - 003
***********************************************************************************
Label 4
Inner While Loop Count5
ID in A - 004
ID in B - 004
***********************************************************************************
Label 21
Inner While Loop Count6
ID in A - 021
ID in B - 005
***********************************************************************************
Label 6
Inner While Loop Count7
ID in A - 006
ID in B - 006
***********************************************************************************
Label 7
Inner While Loop Count8
ID in A - 007
ID in B - 007
***********************************************************************************
Label 8
Inner While Loop Count9
ID in A - 008
ID in B - 008
***********************************************************************************
Label 9
Inner While Loop Count10
ID in A - 009
ID in B - 009
***********************************************************************************
Label 5

12 years ago
Hi Please help me solving following problem.

I have 2 Lists.

Say List A and List B.
In List A there are 11 elements and in List B there are 10 elements.
In List 10 elements are having a property which matches properties of 10 elements in List B respectevly.

And one element in List A is extra.

But the problem is that extra come in the middle say 5th element.

So whats hapeening when I am iterating both the list List A as outer and B as Inner, when the A comes to 5th element it ingners List B and moves ahaed . and does fine for rest.

So the problem is even 5th ele which is coming last in List A is never get printed even though it has corresponding matching in List B, because at that time List B is exhausted.

Please help its very urgent for me.
12 years ago