Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Vijay Sargunam

Greenhorn
+ Follow
since Jan 14, 2004
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 Vijay Sargunam

Agreed, if we have experienced developer giving, then they will be able to do much better. But dont think much people have actually worked on JSP 2.0 & JSTL. Servlet 2.4 hasnt changed much.
From the spec. they have provided the basic thing, how it needs to work. But in the exam, the question test that you have actually worked on it. Atleast some of the questions.
Anyway, part from the topics of the old exam, need to concentrate alot on the following:
1. Expression Language.
2. JSTL 1.1
3. Simple tag & classic tag creation
I found alot of questions on the above topics in the beta test, as compared to the older topics.
Regards,
Vijay S
Hi Shiram,
I feel the better thing to do is to wait for the HF Servlet and JSP book to be out. Definitely, will be a fun reading it!
Other guides will be Hanumant Deshmukh(which covers jsp 1.2) and Spec for Jsp 2.0, Servlet 2.4 and JSTL1.1. But reading from the spec, its difficult to get a very high score like 90s. Also, if you are reading from spec. then you need to try things out and explore yourself. Hope this helps.
Regards,
Vijay S
Hello Kunal,
Please go through this thread, https://coderanch.com/t/167381/java-Web-Component-SCWCD/certification/difference-between-HttpSessionAttributeListener-HttpSessionBinding . Read that, if you need any further clarifications let us know.
Regards,
Vijay
Hello Eric,
The logic of using isThread safe is a bit tricky. What it means actually is, when I mark a jsp page with "isThread=true", I say to the container that, "I have developed my jsp in a thread safe manner, so you dont have to worry about it(by implementing the SingleThread interface)". However, if you say "isThread=false", the container steps in and implements the SingleThreadModel for your jsp and thus tries to make it thread safe. I hope this helps.
Regards,
Vijay
Hello Manish,
Following are some possible answers:
Q1. I have synchronized doGet() and doPost() methods in my servlets. Will this create any problem? Should i use the single thread model instead?
Ans: Synchronizing the above methods will no cause any run time or compile time exceptions. However, since the servlet works
on the singleton pattern, their will be only one servlet and each time there is a thread accessing(ie. a client request) it,
other threads(ie. Other Client requests) will be waiting for the thread to exit. In our practice environment, this is not an issue, but in a web application, this will severely affect performance(ie. response time)
Making servlet a single thread is also not recommended, infact, it is deprecated from servlet 2.4 api, and maybe removed in future version. Better than both the solution is to make your servlet class thread safe.
Q2)Why shouldn't we make the service() method synchronized?
Ans: Same reason as above.
Q3) How can we find out the number of ServletContext currently active in a servlet container?
Ans: I dont think that can be found out directly. However, you can get the servlet context object of another context.
Q4) I have a global variable in a servlet class. What will happen to this global variable if two requests hit on the same time?
Ans: Instance variable in servlet are not thread safe, since only one instance of the servlet is created and managed by the container. If you are using instance variable in your servlet class, you may find the some undesirable result, which is also not easily traceable. So, you should always use local variables, since each thread will get a different copy of the variable.
Hope this helps.
Regards,
Vijay
Using Ctrl + N or a link in the page to open a new window will definitely continue with the same session(atleast in IE). However, even if you open new windows without Ctrl + N or without a link, sometime session mixing happens, coz of multiple thread access of the _jspService method by the container. To prevent this session mixing (and not the Ctrl + N or link), you need to sychronize the session object. Hope this helps
Vijay
Hello Praful,
You are right, in IE a different session is created for each browser window. However, if you try it in other browsers it may not be true. Also, in IE, when you working with 2 sessions(ie. 2 browser) in the same web applications, you find that session mixing happens i.e. the values from one browser is shown in the other. This happens because of the multi thread accessing the _jspService method. To prevent that, and to be sure that it never happens in and is compatible with other browsers, we should get a lock on the session object by sycronizing it.
Hope the information is helpful.
Regards,
Vijay
Hello all,
When I was going through the exam objectives I found only "9.3 Given a design goal, use an appropriate JSP Standard Tag Library
(JSTL v1.1) tag from the "core" tag" objective related to JSTL. Does that mean, we only have "core tag" topics for exam. Or does it include the others like xml, sql, internationalization etc.
Regards,
Vijay
Hello,
SessionAttributeListeners are used when any attribute is bound, removed or replaced in session. But sessionBinderListener is used when only particular att
If you want to track any attribute added, removed or replaced in session you need to implement SessionAttributeListener. Any attribute in this scenario means, of any datatype viz, String, Integer, Products(Custom).
To do this, we need to create a class which implements the SessionAttributeListener and implement the 3 methods. Anytime, any attribute is added, remove, replaced, the corresponding events will be fired by the container.
However, if you have a class say Product, and you want to track any instance of Product added to session, then you have implement SessionBinderListener on Product class. ie.
public class Product implements SessionBinderListener
and you need to implement the corresponding methods.
So anytime, a instance of product is added to session, then the corresponding methods viz sessionBound() etc will be called by the container.
I guess it helps.
Regards,
Vijay
The expiry date for beta vouchers expiry is 6th.
Regards,
Vijay
Hello,
In tomcat 5.x, while creating an application context, you have to set the classloader property to true. This can later be changed using the admin console. Hope this helps.
Regards,
Vijay