Veena Pointi

Ranch Hand
+ Follow
since Jun 20, 2002
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 Veena Pointi

Hello,

In the answer given for following question is A and E . My doubt is why not E also ? The correct answer should be A,D and E right?Please correct me if I am wrong . I reffered specs it says original query string can be accessed bot by getQuery string and by calling getAttribute(“javax.servlet.forward.query_string”) on the ServletRequest. But why in the book D is not right answer? Please explain

Ques 12. Which statements about RequestDispatcher are true (where applicable, assume the RequestDispatcher was not obtained via a call to getNamedDispatcher())? (Choose all that apply.)
A. A RequestDispatcher can be used to forward a request to another servlet.
B. The only method in the RequestDispatcher interface is forward().
C. Parameters specified in the query string used to create a RequestDispatcher are not forwarded by the forward() method.
D. The servlet to which a request is forwarded may access the original query string by calling getQueryString() on the HttpServletRequest.
E. The servlet to which a request is forwarded may access the original query string by calling getAttribute(“javax.servlet.forward.query_string”) on the ServletRequest.

Thanks
Veena
Hi ,

Congratulations . That is very nice score .

Which version of eclipse we can use for HFSJ examples?

Thanks,
Veena
Hello Frits,

Now this makes sense . Thank you once again.

Veena
It is helpful .It is very clear now.Thank you very much for explaining in detail.
In the DD using scipting-invalid .When we set this,
scripting is disabled for jsps in all aplications.
So i thought ans B is correct.
Hello,

In HFSJ cha 7, Question 13 is as follows.

13. Which statements about disabling scripting elements are true
A.You can't disable scripting via the DD
B.You can only disable scripting at the application level.
C.Yo can disable scripting programmatically by using the isScriptingEnabled page directive attribute.
D.You can disable scripting via the DD by using the <scripting-invalid> element.

Ans is D

My doubt is isn't B also right answer? We can only disable scripting at application level,not page level,right?

Thanks,
Veena
Hello Frits,

Thank you for explaining .I understand ServletContext and httpsession objects are completely different than the ones on VM1. I now know that when session is migrated from VM1 to VM2 session ID can be same or different . But I have following questions regarding this

1.In that case how will it identify if it is same user when request comes to VM2.

For ex first request is made to VM1 , Session is created
Second request is made to VM2,session is moved to VM2,but session id might be same or different.If it is different ,is this client treated as new client by VM2?

2.Also it is not clear to me what happens to attributes on VM1 that are bound to servletContext and session object,are they simply coppied to new objects on VM2?

3.On page 258 it is given "Everything else except session is replicated on each node while session is migrated." . Migration means session passivates on Vm1 and is activated on VM2. I didn't understand what does it mean by replication?

I am sorry if I am going out of exam topic . I wanted to understand session migration better as it is important while dealing real time applications.

Thanks,
Veena
Never mind.I read the next page . I got confused when they said session is moved,but in UML diagram they showed sessionID as 343 on VM1 and sessionID as 128 on VM2....if they say it is moved,it should have same session ID right?
Hello Every one,
I want to understand session migration clearly.On page 257 of HFSJ it is very confusing to understand what happens to Httpsession objet when it is moved to different VM .

What exactly it means when it says "session is moved to VM2"? Does it mean
New session is created on VM2 and all the attribute values from VM1 are moved to VM2?
what happens to the session that is on VM1?It expires?
What happens to attributes that are bound?They are also moved ?

When they say everything is duplicated in the second server except HttpSession,what exactly this means?

Is there any detailed description on this? Please let me know if there is any reference on web to understand this clearly?
I am facing problem while including jsp using jsp:standard action



<jsp:include page="a.jsp" flush="true"/>



If I do the above it includes a.jsp,but if i do any of the below it doesnt

<jsp:include page="a.jsp" flush="true">
<jsp:param name="colspan" value="8"/>
</jsp:include>



or


<jsp:include page="a.jsp" flush="true">
</jsp:include>




Can I know what is wrong?Please help.

Thanks
Veena
8 years ago
JSP
Hello,

In the following code ,if columnName is AccountType ,I am expecting <fmt:message to get the value of AccountType.popupstr key from properties file .But it displays empty message.

><fmt:message key="<%=column.getColumnName()+".popupstr"%>"/>

Doesn't fmt:message evaluates expressions like the above ? Can anybody please explain?

Thanks
Veena
8 years ago
JSP
I checked the logs.It is showing the IllegalStateException . What I thought was it will throw exception on the browser itself without even processing the page .

Thank you .

Veena

Walid Abd Elsalam wrote:Can you try it again after replacing OutputStream with ServletOutputStream. I'm just wondering if it would make a difference as the api documentatio for OutuptStream.flush() says it does nothing.



Doesn't matter weather OutputStream or ServletOutputStream right?Because spec says


forward should be called before the response has been committed to the client
(before response body output has been flushed). If the response already
has been committed, this method throws an IllegalStateException.



I wonder how my code is working!!!

Thanks
Veena
Hello,

Thank you for replying.I am using Tomcat 5.5 .

Hello,

In HFSJ it says you will get IllegalStateException if we try to forward request after committing response.I tried following code ,it works fine



Can anyone please explain what specs is trying to say?

Thanks
Veena