This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

B Misra

Greenhorn
+ Follow
since Jul 27, 2007
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by B Misra

Thanks Guillermo Ishi for your links :-)
Hi,

I was looking for an android certification. I found the following two but wondering which one (if any) would be worth taking? Both cost $150.

OESF Authorized Certification Engineer for Android
https://www.prometric.com/en-us/clients/android/Pages/landing.aspx


ATC Android certified application developer : http://www.pearsonvue.com/androidatc/


Would love to hear out your opinions. I would like to do one but not if they are just waste of money from any kind of recognition side.

This thread helped me to solve some problems , but I am reviving this old post because-
Though getting the same jboss jar file in client as from server solved the issue , I am confused with the reason of this.
someone please through some light why is it so much dependent on server jars for a remote jndi lookup.
I came across a note where it says obtaining two instances of a stateless bean via dependency injection will always be equal.

I tested it and it is true.

@EJB MySLBeanLocal mySLBean1;
@EJB MySLBeanLocal mySLBean2;

mySLBean1.equals(mySLBean2) always returns true.

But I am not sure what is the reason behind it? Isn't that while invoking stateless bean like that it is always upto the container to return which object from pool?

Any clarification will be really helpful.
@ryan sukale
Which book are you referring by 'EJB 3 JPA book ' ? I could identify the book.

Christophe Verré wrote:

How to ensure that the first request containing login information will be protected as the user will put the information in the very first screen which might be ...xxxx/login.jsp



That's what they mean by 'when you are using declarative authentication , the client never makes any direct request for the login'. If the client access a protected resource, he will be asked to login. So if you protect all resources, the client will have to login at least once before accessing any page.



Thanks for reply, but I wish to know what happens in the web applications (jsp-servlet tech) we come across everyday where we have to log-in first , more precisely the first page itself is a login jsp . Instead of declarative authentication what is used there?
In HFSJ(2nd ed.) in page 688 it says 'when you are using declarative authentication , the client never makes any direct request for the login' - and there is explain that way you can ensure that login information can always be made sure to be transported through SSL.

But what about the web applications where user generally have to login even before actually start using the application.
How to ensure that the first request containing login information will be protected as the user will put the information in the very first screen which might be ...xxxx/login.jsp

Vijitha Kumara wrote:

B Misra wrote:1) In HFSJ in page 715 it says we can not just modify the response after call to chain.doFilter() as by when the execution pointer returns the request already have been posted back to the client as it do not wait for the filter method to finish. But in page 723 it is flushing the custom output stream after the call to chain.doFilter() - please explain where I am making a mistake?



Both are correct. In your first query it is talking about a normal response object(HttpServletRespone) so the last component in the chain may flush (committed) the response before the control comes to the filter. In second query, when you have a wrapped object you are not flushing the actual response object but the wrapper object which wraps the actual response object . Did I get your question right?



Thanks for the reply Vijitha.
So in the first case the actual request object will always be committed before the execution returns to filter but in 2nd case writing to the custom response does not commit the actual response object within the custom response, until explicitly flushed?
I am having two basic problems with HFSJ Filter's chapter:

1) In HFSJ in page 715 it says we can not just modify the response after call to chain.doFilter() as by when the execution pointer returns the request already have been posted back to the client as it do not wait for the filter method to finish. But in page 723 it is flushing the custom output stream after the call to chain.doFilter() - please explain where I am making a mistake?

2) In page 735 question no. 5 it says
"Filters may be used to create request or response wrappers" - Correct
"Wrappers may be used to create request or response filters." - Incorrect

Why??
i can see the 2nd statement is absurd but why the first one is correct!?


Thanks in advance.
An array is first 'declared' (i.e. declaring the reference only)
then it is 'constructed' that is an array object is created in heap.
At this point The elements of the constructed array are initialized to their default values.

At next step you can intialize/ set values for each element of the array.

in you sample code if you construct the array then you'll see that the element values are initialized to default 0 (for primitive int)

public class ArrayTest {

/** Creates a new instance of ArrayTest */
public ArrayTest() {
}
public static void main(String args[]){
int arr[]= new int[5];//declared here
for(int i=0;i<5;i++)
System.out.println("Array Values --"+arr[i]);
}

}
Returning ArrayList is not the problem.... an ArrayList IS A List & can be retuned - BUT the problem here is :
In the first method the return type is declared as List<T> ; So only & only List<T> can be returned there. At compile time one can not be sure that List<T> might be a List<String>

In the second case return type is List<?> that means List of anything that extends Object & can thus return List<String>
yes as if the class being extended have constructor with arguments, you can use those constructor while calling 'new' and defining annonymous class.....

you might want to run that code & try it out yourself.... will help you understand more clearly....
Here s a quick code going through which hopefully will make your doubts about point(6) clear....



Though, If the class you are extending by annonymous class doesn't have any constructor other than the default one, you can not define any new constructor etc etc.... as you already know.
[ September 07, 2007: Message edited by: B Misra ]
I really don't think this kind of question will come in scjp 1.5 where you need to remember unicodes!
clue:
remember what is autoboxing.
notice what those methods or constructor calls returns? (primitives/objects)
notice the corresponding reference variable type.