Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

Bageshwar Pratap Narain

+ Follow
since Mar 04, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bageshwar Pratap Narain

Any book other than one mentioned here ?
(for 1Z0-899)
8 years ago
My development environment is windows. Now i need my web app to be tested on a Linux platform, which is some remote machine.
Is it possible to add the tomcat instance running on a separate Linux, to my nb5.5(on windows), so that i am saved from the pain of manually adding the .war to the Linux's tomcat.
I would like to tell, that I don't want to install netbeans in Linux.
I want to access files which are outside the webapps directory.
My OS is windows/linux and I have a scenario, wherein, i need to write files, to specific directories, outside webapps.
Tomcat throws a Security Exception, so how do I get away with this.

11 years ago
Hi Menon, can you tell me the source of your information
It appears that a whole lot of people are suffering with the same problem.
Even mine was supposed to expire on 07/08/09 , which a couple of days ago, i came to know has already expired.
I called up NIIT CP, Delhi, where I came to know about this fact, and he also told me, that I was not the first one with
this kind of problem. I think SUN should definitely do something about this, as so many people cant be fools.
It is the company's fault.
I recently bought a 2nd hand ticket from a person in Pune.
he told me that the ticket had a validity till 8 aug, which i checked in the voucher as correct.
Now once i got into booking my exam slot, i came to know that the ticket had already expired because the date was
in mmddyyyy format .
This was not mentioned anywhere on the voucer. so I urge the exam makers to consider putting in a more user freindly date on the voucher.
and i came to know that i was not the only one with this kind of problem.
Thanks for the reply , I was googling for JSON JSP, while the answer was hidden in JSON Java
Problem solved anyways...
Can somebody help me with this one.
I need a shortcut method, some classes, or library etc.
I dont want to do the Bare String Handling
I have a jsp page, where-in I simply retrieve rows from a table.
Now i want to display the results page-wise (20 results each)
something similar to google.
What are the best practices for accomplishing such tasks.

I am using MySQL 5.0 ( so database specific solutions are also welcome)
My tables would not always have ID numbers in serial order , so using them as a reference number will be waste

I'm running this web application locally, so it is VERY FAST. Should I expect it to be considerably Slower once it's used over the Internet, and Upload Large Files?

yes definately

Important when uploading large files, better use something like AJAX, to show the progress of upload, or else it becomes very frustrating for the end user to know whats happening, and in a frenzy h may push the refresh button uselessly...
spoiling the session.
12 years ago

What are the HELLO-HIs, you're talking about here? Excuse my ignorance If it's an obvious-response Question.

These are the 4 lines of HTTP information that we are stripping !!!

If you would comment the code, where that data is read four times and neglected,
that that will lead the code to write everything it has in the ServletInputStream to the FileOutputStream.

and that will include this plain text, which will currupt the image file

Got That ???

12 years ago

Jose Campana wrote:Alright,

How do you know the length of the headers ? I mean, You read bytes 4 times for a length of 1024. (For the 4 elements in the header info. I'm assuming).
(Where did you learn this was the way to go?)

After that you proceed with reading the Actual message.; You start From position 0. And the code it's pretty straight-forward from then on. BUT.....

1024 is the buffer size, it wont always read 1024 bytes.
The method employed for reading is readLine(), which reads till the next "\r\n" (thats why its important, i mentioned earlier) .
The initial code, just reads the first 4 lines of the POST ( these contain useless info, which i came to know by some reading , and observing the printlns. The actual contents of the file follow after this forth line.

Why is this?

I mean If I comment this lines:

The File creation that comes next Fails, Could you explain to me a little more about your code.

Since you are writing to an image ( the data follows after the 4 lines of HELLO-HI),
if you add this text to the image file, the file becomes currupt.
Thats why i was saying to use a text file for testing, their you would know exactly at which line does you file data start, and thus you can skip the non-required lines.

Its just about knowing, at which line of the message, your file content will start

12 years ago

Jose Campana wrote:
I think it's going to take a while before I can get this code to work, I'll study it, apply it, and then eventually and probably will have some questions. I hope I can trouble you in the future with them....

For now...
I can't find the correct words to express my gratitude.

Best Regards,


Mention not "Partner" !!!
hope I solve your problems
12 years ago
First of all, try not to write individual JSP pages for generating reports,
what use is , then Server Side scripting, when you have to code everthing statically,
why not try a different approach and generate the required pages on the fly. That will be the best aproach.

Anyways , as you have posed your problem,
this is what i might have done to solve this :

Depending upon the number of reports ( a few 10-20 to 500-1000)
i would have created a map in the database, or used a xml file.
I think creating a table would be the best option,
that ways, you can add loads of more information apart from the link --> jsp page mapping.

In the first JSP page, connect to the database / XML file and fetch all the links (link to the 2nd JSP )

<a href="showReport.jsp?id=XXX" >Report Label</a>

The text in bold , should come from the database,

then in the showReport.jsp page, simply extract the GET request paramter "id" and fetch the mapped JSP page from the database / XML.
Then use request.getRequestDispatcher(" jsp page "), to forward the request to the required JSP page

I hope I am clear enough
Cheers !!!
12 years ago