kannan coding

Greenhorn
+ Follow
since Nov 19, 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 kannan coding

My code is compiled in java 1.4 version. I need to run this code in Java 1.6 browser.
How to do that?
I am facing some problem with Stream if I run the java1.4 version code in Java 1.6 enabled browser.
Kindly provide your suggestions on this issue..........
10 years ago
I am using the below code

public boolean checkUniqueness(ssg.net_pro.cables.CableRecord cr) throws Exception, java.rmi.RemoteException {

String mName = "checkUniqueness";
Class[] pType = { CableRecord.class };
Object[] pValue = { cr };

Object obj = getObject( new Serializable[] { mName, pType, pValue } );
return (obj != null) ? ((Boolean)obj).booleanValue() : false;
}

I got the StreamCorruptedException in the getObject line.

public Object getObject(Serializable[] objs, boolean cache) throws java.lang.Exception
{
DataProxyCache dpc = null;
Object obj = null;

if( cache ){
dpc = DataProxyCache.getInstance();
obj = dpc.getObject(objs);
}

if(obj == null){
ObjectInputStream in = postObjects(objs);
obj = in.readObject();
if( cache )
dpc.cacheObject(objs, obj);
in.close();
}

return(obj);
}

The inputStream is properly closed and i am returing the obj too. It was working these many days.
Now suddenly it's throwing exception as below

Save failed. Internal Error: java.io.StreamCorruptedException: invalid type code: 0D
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at ssg.eiu.rmiproxy.DataProxy.getObject(DataProxy.java:69)
at ssg.eiu.rmiproxy.DataProxy.getObject(DataProxy.java:47) at

Confused what does OD means here?
I tried restarting the server, but that too did not help.
Please provide your suggestions on this.
10 years ago
In our production env they have done some security patch update and new rt.jar file is used for this.
Do we require to recompile our java code for this new rt.jar file and deploy in server?
Or it is enough to restart the webserver?

Please provide your valuable inputs...........
10 years ago
I have a jsp which has html:text boxes which are indexed. When the user enters some value in the text box how to get those values in the action class of struts.
for example:
<logic:iterate id="XXX">
<html:text name="XXX" property="YYY" indexed="true"/>
</logic:iterate>

Now i need to access the value of this indexed html:text inside my action class

public class action extends Action{
???
}
and also the getter and setter method's for the property "YYY"

Kindly help me in this.
12 years ago
Thanks for your reply

i used removeAll() and got the result

list1.removeAll(list2) worked out thanks
13 years ago
I get the solutions as follows:
package com;

import java.util.*;
public class sample2 {
public static void main(String[] args){
ArrayList ar1 = new ArrayList();
ar1.add("1");
ar1.add("13");
ar1.add("16");
ArrayList ar2 = new ArrayList();
ar2.add("16");
ar2.add("5");
ar2.add("1");
ar2.add("13");
ar2.add("7");
ar2.add("9");
ArrayList ar3 = new ArrayList();
ar3.add("16");
ar3.add("5");
ar3.add("1");
ar3.add("13");
ar3.add("7");
ar3.add("9");
System.out.println("List 1: " + ar1);
System.out.println("List 2: " + ar2);
System.out.println("List 3: " + ar3);

Iterator itr1 = ar1.iterator();
Iterator itr2 = ar2.iterator();

while(itr1.hasNext()){
String id1 = (String)itr1.next();
while(itr2.hasNext()){
String id2 = (String)itr2.next();

if(id1!=null && id2!=null){
if(!id1.equals(id2)){
ar3.remove(id1);
}
}
}
itr2 = ar2.iterator();
}
System.out.println("Final list:" + ar3);
}
}

Kindly Provide me a better solution.
13 years ago
I get the solutions as follows:
package com;

import java.util.*;
public class sample2 {
public static void main(String[] args){
ArrayList ar1 = new ArrayList();
ar1.add("1");
ar1.add("13");
ar1.add("16");
ArrayList ar2 = new ArrayList();
ar2.add("16");
ar2.add("5");
ar2.add("1");
ar2.add("13");
ar2.add("7");
ar2.add("9");
ArrayList ar3 = new ArrayList();
ar3.add("16");
ar3.add("5");
ar3.add("1");
ar3.add("13");
ar3.add("7");
ar3.add("9");
System.out.println("List 1: " + ar1);
System.out.println("List 2: " + ar2);
System.out.println("List 3: " + ar3);

Iterator itr1 = ar1.iterator();
Iterator itr2 = ar2.iterator();

while(itr1.hasNext()){
String id1 = (String)itr1.next();
while(itr2.hasNext()){
String id2 = (String)itr2.next();

if(id1!=null && id2!=null){
if(!id1.equals(id2)){
ar3.remove(id1);
}
}
}
itr2 = ar2.iterator();
}
System.out.println("Final list:" + ar3);
}
}

Kindly Provide me a better solution.
13 years ago
I have 2 list.

for example, list1 has [2,14]
list2 has [2,8,34,7,14,6]

Now need the output as follows [8,34,7,6]

i.e to remove the values of list1 from list2.
Kindly help me to solve this.
13 years ago
I have 2 list.

for example, list1 has [2,14]
list2 has [2,8,34,7,14,6]

Now need the output as follows [8,34,7,6]

i.e to remove the values of list1 from list2.
Kindly help me to solve this.
13 years ago
What do you mean by this statement "you'll have to add logic that will simulate their submission"
13 years ago
Java script can be used if the results are in one page. Since i am using pagination logic only while requesting the next page i will get the next sequence of records from database, in that case how can i maintain all the check box values in my form.
13 years ago
My search action returns results as per pagination(i.e if 100 records are there, 10 records per page is displayed) and each record or a row of the search result will have a check box and it has a unique id.

Now i need select all the check boxes present in all the pages i.e if 10 pages are there i.e totally 100 records, all the 100 check boxes should be selected on click of one check box in the first page.
All the final operation(add/delete/update) should consider all these check box ids which are checked for further operations.

And if the user deselects one check box the final action should not consider that unchecked box id.

How can i proceed with this. Give me some logic for doing this.

Can i have a temp table to have the status and check box id or is there any other easy way of doing this.

Thanks in advance.
13 years ago