Nikki Aniban

Greenhorn
+ Follow
since Oct 10, 2002
Merit badge: grant badges
For More
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 Nikki Aniban

Hi Sejal!
The filename parameter must be enclosed in double quotes.
Try using this:
res.setHeader( "Content-Disposition","inline; filename=\""+ finFileName + "\";");
Hope this helps!
p.s. and if you want to force the Save As Dialog box to appear, you should use "attachment" as the Content-Disposition instead of "inline"
- Nikki
[ September 21, 2003: Message edited by: Nikki Aniban ]
20 years ago
Hi!
When you click the close button of a browser, the onUnload function is automatically called. So you can define something like this in your HTML
<body onUnload="invalidateSession()">
But there is a catch to this. The onUnload is called whenever the user leaves your page. So if the user simply clicks on a link or submits a form, his session will also be invalidated! Luckily for you, a really good hacker found a workaround for this problem.
But if you ask me, I would go with Ron's suggestion to just let the session timeout do its thing. Hope this helps!
- Nikki
20 years ago
Hi Megan!
Try setting the headers for you response to recognize the MIME type that you want to open. In JAVA words:

Hope this helps! Goodluck!
- Nikki
[ August 19, 2003: Message edited by: Nikki Aniban ]
[ August 19, 2003: Message edited by: Nikki Aniban ]
20 years ago
Hi Amy,
I found this guy who has the same problem as you on this link:
Java forum: Reading MS project files
Something about this third party API called JIntegra that claims to build a bridge between Java and MS project and many other COM and .NET applications. It seems that you are not alone. Hope this helps. Goodluck!
Nikki
20 years ago
Hi! ServletConfig is an interface that has defined methods where you can get the initialization parameters that you specified for a particular servlet in your web.xml.
For example your web.xml look like this:
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>MyServlet</servlet-class>
<init-param>
<param-name>name</param-name>
<param-value>diego</param-value>
</init-param>
</servlet>
then in your servlet you can use this code to get the value of "diego":
getServletConfig().getInitParameter("name");
Just check the API to see the other methods that are defined. But wait, here's the clincher, the ServletConfig is implemented by GenericServlet which is in turn, extended by HttpServlet. So, in the ideal world, you don't have to create an instance of ServletConfig just to get initialization parameters because you can directly access it from your servlet.
Bottomline is: ServletConfig is not used often.
Hope this answers your question.
21 years ago
Yup! I was refering to web.xml when I said properties file. It should have been descriptor file. Sorry for the confusion.
21 years ago
In your Thank You page, try putting this scriptlet on the first line:
<%@ page session="false"%>
This way, you page will not create a new session.
Hope this helps!
21 years ago
Hi, Matt! To answer you questions:
1. Yes, you need to pay attention to case sensitivity. I tried using "web-inf" and "CLASSES" as my directory names. Both didn't work.
2. Yes, you can put your com.yadda.yadda in your "classes" directory. In fact you can put them anywhere as long as you put their corresponding class files in the "classes" directory.
3. Personally, I make a "src" directory under "WEB-INF" where I put all my .java files. Then I specify in my IDE (Eclipse) that my build output path is the "classes" directory.
4. You have to put your properties file directly under the WEB-INF directory. This is according to the specifications defined by Sun.
Hope this helps! Goodluck!

[ October 21, 2002: Message edited by: Nikki Aniban ]
21 years ago
Doesn't the asterisk (*) mean that the tag can exist zero or more times? If that's the case, then only the <web-resource-name> tag is required. Though it doesn't make sense to declare a name without a corresponding url-pattern or http-method, I tried it and it worked.
Hi Abdul! There's this nice book from Marty Hall called "Core Servlets and JSPs". Not only is it comprehensive and easy to read, you can get it for free! The PDF version of the book is available here: http://pdf.coreservlets.com/
Goodluck!
21 years ago
Hmmm... maybe you mistyped the url-pattern in the servlet-mapping tag of your web.xml? Anyway, if you really get desperate, you can use the ever reliable "Find Files and Folders" function of your OS to search for the phrase "mySerlets/SetSharedInfo" in your entire computer! Let's see if this doesn't solve your problem.
Hope this helps!
21 years ago
Hi Trupti!
When you access a Servlet through a URL, the default HTTP method that will be called is GET, which will consequently look for the doGet() method. Since your PostServlet only defines the doPost(), an error will occur.
Like Andres, I usually define a doGet() method that calls the doPost() method (or the other way around).
Hope this answers your question. Goodluck!
21 years ago
Hi Qing!
Create a "classes" directory inside your WEB-INF and put all your class files there. This is the standard directory structure for web applications.
Also note that accessing your servlet is case sensitive so if your file name is hello.class, you should use http://localhost:8080/AA/servlet/hello to call it.
This should work. Goodluck!
Remove the whitespace after the "=" sign in your declaration of variables:
set JAVA_HOME= C:\jdk1.3.0_02
set TOMCAT_HOME= C:\Tomcat4.1
set CLASSPATH=C:\jdk1.3.0_02\bin;C:\jdk1.3.0_02\lib;C:\jdk1.3.0_02\jre\lib
PATH= C:\orawin95\bin;c:\jdk1.3.0_02\bin

should be:
set JAVA_HOME=C:\jdk1.3.0_02
set TOMCAT_HOME=C:\Tomcat4.1
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\jre\lib\rt.jar
set PATH=%PATH%;C:\orawin95\bin;%JAVA_HOME%\bin
Hope this helps!