Mohamed Yousuff

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

Recent posts by Mohamed Yousuff

I think this is the design of java and has nothing to do with Tomcat. In order for java to recognize classes within the directory structure like in your situation, those should be placed in a proper package, else you have no way except to unjar them and include the classpath of all subdirectories in the configuration.
Hope that helps.

Originally posted by Rara Levis:
I have placed my applications jar file in {Tomcat}/webapps/WEB-INF/lib.
Tomcat finds all Classes at the root of the jar file but the ones that lie within the directory structure, Tomcat cant find them.
If someone can help me on this !!

14 years ago
Your code is fine to some extent. I dont really understand what you really mean by 'connection is active or not'. If the openConnection method is successfull (without exception), it definitely means that the connection to the server is established. If the servlet does not get invoked, it indicates invalid usage of HTTP Protocol. If you use setdooutput(true) and setdoinput(true), you need to get the outputstream of the httpurlconnection and write whatever you want to write to it. Then u need to get the inputstream.
Also when you use setdooutput(true), setrequestmethod("GET") does not make sense because setdooutput(true) implicitly means you want POST method.

Originally posted by subha neithilath:
I am calling a servlet residing in a domino server from a java program.I am passing a cookie value but servlet is not getting invoked.I would like to know how i can test whether the connection is active or not(can you suggest any programs that i can use for testing the same)
I am providing here few lines of code which i am using to get urlconnection and set cookie.
HttpURLConnection urlconnection = null;
URL serverURL = new URL("");
urlconnection= (HttpURLConnection)serverURL.openConnection();
Please go through and give suggestion/sample programs
Thanks and Regards

[ November 11, 2002: Message edited by: Mohamed Yousuff ]
[ November 11, 2002: Message edited by: Mohamed Yousuff ]
15 years ago
If the domino server is J2EE complaint then you can specify the config values in the deployment descriptor file. If the server is not J2EE complaint then you need to consult the domino server documentation, since it may vary from server to server.

Originally posted by sakthivel shanmugam:
Dear All,
I want to set some values in my config file in the domino server and fetch it from my servlet file....

using the code as:
Properties parameters = new Properties();
String filewithroot = getServletConfig().getInitParameter("configFile");
File file_temp = new File(filewithroot);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file_temp),buffersize);
if(parameters != null)
path = parameters.getProperty("ereview.servlet.path");
path_stylesheet = parameters.getProperty("finishedmeetings.stylesheet.path");
catch(Exception exception)

which is that config file?? becoz i dont found any config file over here...or should i go for the creation of a new config file.....if so, what should be the name and extension of that config file....also, where(in which directory) it should be placed in the server...also, should i do some setting changes in the domino server.
pl. post a reply,
with rgds,
Sakthive S.

15 years ago
This is just my guess answer based on my knowledge of HTTP protocol. You might have to test my suggestions. Basically in HTTP protocol, (in Java) you cannot get the OutputStream(for writing a file content through it) again, once you got the InputStream. In your program, you have made a single connection only and tried to reuse it again and again using the zipper method. You might have done this with optimized usage of resource (connection) in mind but this is not allowed in HTTP protocol. Another mistake in your code is that you are closing the zippedoutputstream. The zippedoutputstream is a wrapper around outputstream of the HTTPUrlconnection. So closing zippedoutputstream will automatically close the outputstream of HTTPUrlconnection also which means you cannot use the outputstream of HTTPUrlconnection again.
Ok. Let me stop throwing theories behind the problem with the program. I will suggest you a possible solution.
For every file that you send open a new httpurlconnection and close it as soon as you are finished sending the file. I am sure this will solve your problem. One more suggestion is to print the stack trace of the exception on the command line when you catch the exception. This will help you to identify any problem.
15 years ago
Use 'navigator.language' property for Netscape.
Hope the link below might provide some information.
- S.Mohamed Yousuff

Originally posted by suchitralingaraj:
Hi All,
I need to configure my application for multi lingual scenario. I have the option of importing and exporting the (.csv) files. When the file is downloaded i need to get the regional setting of the client machine and save the file. "navigator.userlanguage" returns the regional setting for IE of the client machine but does not return it for Netscape. Is there a way where i can get the regional setting of the client machine for netscape using javascript.

[ November 06, 2002: Message edited by: Mohamed Yousuff ]
The question is not clear. What do you mean by 'convert' ? What exactly is the nature of your problem ?

Originally posted by cognizant:
I wanted to convery http request to https guide me how to go about it

15 years ago
From the parent window, the child window must be opened using relative URL and not the absolute URL even though they belong to the same domain. By doing this, the 'access denied' error will not appear again. For example, lets say, the domain is;
productSearch ="/search",'productsearch');

(productSearch.opener = self; No need for this line). Note the relative path URL in the parent window script when opening a new window. If the same code in the parent window is written as
productSearch ="",'productsearch'), you will encounter 'Access Denied' error.

I have personally experienced this problem and solved it using the solution that I presented above. I am sure, it will work for you too. Best of Luck.

S.Mohamed Yousuff

Originally posted by Mary Mascari:
Tried it - no good.
Any other suggestions?

The classpath you have set during compilation is for the compiler only not for the server which is hosting your classes. See the appropriate configuration file (depending on your server) to include the driver in the classpath (of the server).

Originally posted by Mnemonical:
When compile sucessfully ... but when I run :
java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleConnectionCacheImpl
is this a classpath problem? Classpath is set correctly.
I'm under Red Hat 7.2 with Oracle9i

It's all about adding that classes in the classpath. You need to locate the appropriate configuration file (depending on your server) and included it in the classpath.

Originally posted by sarim raza:
seems simple, but it doesnt let me
if i put the class in WEB-INF/classes
and import it it works
but for some reason i need to keep the class
in same directory as the jsp page ...
but it doesnt find it ???

15 years ago
U can use the Microsoft text Driver to parse the CSV file. See the list of drivers in the ODBC datasources control panel.

Originally posted by Angela D'souza:
I am using html to upload CSV file throgh HTTP using HTML forms:
<FORM action="Hello" method="POST" name="postform" enctype="multipart/form-data">
<INPUT type="file" name="dddl" value="">
<input type="submit">
Now, through HTTP server, i get whole csv file in message body of HTTP. Now I want to parse the CSV file.
As Microsoft has two version of Outlook Express, both express contains different number of columns. How do I make object which parse the CSV(from any version of outlook) file? What java class I can use?

15 years ago
I would suggest that we use the code from sun which already implments SMTP protocol. If u have installed jdk from sun microsystems, then u can use the package com.sun.mail.smtp to send mails.
S.Mohamed Yousuff

Originally posted by Huzefa Zohaib:
This code is not mailing.

15 years ago
I think, it would be a wrong of doing like this if u need transaction. If a new request arrives in the middle of a transaction of the previous request, then one thread(one request) may try to start transaction, while another thread(another request) may try to rollback the transaction. There r two ways to solve this. One is to synchronize the doPost method which is not good for a site with considerable hits. Another way is to open and close the connection in the doPost method. The ConnectionPooling mechanism must be used for obtaining quick connection to the database.
S.Mohamed Yousuff

Originally posted by Celina Joseph:
I create a Connection instance in my init() and destroy it in the destroy().
My servlet allows concurrent access.
My autoCommit() is false.And in my service(doPost), I start a transaction, perform multiple SQL, commit or rollback the transaction.
When another request comes at the time when one request is being executed, what happens ?

15 years ago
Make sure that your session object has not timed out. Also while retrieving from the session, ensure that you use the correct key value to retrieve the specified object. The key value should be same which you gave while storing in the session object.

Originally posted by Raj Mohan:
i am storing an user created object and a vector in session. After some time, i am getting the vector object from session, but the user created object becomes null.
any body knows what is the reason.
[ May 30, 2002: Message edited by: Raj Mohan ]

15 years ago
Hai Syam,
I think I may be of help to you in this regard.
Declare a global variable for holding the window object of the popup window. In the hyperlink tag, give javascript:functionName() for href attribute. That is it. The skeleton of the code may look like this.

var myWin;
<a href='javascript:myOpen()'>open popup</a>
<a href='javascript:myclose()'>close popup</a>

function myOpen(){
function myclose(){
Pretty nice ! Isn't it.
Well, do let me know, if you need any further clarifications.

S.Mohamed Yousuff

Originally posted by Syam Veerakumar:
Thanks for the reply but I have to use the <A> tag here, so cud u pls give me any other solution.

Yes. You can execute a batch file through a jsp. Not only that you can execute any file including .exe
Just get the Runtime by using System.getRuntime() and use the exec method to execute a batchfile.

Originally posted by Manjunatha HA:
Is it possible to invoke a batch file located in some other directory through a JSP page???

16 years ago