Home » Author Archives: Zemian Deng

Author Archives: Zemian Deng

Getting version string from a Maven based web application

apache-maven-logo

When you package a maven project, it will automatically generate a pom.properties file inside that will contains the version, artifactId and groupId information. These are handy to have and to display for your web application at runtime. One can use a method like following to retrive it. public class Application { private String version; public String getVersion() { if (version ...

Read More »

EE JSP: Generating Dynamic Content with JSTL Tag Libraries

java-interview-questions-answers

Besides writing your own Custom Tags in JSP, you will find that Java EE actually provides a set of Java Standard Tag Library (JSTL) ready for you to use. These built-in tags include repeating (for-loop) tags, if condition tags, variable declaration and output tags etc. The Libraries also come with many utility functions and international message formatting tags. Here is ...

Read More »

EE JSP: Generating Dynamic Content with Custom Tag Libraries

java-interview-questions-answers

When developing View layer in a web application, you want to try not to duplicate content in JSP files as much as possible. The JSP spec API allows you to reduce this duplication by using tag libraries. A custom JSP tag is a user defined xml tag element that you can insert into JSP file to replace with some dynamic ...

Read More »

EE JSP: The Reversed Jacket of Servlet

java-interview-questions-answers

Generating HTML from Servlet is only practical if you have small amount of pages, or needed fine control of the content you are generating, (binary PDF etc). For most application, the output is going to be HTML, and we need a better way to do this; and that’s where the JSP (Java Server Pages) comes in. With JSP, you write ...

Read More »

EE Servlet 3: Developing User Login with Session and Filter

java-interview-questions-answers

I have introduced the Application class in my previous post where you can setup backend services. One example service I added is the UserService. This service will load a Java users properties file that contains username and password sets; and it’s used later to authenticate users to login into the web application. Now I will show how the login part ...

Read More »

EE Servlet 3: How to Setup Backend Services in a Web Application

java-interview-questions-answers

In a web application, providing user interfacing (UI) is often only half of the job. Many applications have requirements that’s supported by backend services. Some example of backend services are scheduler process (batch processing), listen to a queue and respond when messages come in, or simple thing such as storing information for the entire application to use. These global data ...

Read More »

EE Servlet 3: Simple Form Processing

java-interview-questions-answers

Form handling in web application is like bread and butter for most Web developers. It will not be much use if we can not capture users input and process it. So I have included a simple FormServlet in my servlet3-example  that demonstrated few frequently used form inputs you might encounter. Here is how it looks like:         ...

Read More »

EE Servlet 3: Generating HTML output in Servlet

java-interview-questions-answers

If you just need to handle a handful of requests URI in your EE web module, then it might be easier to generate your own HTML response in your Servlet code instead of using a full blown template library. As part of my examples, I tried out a very simple Java DSL that generate html output when writing your own ...

Read More »

Writing your own logging service?

software-development-2-logo

Application logging is one those things like favorite Editors war: everyone has their own opinions and there are endless of implemenations and flavors out there. Now a days, you likely would want to use something already available such as Log4j or Logback. Even JDK has a built in “java.util.logging” implementation. To avoid couple to a direct logger, many projects would ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.