ravi D shankar

Ranch Hand
+ Follow
since May 27, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by ravi D shankar

Hello,

My scenario is that I have a request which is sent in a specific url format to a servlet which downloads a pdf file and streams it back to the browser.
In the servlet, if the url format is different from what is expected but contains all params(a legacy url format bookmarked) then we forward it to a jsp and re-submit to the servlet in the required url format.
This was done because when a pdf opens in the browser, adobe reader couldnt save it using its file name so we have to change the url format so that it takes the name before "?param string" from the new url visible in address bar (forwarding doesn't change url).
So its like request->servlet->jsp->servlet-> servlet streams file to browser.
Since I re-submit in a specific url format which has to be visible in browser address bar, the original request pointing to the source is lost.
Now, if the file to download doesn't exist, we need to set the response code as 404 but that response code doesn't reach the original source which requested it.
If the original source is a standalone class opening a HTTPUrlConnection , it will receive empty headers and responsecode as -1 if the file doesn't exist.

So the requirement is to ensure that we should be able to change the url in address bar and also send the 404 response code if the file doesn't exist to the original source which requested it.

Any ideas?

Thanks
13 years ago
Hi All,

Is it possible to save the httpservletrequest, httpservletresponse object after the servlet doPost or doGet or service method executes.

I am using tomcat 5.5 and looking at options in jdk to queue up http requests and process them asynchronously.
I am presently trying to implement ThreadPoolExecutor. However the caller thread is blocked till the job executes and returns.

To achieve asynchronization, is there a way to store the request, response objects after the service method executes so that the queue process can process these when their time comes and also servlet thread is released?

Please let me know.

Thanks,
Ravi
15 years ago
Hi All,

Sorry if this isnt the right subforum.
I need some direction on an approach for a design.
I have 2 tomcat servers which hosts 2 instances of an app facing users. This app communicates with multiple(3 or 4) tomcat instances of a webservices app hosted on some other servers using SOAP & URLConnection(filestream) for data. Requests to the tomcat instances are handled by a load balancer.
One of the servlets in the external userfacing app is frequently used by users. This servlet when executes actually opens a URLConnection to a service hosted on the webservices app to get the stream of data.This particular service hits DB to get the data. Around 20 DB conn in a pool.

Due to the heavy load,outofmemory server crashes sometimes (DB conn being not available etc), I am planning to restrict no of concurrent requests this particular 'Servlet App => URLConnection => WebService App' service and queue up requests to an extent.

I need advice on the best way this can be achieved. What kind of a mechanism can be implemented?Which app should be considered for setting up restriction considering the load balancers/multiple instances?
Is ThreadPoolExecutor in Java 5 a good choice for this design?

Thanks in Advance
15 years ago
Hi,

Its a commercial vendor. Sterling commerce 'managed file transfer' solution.

Ravi
16 years ago
Hi,

We are currently pulling encrypted files from Finance FTP Gateways. When we login and look at the permissions of files placed we see that the files have the following flags

-ART------TCP

The 'T' flag is set once a file is downloaded from that FTP gateway.

Can anybody please explain the significance of these file attributes or direct me to any documentation?
Normally i have always seen a set of -rwxrwxrwx attributes on files.

Thanks,
Ravi
16 years ago
Hey,

The filetype I have is conventionally encrypted PGP/GnuPG file.
2 encrypted files have been merged into 1.
If the file format were to be ASCII, it would have been easy to separate them.
We are facing difficulties with the binary file.

Thanks
Ravi
16 years ago
Hi,

Can you give me some info on how I can identify where to split a merged binary file using java api?

Thanks in advance,
Ravi
16 years ago
Hey,

Can anyone please guide in separating 2 binary files using java api which got merged into 1 file.(appended one after the other). The file content is encoded in charset iso-8859-1.
Is there any standard way to separate individual binary files which were merged into one?

Thanks in advance,
Ravi
16 years ago
Thanks for the info.

I am trying OpenOffice currently. But still not sure if I can create a doc using OO Api in a server box (tomcat) and give it for download in a client browser where there is no OpenOffice.org installed.
In case, if anyone can guide me on how to set it up as a backend process and write code which doesnt open the writer UI when creating a doc file it would be helpful to me a lot.
I am working on the same, In case I figure it out then I shall update the post.

Thanks a lot
Ravi
17 years ago
Hi All,

Can anybody advise me on how to create a MS Word Doc from scratch using some java api?
My requirement is that I have some text, header, footer,lines and tables to be inserted in a document. Some of the text comes dynamically from bean classes.

I checked some previous posts which were mostly on reading a Doc.I also checked some previous posts on OO SDK. But I think it doesn't run as backend server like process, it loads the UI(correct me if I am wrong). I also saw some poi posts but not sure whether the library supports tables, header and footer.
Please advise.

Thanks
Ravi
17 years ago
Hi

Sorry if this question doesnt belong to this sub-forum.
I am working on an issue which had a PDF file generated using iText.
The pdf file contains only formatted text and the requirement is to edit (add/remove content) from the PDF. For this purpose I was thinking whether this is possible using any free java api. I was looking at Google Docs where a document can be saved as a PDF again.
Using iText I think I can generate RTF(also HTML minus the pagebreaks etc) but is it possible to convert it back to PDF with same formatting of text.
Just wanted to buzz people to know whether something like this is possible.

Thanks in advance
Ravi
17 years ago
Hey Thanks

But in the API
javax.xml.transform.stream.StreamSource s = new StreamSource(src);
StreamSource takes a URI string rt?
I am not whether it works for a raw xml string??

Ravi
Hi Guys

I have a String object containing xml content which I get from a 'Database Column'.I would like to use that xml content in the String as a InputStream or FileInputStream or XMLInputStream to be used by my 'JAX-B Classes'.

String a = "<parentTag>abc</ParentTag>";
Can I convert the above String to an inputStream or other formats??

Is there a way I can accomplish this ?..

Thanks in Advance
Ravi
Hi Guys

Can you help me out in Identifying a hangup / idle / crashed process in Linux.

Assuming that I have a continuously running java program, if at any point of time I would like to know whether that process has hungup / idle / crashed .. how do i use linux commands for that purpose.

Please help me out in this.

Thanks
Ravi
18 years ago
Thanks very much .. did exactly as you told and its working fine
18 years ago
JSP