Skip to content

Instantly share code, notes, and snippets.

View MenukaIshan's full-sized avatar
🎯
Focusing

Menuka Ishan MenukaIshan

🎯
Focusing
View GitHub Profile
import democsv.DemoCSV;
import static democsv.DemoCSV.sNames;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Toolkit;
import java.awt.geom.Ellipse2D;
import java.io.BufferedReader;
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<html>
<head>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<title>Spring MVC Form Handling</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
import hsenid.config.WebConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.testng.annotations.Test;
@MenukaIshan
MenukaIshan / child moudle pom.xml
Last active December 20, 2017 06:00
This is a child module pom.xml example for Spring boot multi module example. Created for blog post https://goo.gl/Fo7iur If You want take look at Parent pom of this click https://goo.gl/77aQcP
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>multi-module-spring-boot</artifactId>
<groupId>hsenid</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@MenukaIshan
MenukaIshan / Parent moudle pom.xml
Created September 12, 2017 06:19
This is a Parent pom.xml example for Spring boot multi module example.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hsenid</groupId>
<artifactId>multi-module-spring-boot</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
@MenukaIshan
MenukaIshan / Parent moudle pom.xml
Last active December 20, 2017 06:04
This is a Parent pom.xml example for Spring boot multi module example. Created for blog post https://goo.gl/Fo7iur If you want take look at child pom of this click on https://goo.gl/QTqoWS
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hsenid</groupId>
<artifactId>multi-module-spring-boot</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
@MenukaIshan
MenukaIshan / pom.xml
Created December 24, 2017 17:19
Sample Pom.xml for Maven release plugin. Created for blog https://goo.gl/y9CfVM
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>menuka</groupId>
<artifactId>menukanows</artifactId>
<packaging>war</packaging>
<version>1.2-SNAPSHOT</version>
<name>menukanows Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
@MenukaIshan
MenukaIshan / settings.xml
Created December 24, 2017 17:24
Raw settings.xml file for example. No commented lines removed. Created for blog https://goo.gl/y9CfVM
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@MenukaIshan
MenukaIshan / Assignment.java
Created June 5, 2018 03:51
A example code which created for a stackoverflow question https://stackoverflow.com/q/50691564/2940265
package com;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import static java.lang.System.out;
java.lang.IllegalArgumentException: Invalid Compnay Id [{1}]
at hms.hris.employee.service.impl.DependantServiceFactoryImpl.lambda$dependantServiceForCompany$1(DependantServiceFactoryImpl.java:56)
at java.util.Optional.orElseThrow(Optional.java:290)
at hms.hris.employee.service.impl.DependantServiceFactoryImpl.dependantServiceForCompany(DependantServiceFactoryImpl.java:55)
at hms.hris.employee.service.impl.DependantServiceImplTest.getDependentsTest(DependantServiceImplTest.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)