Posts Tagged Certificates

The life cycle of servlet

Tags: , , ,

Life cycle of servlet from the perspective of the container

1. After start, the container is looking for servlet classes in the appropriate directory (for Apache Tomcat would be $ TOMCAT_HOME / webapps) .

2. Once they are found, there are two possible ways: servlets are loaded immediately or only when someone wants to use them. By using term “load servlet” I mean the execution of its constructor and init () method. init () is executed only once in the life cycle of servlet . It allows you to prepare it for usage (eg to connect to the database, initialize any resources).

Code below presents fragment of web.xml file allowing to define order in which servlets are loaded when the containter starts:

<web-app>
    ...
    <servlet>
        <servlet-name>FirstToLoadServlet</servlet-name>
        <servlet-class>pl.tdziurko.scwcd.servlets.FirstToLoadServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>SecondToLoadServlet</servlet-name>
        <servlet-class>pl.tdziurko.scwcd.servlets.SecondToLoadServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    ...
</web-app>

Continue reading this post …


Be Sociable, Share!

SCJP to certyfikowany programista Java, a SCJD?

Tags: ,

Dear Reader
This post is in my native language as it applies only to developers society in Poland. Please feel free to check my other posts which are mainly written in English.

Pewnie nie uwierzycie, ale istnieją miejsca na Ziemi, w których nie chcą od ręki uznać dyplomu SCJP ;) i potrzebują tłumaczenia na język ojczysty. Tak właśnie jest w polskich urzędach, gdzie bardzo miła pani powiedziała, że wierzy mi, iż jest to certyfikat potwierdzający jakieś kwalifikacje, ale żeby mogła wprowadzić go do bazy musi mieć tłumaczenie i to przysięgłe. Rozpocząłem więc pielgrzymkę po biurach tłumaczeń, które jak się okazało tłumaczą od ręki, ale nie zawsze pod przysięgą. W końcu dotarłem do miłego pana, który wziął moje oba certyfikaty i powiedział, że tłumaczenie będzie gotowe w ciągu dwóch dni.
Gdy pojawiłem się po odbiór okazało się, że tłumaczenie nie jest jeszcze w pełni gotowe, bo tłumacz chciał ze mną skonsultować dwie kwestie: tłumaczenie “Sun Certified Programmer” oraz “Sun Certified Web Component Developer”. Po krótkiej dyskusji ustaliliśmy następujące brzmienie tych nazw:
- Certyfikowany Programista w języku programowania Java Standard Edition 5.0
- Certyfikowany Programista Komponentów Internetowych w języku programowania Java Enterprise Edition 5
Nazwy nie są na pewno idealne, bo tłumacz nie mógł po prostu pominąć niektórych fragmentów po angielsku, ale moim zdaniem dobrze oddają sens. Zadowolony wróciłem do domu po czym naszła mnie taka oto myśl:
Co zrobiłby tłumacz, gdybym razem z certyfikatem SCJP przyniósł mu również SCJD (Sun Certified Java Developer)? Jak poradziłby sobie ze słowem developer, które w języku polskim ma w sumie takie samo znaczenie jak programmer? Myślałem nad tą kwestią sporo czasu i stwierdziłem, że chyba jedynym dobrym rozwiązaniem byłoby wprowadzenie jakiegoś przymiotnika określającego wyższy poziom umiejętności developera od programmera, czyli na przykład:
a) Certyfikowany Programista w języku programowania Java Standard Edition 5.0 na poziomie zaawansowanym
b) Certyfikowany Starszy Programista …
Jednak żadne z tych tłumaczeń nie jest w pełni udane. Może Wy macie lepsze pomysły?


Be Sociable, Share!

Finally my SCWCD mission completed

Tags: , , ,

Much later than planned (check my post when I revealed intent to pass SCWCD) I managed to get this certificate. The result (94%) is in my opinion more than good :) Preparations began fairly long time ago (over a year ago) but since this time there were some unexpected circumstances (mainly project which seems to grew and grew) and that’s why SCWCD mission took me so long.

I started preparations as usual, by downloading specifications and adding API to Firefox bookmarks (list of links here). Then I bought Head First Servlets and JSP, the most recommended book for this certificate. I had ambitiously assumed that I will be able to write more detailed posts about what I learnt but unfortunately lack of time didn’t allow me to do it. Continue reading this post …


Be Sociable, Share!

Servlets – family of classes and interfaces

Tags: , , ,

Today I am going to present the most important methods, classes and interfaces in the Servlet API.

public interface Servlet

Main interface from which all starts. It defines key methods for the life cycle of servlet:


public void init(ServletConfig config) throws ServletException;
public ServletConfig getServletConfig();
public void service(ServletRequest req, ServletResponse res) throws ServletException, java.io.IOException;

public void destroy();

and one additional method


public String getServletInfo();

which should return information about servlet (version, author, resposibility, etc.) Continue reading this post …


Be Sociable, Share!

Let’s start preperations to SCWCD

Tags: , , ,

Here are some useful links, materials and books which I am going to use while preparing to Sun Certified Web Component Developer (SCWCD):

My aim is to pass this exam before July 2009 with result not lower than 80%.

Update:  And how it ended can be found in my another post – here.


Be Sociable, Share!

My impressions after passing SCJP

Tags: , ,

Info for Polish readers: this post was originally written in Polish and you can read it here with some additional details about taking exam in Prometric center in Poland.

It’s been some time since I passed my Sun Certified Java Programmer (SCJP) version 1.5, but maybe this post will help somebody to choose his way to prepare to this exam and also increase his chances to score better.

Useful stuff

  • SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055), simply “must have” for anyone planning to get his own, shiny SCJP certificate. This book covers everything you may encouter at the exam. I read it once from cover to cover and repeated chapters that contain areas I didn’t fell comfortable (Generics, Threads).
  • exam simulator EnthuWare JQ+, it costs only 25$ or 18$ (discount for students) and I helped me significantly to achieve better result
  • your favorite IDE to test your ideas, doubts and just to play with example questions from book and simulator.
  • Mariusz Lipiński’s blog (beware: it’s in Polish) where author describes his preparations to the exam in form similar to “Two minute drill” from Sierra & Bates book
  • JavaRanch SCJP Forum where you can meet authors of book I mentioned above

General tips

  • If you don’t have experience with using Java language in various projects better do all tests you can get (book, simulator, free test from the Internet) because after doing it your efficiency in finding traps, nuances will increase a lot.
  • Money spent on exam simulator are never wasted money
  • Experiment, play any time when you are unsure whether something works this way or another. Are you wondering what would happen if this question looked a little different? Don’t only think, launch your IDE and check any variation that comes to your mind. My experiments with Netbeans gave me a lot knowledge and confidence that I really understand the topic.
  • Don’t extend your preparations for too long. Pick a date, even in 3-4 months, when you are going to take the exam and consequently try to make it. Having such “deadline” in your head you will be more determined and regular. I have a friend who is studying for SCJP for more over than half a year and his preparations seems to be endless :)

More about other peoples preperations can be found at:

- (in Polish) here

- SCJP Wall of Fame at JavaRanch portal, check links next to the people names

PS: And I got 80% :)


Be Sociable, Share!