Skip to main content

Posts

Showing posts from December, 2013

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/*</url-pattern>  => for direct web page call service     </servlet-mapping>     2. Add url mapping to servlet configuration file (ex. dispatcher-servlet.x

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',         controller : 'CentersCtrl',             => for main template       }).state("app", {         templateUrl : "/vie

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.mortbay.jetty</groupId>               <artifactId>jetty-runner</artifactId>               <version>7.4.5.v20110725</version>               <destFileName>jetty-runner.jar</destFileName>             </artifactItem>

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>    <!-- context path -->         <port>8080</port>       </configuration>     </plugin>     <!-- ㅇ maven goal : jetty:run -->     <plugin>       <groupId>org.mortbay.jetty</groupId>       <artifactId>maven-jett