This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduction | |
You should use doGet() when you want to intercept on HTTP GET requests. You should use doPost() when you want to intercept on HTTP POST requests. That's all. Do not port the one to the other or vice versa (such as in Netbeans' unfortunate auto-generated processRequest() method). This makes no utter sense. | |
GET | |
Usually, HTTP GET requests are idempotent. I.e. you get exactly the same result everytime you execute the request (leaving authorization/authentication and the time-sensitive nature of the page —search results, last news, etc— outside consideration). We can talk about a bookmarkable request. Clicking a link, clicking a bookmark, entering raw URL in browser address bar, etcetera will all fire a HTTP GET request. If a Servlet is listening on the URL in question, then its doGet() method will be called. It's usually used to preprocess a request. I.e. doing some business stuff before presenting the HTML output from a JSP, such as gathering data for display in a table. | |
@WebServlet("/products |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.*; | |
import java.time.format.DateTimeFormatter; | |
import java.time.format.FormatStyle; | |
import java.time.temporal.ChronoUnit; | |
import java.time.temporal.TemporalAdjusters; | |
import java.util.*; | |
import static java.time.temporal.TemporalAdjusters.*; | |
public class Java8DateTimeExamples { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Run command sudo apt-get install maven, to install the latest Apache Maven. | |
2. Run command mvn -version to verify your installation. | |
3. Where is Maven installed? | |
The command apt-get install the Maven in /usr/share/maven. | |
$ls -ls /usr/share/maven | |
total 16 | |
4 drwxr-xr-x 2 root root 4096 Dec 7 01:28 bin | |
4 drwxr-xr-x 2 root root 4096 Dec 7 01:28 boot | |
0 lrwxrwxrwx 1 root root 10 May 28 2012 conf -> /etc/maven |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn eclipse:eclipse -DdownloadSources -DdownloadJavadocs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create file /home/{username}/.local/share/applications/eclipse.desktop | |
2. Next, copy and paste the content below into the file and save | |
[Desktop Entry] | |
Name=Eclipse JEE Oxygen | |
Type=Application | |
Exec=/home/{username}/eclipse/jee-oxygen/eclipse/eclipse | |
Terminal=false | |
Icon=/home/{username}/eclipse/jee-oxygen/eclipse/icon.xpm | |
Comment=Integrated Development Environment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# new file: to-be-added | |
# modified: to-be-modified | |
# deleted: to-be-removed | |
# | |
me$ git reset -q HEAD to-be-added | |
# ok | |
me$ git reset -q HEAD to-be-modified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1 – Add Node.js PPA | |
Node.js package is available in LTS release and the current release. It’s your choice to select which version you want to install on the system as per your requirements. Let’s add the PPA to your system to install Nodejs on Ubuntu. | |
Use Current Release: At te last update of this tutorial, Node.js 11.4.0 is the current Node.js release available. | |
sudo apt-get install curl python-software-properties | |
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - | |
Use LTS Release : At the last update of this tutorial, Node.js 10.14.1 is the LTS release available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\033[1m\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]\033[0m $ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So we decide to remove the mysql server and reinstall again, below are the step that we were done. | |
sudo apt-get remove --purge mysql* | |
sudo apt-get purge mysql* | |
sudo apt-get autoremove | |
sudo apt-get autoclean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.comprehend.servlet; | |
import org.joda.time.DateTime; | |
import org.joda.time.DateTimeZone; | |
import org.opensaml.Configuration; | |
import org.opensaml.common.binding.BasicSAMLMessageContext; | |
import org.opensaml.common.xml.SAMLConstants; | |
import org.opensaml.saml2.binding.decoding.HTTPPostDecoder; | |
import org.opensaml.saml2.binding.encoding.HTTPRedirectDeflateEncoder; | |
import org.opensaml.saml2.core.*; |