SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API14 Dec 2006

How do I convert day-of-the-year to date?

In the following example we want to get the date of the specified day-of-the-year. We can define a calendar for a specific day of the year by setting the java.util.Calendar object DAY_OF_YEAR field using the set() method. The method take the field to be set and a value. package org.kodejava.util; import java.util.Calendar; public class DayOfYearToDate […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API11 Dec 2006

How do I use JNDI to get database connection or data source?

package org.kodejava.jndi; import javax.naming.Context; import javax.naming.InitialContext; import javax.servlet.Servlet; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import...

Wayan · 2 min read
CORE API / NOTES</>↗
Core API07 Dec 2006

How can I get current working directory?

A system properties named user.dir can be used if you want to find the current working directory of your Java program. package org.kodejava.io; public class CurrentDirectoryExample { public static void main(String[] args) { // System property key to get current working directory. String USER_DIR_KEY = "user.dir"; String currentDir = System.getProperty(USER_DIR_KEY); System.out.println("Working Directory: " + currentDir); […]

Wayan · 1 min read
SERVLET / NOTES</>↗
Servlet06 Dec 2006

How do I check if parameter is exists in servlet request?

ServletRequest or HttpServletRequest object has a map object that maps parameter name and its value. By accessing this map we can check if a parameter was passed in servlet request. Let’s see the example below. package org.kodejava.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOExcepti...

Wayan · 1 min read
SERVLET / NOTES</>↗
Servlet06 Dec 2006

How do I get parameter names from servlet request?

This example show you how to obtain parameter name from servlet request. By calling request.getParameterNames() you will get an Enumeration object by iterating this object you can get the parameter names. package org.kodejava.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; im...

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet03 Dec 2006

How do I read request parameter from servlet?

When creating an application with Java servlet most of the time we will work with the request and response object. From the request object we can read the parameter submitted by the user’s browser either through an HTTP GET or POST method. Basically what you need to know is when you try to get the […]

Wayan · 3 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.