prabhat gupta

Greenhorn
+ Follow
since Aug 21, 2001
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 prabhat gupta

Hi yamini,
You cannot create a file on the client side but you can first generate the file on the server and ask the client to download the file.creating a file on the client side requires access to the client resources which is not possible through a browser.So you have to first write data to the file on the server and allow the user to download it.
I hope that solves your problem to some extent.It may not however be the perfect solution.
Bye for now.
17 years ago
Hi there,
Its quiet an interesting but very uncertain and irritating problem.while running jsp pages on tomcat which is running in a intranet through a proxy, the proxy throws the header messages at the top of our jsp pages which disturb the whole UI and the performance.Its getting difficult for me to rectify this problem.please suggest me as how to go about preventing these messages to be displayed by server.
17 years ago
JSP
I m getting an exception like
" java.sql.SQLException: No Data found "
i m using tomcat server and MS SQL as backend.Though i m able to run the query successfully in query analyser and fetch the results ,it does not work in my jsp page.
i m calling a prepared statement and passing an int as a parameter
My query is like this:
pstmt=con.prepareStatement("select userdata.db_user_id,db_user_first,db_user_midl,db_user_last,db_desig_name from executivedata,userdata,designationmaster where db_exec_catg='EXECUTIVE' and db_exec_level=? and executivedata.db_user_id=userdata.db_user_id and userdata.db_desig_id=designationmaster.db_desig_id");
pstmt.setInt(1,(i+1));
is it that the query is not able to fetch the tables and hence no results.please help me get rid of this problem.
Still the html page is not included in the response.ie i want the content of the included html page to be displayed in the response page.I just want to incorporate some html formatted text present in those pages in the response.The jsp is still not doing that but yet runs successfully.
should i shift to the other alternative ie of bufferedReader.I have tried code on it and it works fine.Will this slow down the server response.
17 years ago
JSP
i am trying the following code :
<%
for(int i=0;i<filelist.length;i++){
%>
<jsp:include page="../com/prod/<%= filelist[i]%>" flush="true" />
<%
}
%>
Here i want to know that will the above code run successfully.
What I want the jsp to do is run through the array of file names and include them in the response page.
If this code cannot do the trick than i think the other alternative will be to get a BufferedReader read strings from the file and send those through out.println() method.the included files are static html files.
Give me your suggestions and code if possible, please,
IT'S URGENT.
17 years ago
JSP
I am not able to compile servlets because of some third party packages like Acme's GifEncoder package.how do i set the classpath in windows.should i create a jar file for this.Also tell me some way to keep all packages in one directory and set that directory in my classpath.tell me how all this can be done.
It's urgent.
17 years ago
Hi,
I want to generate a number of rectangular boxes with text in each box just like flowcharts.I havent tried anuthing on this but just have the concept in mind.I want to generate it on the fly using jsp pages.For this i need to draw the image on to a virtual awt.Panel object.I am using the GifEncoder API provided by acme which encodes the drawn objects to a gif image and sends to the client.this concept is mentioned by Jason Hunter in his book "Java Servlet programming".
My problem here is that since i want to use the same API from jsp pages and the Api needs to call a method and send the output stream object to it to print the image to the client.now jsp has a out object which is a PrintWriter object.so how can i pass the ServletOutputStream object to it.
The method is :
ServletOutputStream out = res.getOutputStream();
GifEncoder encoder = new GifEncoder(image,out);
17 years ago
JSP
Hi,
I want to generate a number of rectangular boxes with text in each box just like flowcharts.I havent tried anuthing on this but just have the concept in mind.I want to generate it on the fly using jsp pages.For this i need to draw the image on to a virtual awt.Panel object.I am using the GifEncoder API provided by acme which encodes the drawn objects to a gif image and sends to the client.this concept is mentioned by Jason Hunter in his book "Java Servlet programming".
My problem here is that since i want to use the same API from jsp pages and the Api needs to call a method and send the output stream object to it to print the image to the client.now jsp has a out object which is a PrintWriter object.so how can i pass the ServletOutputStream object to it.
The method is :
ServletOutputStream out = res.getOutputStream();
GifEncoder encoder = new GifEncoder(image,out);
17 years ago
JSP
can someone tell me weblinks to some freely available application to create presentations just like powerpoint written in java and platform independent.
17 years ago
How can i read data from a ms excel file.Suppose i have a .xls file which contains a data of all the employees and their salary details.Now i need to read specefic salary details of an employeefrom that file and for that i need to scan through the whole document to get the required information.
17 years ago
How can i read data from a ms excel file.Suppose i have a .xls file which contains a data of all the employees and their salary details.Now i need to read specefic salary details of an employeefrom that file and for that i need to scan through the whole document to get the required information.
17 years ago
A browser does not allow to run standalone applications in it and that is the reason why applets are used.So its hard to believe that one can run application in browser.
17 years ago
I m creating a jsp which calls a bean to search a file on the server.Next the bean returns a Vector of strings as absolute paths to the file on the server.The same path is passed to href tag to give links to the file name in generated html page.But since the path string gives path from the root drive on the server ,Clicking on the link gives an error saying file not found .It is obvious that the absolute path that bean returns is on the server and not on clients machine.
Should i give relative URL wrt the web directory.
Suppose on the server ,The bean returns a path like:
"c:\jakarta\webapps\prabhat\prabhat.doc"
and that my jsp files on jakarta Tomcat server are in "
"c:\jakarta\jsp\"
can i extract the substring as "webapps/prabhat/prabhat.doc" and give the following href tag in the generated Html file.
"<A Href='../webapps/prabhat/prabhat.doc'></a\A>"
Will this tag work.
I want to open MS word files in IE browser by the above method.
If files are not in the Web servers Directory but rather in some other directory on the server say
"d:\temp\prabhat.doc" then how to give the right path in html to open that file.
Please help.
17 years ago
JSP
Hey i forgot to tell you something.
If you dont have your CD rom drive blank ie with no CD inside for the system to read then the code will enter the else part of the if statement .It will be better if you use the canWrite() method instead of canRead(),since the code may not work fine with canRead() method if the cd rom is in the drive.Hence I suggest that you replace canRead() with canWrite().
17 years ago
Hi Bibhishan,
Well, it is very easy.
Try the following code.It will work fine.
import java.io.*;
class FileRoots
{
FileRoots()
{
try{
File f=new File(".");
File[] roots=f.listRoots();
for(int i=0;i<roots.length;i++)>
{
if(roots[i].canRead()==true)
{System.out.println("drive: "+roots[i].toString());
//do here whatever you want to do from this root drive.
else
System.out.println("cannot read from drive: "+roots[i].toString());
}
catch(Exception e){e.printStackTrace();}
}end of constructor
public static void main(String args[])
{
new FileRoots();
}//end of main
}//end of class
17 years ago