This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!

Arunabh Dash

Greenhorn
+ Follow
since Apr 05, 2006
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 Arunabh Dash

hi,
Let me tell you from very beinging i am using Maven and Sturts 2.0
My client side validation is not working .
I have a made a action-validations.xml .
inside that my code is

In the sturts.xml i have given the mapping as

And in the jsp <s:form action="action_input" validate="true">

But still it's not wotking . I mean it's not validating the jsp page .
Can somebody help me in acchiving my validation target .

In need of deperate help
Arunabh
11 years ago
hi ,
Where objects are being stored ? I know it's heap . But i am really confuse whether it is Cache or Disk . I know heap is for persistance storage .Does that mean it's Disk . Sorry to ask such stupid question .But still ... it's Cache or Disk ? I will be grateful if i can get a quick reply .
With regareds
Arunabh
11 years ago
hi ,
Where objects are being stored ? I know it's heap . But i am really confuse whether it is Cache or Disk . I know heap is for persistance storage .Does that mean it's Disk . Sorry to ask such stupid question .But still ... it's Cache or Disk ? I will be grateful if i can get a quick reply .
With regareds
Arunabh
11 years ago
hi ,
I don't know i got you completly or not, still trying to clear it .....
<jsp:useBean> have two forms .

1)
<jsp:useBean id="user" class="mypack.User"/>
<jsp:setProperty name="user" property="name"/>
2)
<jsp:useBean id="user" class="mypack.User">
<jsp:setProperty name="user" property="name"/>
<jsp:useBean/>

In the 1st case if the bean object is not there container will create an bean object and will set it's name property .
If the bean object is there then also the container will set it's name property .

But in second case if the bean object is not there container will create an bean object and will set it's name property .
But if the bean object is there then body of the <jsp:useBean> is not executed . So now the bean will have the previously set values .

when we use the <jsp:useBean> tag with a body, the value for the beans property will be set only if the bean does not have a value already set.


So this is not always true as i explained previously .

So, setProperty is like giving a default value to the bean, if it is not set. Am I right??


You can said that . Thing is that bean specification says that in side bean constructor we shouldn't do anything (i mean setting any property ). Bean should have diferent public setter method for setting it's property .
Thus for setting the bean property we are invoking <jsp:setBean > tag .

If you are still not clear reply back .....
with regards
Arunabh

]
Which statement is true about servlet loading and instantiation?

A All servlet classes must be loaded when the container is started.
B A servlet class must not be loaded until it is needed to service a request.
C An instance of a servlet class may be created as soon as the container is started.
D The container will never create more than one instance of a given servlet
class.
E The container must create a new instance of the appropriate servlet class
each time a request is to be serviced.



What information you gave about E is true . Container will never create more then one instance of the servlet . But in that way D fails in case of distributed system .

About C, which says "An instance of a servlet class may be created as soon as the container is started." is true . This we can do this using the tag <lode-on-startup>. By this container loades and instanciate the servlet once it's stared .

With regards
Arunabh
Please someone reply . I am not clear about the implementation of the header . In what point i will add some data in the header ???
And is it like when i add a header a cookie is being creater for that header ??
Expecting reply soon
Arunabh
HI friends ,
I have a doubt about the request header . Can anyone explain about the request header . I mean why it is needed .
And one more thing is that i came to know that , when we add a header a cookie is being added . Is it so ? If yes then can anyone explain how it happens .
with regards
Arunabh
hi ,
Take it like ... Both are Map . initParam takes are of those which are being mentioned in the DD . But in the JSP if you are adding soming attribute to application scope then you must retrive it using applicationScope .

I am not sure but it will be using two differents Maps to deal with those which is mensioned in the DD and those attributes which are added to implicit object application .
hi,
Your question was :-
>>why is it that getParameterValues is there only in HttpServletRequest and not in ServletContext?

Cheak out the return type of the getParameterValues() .It's an array of String . As we know that request stores it's attributes in Map where key is a String and value is a object . Those are generated during run time .

>>What if I want to associate multiple values with the same name in Context?
Multiple values you can't add since ServletContext also uses Map to store it's Attributes . And it has to be a Key value pare .

Ya .......You can do one thing ..... Using ServletContextListener you can add object in ServletContext. In that way you can put a collection of object in ServletCotext also. Now as you was getting a bunch of objects in getParameterValues(), you can do the same here .

SCJP(1.4)
Preparing(SCWCD)
Thanks for the reply . I got what i was looking for .Again thank you very much

Regards
Arunabh Dash
12 years ago
Thank you for your reply . And yes , test was over 2 days back .
Then can i say that HttpRequest object is always thread safe !!!
Regards
Arunabh
12 years ago
Actually i am questioning on the need of ServletConfig . What is the special thing i can do with ServletConfig ,that i can't do with any other object ???

With Regards
Arunabh Dash
12 years ago
Thank you for your reply . Actually a got a question like that in a test . I understand that each request lives in it's own thread .But i wonder is there any situation where i have to synchronize the request object else it will be hazardous ???

Thankx
Arunabh
12 years ago
Is it necessary to synchronize HttpServletRequest object .
Please justify your answer .

With Regards
Arunabh Dash
12 years ago
What is the need of a special ServletConfig object for every servlet ?

Let me be more precise . I can get the initial parameters from a ServletConfig
object . But that i can do the same inside a servlet also . I can make a data member in my extended Servlet class like :-
public class MyServlet extends HttpServlet
{
String name;

}
And i can initialize that member in the overridden init() method of the MyServlet class .
Again from my SertvletConfig i can get a reference to ServletContext . But straight way by using getServletContext() method inside the servlet a can get the same .

Then why i need ServletConfig object .

With regards
Arunabh Dash
12 years ago