Skip to main content

Posts

Angular.js html5Mode and 404 error solution with Spring framework.

ㅇ the way to get rid of # from url   http://localhost:8080/#/centers   =>   http://localhost:8080/centers     add line in app.js   $locationProvider.html5Mode(true).hashPrefix('!'); ㅇ Other problem #1 involed in html5Mode   When you access the page with url directly like below, then you'll get 404 error.       http://localhost:8080/centers     => Need to solve it in server setting for that.     1. Devide the servlet for the direct call url service from other request.       <servlet-mapping>       <servlet-name>restful</servlet-name>       <url-pattern>/rest/*</url-pattern>    => for other request     </servlet-mapping>       <servlet-mapping>       <servlet-name>dispatcher</servlet-name>       <url-pattern>/page/*<...

sample nested view with ui-view in Angular.js

ㅇ template main template /sheepgrid/app/index.html /sheepgrid/app/views/centers.html nested view /sheepgrid/app/views/layout/default.html /sheepgrid/app/views/tab1/welcome.html /sheepgrid/app/views/tab1/userTabs.html ㅇ directive   <div class="container" ui-view/>   => for main template     <div class="panel-body">       <ul data-ui-view="tabs"></ul>       <ul data-ui-view="view"></ul>       => for nested view     </div> ㅇ route       // default route       $stateProvider.state('default', {         templateUrl : '/views/layout/default.html',         controller : 'DefaultCtrl',         abstract : true       }).state('default.centers', {         templateUrl : './views/centers.html',         cont...

Spring MVC on Heroku

https://devcenter.heroku.com/articles/getting-started-with-java https://devcenter.heroku.com/articles/getting-started-with-spring-mvc-hibernate#declare-process-types-with-procfile 1. pom.xml : add plugin   <!-- for heroku -->   <plugin>     <groupId>org.apache.maven.plugins</groupId>     <artifactId>maven-dependency-plugin</artifactId>     <version>2.3</version>     <executions>       <execution>         <phase>package</phase>         <goals>           <goal>copy</goal>         </goals>         <configuration>           <artifactItems>             <artifactItem>               <groupId>org.mortba...

jetty / tomcat maven plugin example

1. pom.xml modification     <!-- context path -->     <finalName>tz.sheepshare</finalName>     <!-- ibatis mapping xml copy -->     <resources>       <resource>         <directory>${basedir}/src/main/java</directory>         <excludes>           <exclude>**/*.java</exclude>         </excludes>       </resource>     </resources>     <!-- ㅇ maven goal : tomcat:run -->     <plugin>       <groupId>org.codehaus.mojo</groupId>       <artifactId>tomcat-maven-plugin</artifactId>       <version>1.1</version>       <configuration>         <path>/</path>   ...

Closure와 lambda 설명

ㅇ Closure lambda 차이 - lambda : 익명 함수 - Closure : 자신의 정의된 영역의 변수를 에워싸고(close over) 있는 것. 또는, 자신이 정의된 영역의 변수에 접근할 수 있는 것. Closure를 사용하기 위해서 lambda(익명함수)가 사용됨 ㅇ Closure설명 https://docs.google.com/viewer?a=v&pid=forums&srcid=MTg0MjU3MDM2ODU0NjA0MzI4MzgBMTU5MDc0MTU3NDM3MzU5MTIwMjEBUUI4NE5VVjlFLVVKATQBAXYy lambda는 람다 표현식 또는 람다 함수, 그리고 이름 없는 함수(anonymous function)라고 불리우며, 그 성질은 "함수 객체(functor)와 동일하다" 할 수 있다. // Iterative version List<Sale> salesOfAHyundai = new ArrayList<Sale>(); for (Sale sale : sales) {  if (sale.getCar().getBrand().equals("Hyundai")) {  salesOfAHyundai.add(sale);  } } // Functional version  => lambda 표현식 val salesOfHyundai = db.sales.filter(_.car.brand == "Hyundai") ㅇ javascript Closure설명 => lambda : 익명함수 function exampleClosureForm(arg1, arg2){     var localVar = 8;     function exampleReturned(innerArg){         return ((arg1 + arg2)/(innerArg + loca...

Setting mongodb, redis & postgresql on heroku step by step

Setting mongodb, redis & postgresql on heroku step by step < setting mongodb on heroku > 1. create heroku app. 2. create mongodb account  * make credit on this site :  https://addons.heroku.com/    $ heroku addons:add mongohq:sandbox (free) 3. password change https://partners.mongohq.com 4. check out the connection install Tadpole DB : https://sites.google.com/site/tadpolefordb/ mongodb://<user>:<password>@paulo.mongohq.com:10037/app18663713 user: "heroku", pwd: ***** < setting redis on heroku > 1. create heroku app 2. create redis account $ heroku addons:add rediscloud:20 3. install redis  (for redis client) http://redis.io/download 4. check out heroku redis site Endpoint  pub-redis-13710.us-east-1-4.1.ec2.garantiadata.com:13710 Redis Password ***** 5. check out the connection $ redis-cli -h pub-redis-13710.us-east-1-4.1.ec2.garantiadata.com -p 13710 $ auth ****** OK $ set redis "Hell...