Swathi Sri

Greenhorn
+ Follow
since Jan 18, 2007
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 Swathi Sri

Thank you. That helps!!
15 years ago
According to the explanation, the answer to first question should be True.
Hi,
Thank you for the reply. Yes, that works. Also, I tried getServletContext().getResource(), which is working.

Regards,
Swathi
15 years ago
Hi,

I am trying to read an excel file. It is existing under web-inf folder. I am calling this file from helper/dao class. How should I give path? I tried \\context-path\\excel-file-name. It is giving File not found exception.

I have also tried copying excel file to the folder where the helper/dao class is existing and by using just excel-file-name in the file path. It did not work either.

Can anybody please suggest a way to read this file?

Thanks,
Swathi
15 years ago
Hi,

initialization parameters for a web application : <context-param>
&initialization parameters for a Servlet : <init-param>

For reference:http://wiki.metawerx.net/wiki/Web.xml

hope this helps.

Regards,
Swathi.
Hi,

Based on following API info, Answer should be A,B,C and D.
There are 4 correct options instead of 3.

http://java.sun.com/webservices/docs/1.4/api/javax/servlet/GenericServlet.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSession.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServlet.html
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletConfig.html
all have getServletContext() method, which proves ServletContext is accessible.

and

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletResponse.html
does not have getServletContext() method..

Please correct me if I am wrong.

Regards,
Swathi.
Hi Christophe,

Thank you for the clarification.
Hi,

I got this question from jdiscuss.com. I thought that

Problem

Assuming that the Servlet Container has just called the destroy() method of a servlet instance, which of the following statements are correct?


Options

Select 2 correct options.

1.Any resources that this servlet might hold have been released.

2.The servlet container time out has exceeded for this servlet instance.

3.The init() method has been called on this instance.

4.None of the requests can EVER be serviced by this instance.

6.All threads created by this servlet are done.

I selected 1 and 4 but the answers given are 3 and 4.
I understand 3 is logically correct but I did not understand why 1 is wrong.

Can anybody please explain ?

Thanks ,
Swathi
Hi,

5th question in page 703 of HFSJ is as follows:

Which about the filters are true?

Here are the answers given:
A.Filters may be used to create request or response wrappers
G.Filter's doFilter() may block further request processing.

My doubts:
How option A is correct?
Filters can use request or response wrappers to modify the request or response sent to/from servlet. But how Filters are used to create wrappers?

Why Option " D.Filters support an initialization mechanism that includes an init() method that is guaranteed to be called before the filter is used to handle the requests " is INCorrect??

Thanks & Regards,
Swathi.
Hi,

I understand that second option is wrong because of "Only" word in the sentence.

2)This method will be called only when doStartTag() returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED

Regards,
Swathi
Hi,

correct answer is "BUBBUB"

First B: for session.setAttribute("dab", new DealerAddrBean());

Next UB-> B: for session.setAttribute("dab", new DealerAddrBean());
As it is replacing the same attribute dab..

Next UB: for session.setAttribute("dab","x");
As it is removing existing DealerAddrBean (Unbind is called). Since it is not binding DealerAddrBean but its placing a string, no valueBound method is called.

session.removeAttribute("dab"); is not printing anything because it is removing attribute where value is String.. and it does not have valueUnbound() method.

Hope this helps you.

Regards,
Swathi.
Hi All,

I have configured my WAS6 server for connecting to Teradata database. I am using connection pooling option.

The problem I am facing is even though I connect using to database using ds.getConnection(username, password) and username sent as parameter is different from the user configured in the server, The connection returned uses the user configured in the server. The username and password sent as parameters are ignored.

Can anybody please tell me if this is any sort of bug in RAD or am I messing up with server configuration ?

Thanks in advance,
Swathi.
16 years ago
Thank you Nileesha..

It helps me understand the concept.
Hi,

I am learning EL functions. When I did exercise in HFSJ book, 393 page, I got following doubt.

How ${num > 3} gives false?

I was expecting error because num is not preceded by requestScope. Can anybody please explain me how it get executes?

Thanks,
Swathi.
Hi All,

Can anybody please clarify my doubt?

Thanks in advance..
Swathi.