This file contains 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 org.demo.business.service; | |
import java.util.List; | |
public interface IServices<T, PK> { | |
public T load(PK id) ; | |
public void save(T entity); |
This file contains 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 org.demo.business.service; | |
import java.util.List; | |
import org.demo.util.EntityManagerHelper; | |
import org.demo.vo.bean.Book; | |
import org.demo.vo.dao.JpaBookDAO; | |
import com.opensymphony.xwork2.util.logging.Logger; | |
import com.opensymphony.xwork2.util.logging.LoggerFactory; |
This file contains 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
- http://<host>:<port>/<root>/<domaine>/load/id (get)<br /> | |
- http://<host>:<port>/<root>/<domaine>/delete/id (get ... oui le pur REST impose un delete http ...)<br /> | |
- http://<host>:<port>/<root>/<domaine>/save (post)<br /> | |
- http://<host>:<port>/<root>/<domaine>/search (post)<br /> |
This file contains 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
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> | |
<!DOCTYPE html> | |
<%@ taglib prefix="s" uri="/struts-tags" %> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>BookStore</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="Book"> | |
<meta name="author" content="asic"> |
This file contains 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
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> | |
<!DOCTYPE html> | |
<%@ taglib prefix="s" uri="/struts-tags"%> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>BookStore</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="Book"> | |
<meta name="author" content="asic"> |
This file contains 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 org.demo.action; | |
import java.util.List; | |
import org.demo.business.service.IServices; | |
import com.opensymphony.xwork2.ActionSupport; | |
import com.opensymphony.xwork2.util.logging.Logger; | |
import com.opensymphony.xwork2.util.logging.LoggerFactory; |
This file contains 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 org.demo.action.book; | |
import java.util.List; | |
import org.demo.action.GenericAction; | |
import org.demo.business.service.BookServices; | |
import org.demo.business.service.IServices; | |
import org.demo.vo.bean.Book; | |
public class Actions extends GenericAction<Book, Integer> |
This file contains 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
<?xml version="1.0"?> | |
<!DOCTYPE validators PUBLIC | |
"-//Apache Struts//XWork Validator 1.0.2//EN" | |
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> | |
<validators> | |
<field name="current.id"> | |
<field-validator type="required"> | |
<message key="requiredfield"/> | |
</field-validator> | |
</field> |
This file contains 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
<?xml version="1.0"?> | |
<!DOCTYPE validators PUBLIC | |
"-//Apache Struts//XWork Validator 1.0.2//EN" | |
"http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> | |
<validators> | |
<field name="current.isbn" > | |
<field-validator type="requiredstring" > | |
<message key="requiredfield" /> | |
</field-validator> |
This file contains 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 org.demo.util; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; |