Frederik Ericsson

Ranch Hand
+ Follow
since Apr 27, 2005
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Frederik Ericsson

Hi Team,

I'm passing this msg "1234567HHHD" to mainframe MQ, that service accepts only 11 bytes as a input, the mainframe guy debug and said that he is getting 83 bytes, so it fails.
"1234567HHHD". getBytes() // this is the code which I used to convert.


when I print it shows the length 11, but something I missed, am not sure what and how to get it. Please let me know if you need more information.

4 years ago
No worries, I got the answers from the previous posts, this may not work for all document/image formats, works well with .txt, I need to use something different. file1 size is equal to output file size.
4 years ago
Hi Team,

I want to ask your help since you might have gone through this before. I tried the SequenceInputStream, unfortunately it's not reading the second file, the result file shows only the XYZ file only, it didnt really add the other one. Please help me out on finding what I might have missed in this?


Vector files = new Vector();
FileInputStream f1 = new FileInputStream("C:\\FileNet\\XYZ.pdf");
FileInputStream f2 = new FileInputStream("C:\\FileNet\\documents\\ABC.pdf");
files.add(f1);
files.add(f2);
Enumeration enu = files.elements();
FileOutputStream fostream = new FileOutputStream("Result.pdf");
//InputStreamEnumerator e = new InputStreamEnumerator(files);
InputStream input = new SequenceInputStream(enu);
fostream.write(IOUtils.toByteArray(input));
input.close();
fostream.close();

Please let me know if you need more information on this.

Thanks
4 years ago
Sorry my mistake I got to define the FileOutputStream out of the loop. Still facing the same problem, please help me out.

File f=new File("textfile1.txt");
FileOutputStream fop=new FileOutputStream(f);

ContentElementList docContentList = doc.get_ContentElements();
Iterator iter = docContentList.iterator();
while (iter.hasNext() )
{
ContentTransfer ct = (ContentTransfer) iter.next();


// Print element sequence number and content type of the element
System.out.println("\nElement Sequence number: " +
ct.get_ElementSequenceNumber().intValue() + "\n" +
"Content type: " + ct.get_ContentType() + "\n");

// Get and print the content of the element
int docLen = ct.get_ContentSize().intValue();
byte[] buf = new byte[docLen];
InputStream stream = ct.accessContentStream(); //Everytime different contents are coming here, mean diff page everytime.
try
{
stream.read(buf, 0, docLen);
fop.write(buf); // here it writes only once.

}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
fop.flush();
fop.close();
8 years ago
Lets say if we have a document that has 4 pages. we are getting the Inputstream for every page. In the given code below , it gets the stream in loop for every page, but it is not writing it to the file more than once. I mean its writing only one page(1rst page). Is there anyway we can get 4 stream and write it to a image file? This coule be a great help if any one can give me working sample code.

ContentElementList docContentList = doc.get_ContentElements();
Iterator iter = docContentList.iterator();
while (iter.hasNext() )
{
ContentTransfer ct = (ContentTransfer) iter.next();
File f=new File("textfile1.txt");
FileOutputStream fop=new FileOutputStream(f);

// Print element sequence number and content type of the element
System.out.println("\nElement Sequence number: " +
ct.get_ElementSequenceNumber().intValue() + "\n" +
"Content type: " + ct.get_ContentType() + "\n");

// Get and print the content of the element
int docLen = ct.get_ContentSize().intValue();
byte[] buf = new byte[docLen];
InputStream stream = ct.accessContentStream(); //Everytime different contents are coming here, mean diff page everytime.
try
{
stream.read(buf, 0, docLen);
fop.write(buf); // here it writes only once.

}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
fop.flush();
fop.close();
8 years ago
Hi All,

there is one functionality in our project like, selecting set of customers based upon some criteria like date of purchase, dept, so and so...

Let us say in the first page get the dates, second page get the amount it will go upto next 4 pages , we ran the query with all the parametes from all the 6 pages and get the result to the last page. its taking long time to run it, because it really a big query with joins n very large table as well.

Now whar we are planning is when we get the date in the first page run the query and get the result, get the next parameter and run the query against the previous result with the current parameter and proceed furthur upto the last result page.

My question is

How can I store the result after running the query in each page, how to keep maintain for geting another parameter and run it ?

Its kind of confusing I know, but i would like to do it in this way..

Please do help me..

Thanks!!!
9 years ago
Hi Friends,

Is SCBCD1.3 exam is still available? I checked the sun website, it shows only SCBCD5.0

Any inputs please,

Thanks,
Frederik
Hello Friends,

I have a quick & challengin quesiton for you guys.

I have an application, in the first jsp page, if I press continue, the second page should load with two iframes, in the first iframe we have a recording applet, in the second iframe the first jsp aplication flows go on. This second iframe jsp contains (NEXT, BACK buttons). Here the issue goes.

once the two iframes get loaded. I want start the recording and do some stuff inn the second iframe, I may need to go back to the first do someother stuff while the recording goes on. once I finish my work with the previous page, I shoild go the second JSP page with any interuption of the recording.

Anyhow I managed to get the rcording application at the top of the page and in the second iframe am geting the previous application flow.

1.
Now, when I hit the back button am losing my first iframe recording, which I really want .
[ June 25, 2007: Message edited by: Bear Bibeault ]
timestamp=document.Display.record[count].value

document.DisplayRecords.action=****/***********.jsp?timestamp="+timestamp;
document.DisplayRecords.submit();
10 years ago
JSP
while am using getParameter(timestamp), it rerutns
2007-06-16%2019:16:57.798 while send this param to pull the record from DB.. there the issue goes...
10 years ago
JSP
Thanks N D Fisher & Bear Bibeault,

Actually I got the timestamp with %20 from the URL, I have to use this timestamp to retrieve the record from DB. automatic decode is not working, actually I have to compare this timestamp with the timestamps in DB, if i do it as it comes from URL it says no records found. if I do some work around its working... please let me know the proper way of doing...

can you please fix my issue...
10 years ago
JSP
Eric,

I was not working, I tried it in another way, top.frames['n'].functioname();

Frederik
Hello Friends

I am trying to retrieve the timstamp of certain set of records and display in a jsp. here it diplays the timestamp like this 2007-06-16 19:16:57.798.

from this jsp I have to select one record based on timestamp and send it as a input to the next page to retrive some more fields. the problem is, while sending this time stamp as a url parameter it passes the time as
2007-06-16%2019:16:57.798, the space between the date and time is replaced with %20, I want to get rid off this issue, can you please tel me how to send the timestamp to the next page with this %20.

I badly need your help guys.
10 years ago
JSP
Hello Friends,

I have a quick question for you guys,

I have an application, one jsp which contains two iframes (two different jsp'es ) one contain applet another normal application. what I want to do is

I want to query the applet status from the second iframe, can you please give the code snippet for communicating between the two iframes

Basically I want to call the first iframes(jsp)'s javascript function from the second Iframe(jsp)

please help me on this issue...