<%@ page contentType="text/html; charset=big5"%> <%@ page import="java.io.*" %> <%@ page import="java.util.*" %> <%@ page import="javax.imageio.*" %> <%@ page import="java.awt.image.*" %> <%@ page import="imageinfo.*" %> <%! private static class DM{ String id; String title; String photoURL; int width; int height; } public String readFile(File file){ FileInputStream fis = null; InputStreamReader isr = null; BufferedReader br = null; StringBuffer sb = new StringBuffer(); try{ fis = new FileInputStream(file); isr = new InputStreamReader(fis, "Big5"); br = new BufferedReader(isr); String line = null; while ( (line = br.readLine()) != null) sb.append(line); } catch(Exception e){ sb.append(e.getMessage()); } finally{ try{ if ( br != null ) br.close(); if ( isr != null ) isr.close(); if ( fis != null ) fis.close(); } catch(IOException e){} } return sb.toString(); } public String getDMById(ServletContext application, String id) { File dmFolder = new File(application.getRealPath(".")); return null; } public String findPhotoURL(ServletContext application, File file) throws Exception{ File[] fileNames = file.listFiles(new FilenameFilter(){ public boolean accept(File file, String s) { String ext = s.toLowerCase(); return ext.endsWith("jpg") || ext.endsWith("png") || ext.endsWith("gif") ; } }); if (fileNames.length != 0){ //System.getProperties().put("file.encoding", "UTF-8"); //throw new Exception(fileNames[0].getAbsolutePath()); return file.getName() +"/"+new String(fileNames[0].getName()); } else{ return ""; } } public Map getAllDM(ServletContext application) throws Exception{ File dmFolder = new File(application.getRealPath("./DM")); TreeMap dms = new TreeMap(new Comparator(){ public int compare(Object o, Object o1) { String a = (String)o; String b = (String)o1; if (a == null){ if (b == null){ return 0; } else { return -1*b.compareTo(a); } } else{ return -1*a.compareTo(b); } } }); File[] files = dmFolder.listFiles(); for (int i = 0; i < files.length; i++){ File file = files[i]; if (file.exists() && file.isDirectory()){ DM dm = new DM(); dm.id = file.getName(); dm.title = readFile(new File(file.getPath()+"/title.txt")); dm.photoURL = findPhotoURL(application, file); setSize(application,dm); dms.put(dm.id, dm); } } return dms; } public boolean setSize(ServletContext application, DM dm) throws Exception{ FileInputStream file = null; try{ file = new FileInputStream(application.getRealPath("./DM")+"/" + dm.photoURL); //BufferedImage bi = ImageIO.read(file); //return bi.getWidth() < bi.getHeight(); ImageInfo ii = new ImageInfo(); ii.setInput(file); if (!ii.check()) { System.err.println("Not a supported image file format."); throw new Exception("check failed"); } else { dm.width = ii.getWidth(); dm.height = ii.getHeight(); int width = Math.min(dm.width, 800); int height = Math.min(dm.height, 600); double ratio = Math.min(width/(double)dm.width, height/(double)dm.height ); dm.width = (int)(ratio*dm.width); dm.height = (int)(ratio*dm.height); return ii.getWidth() < ii.getHeight(); // there are other properties, check out the API documentation } } finally{ if ( file != null) file.close(); } } %> <% response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); Map dmList = getAllDM(application); %> **道地泰式風味•盡在湄南小鎮**
   
  <% String dmid = request.getParameter("dmid"); DM mainDM = null; if (dmid != null) mainDM = (DM)dmList.get(dmid); DM dm = (DM)dmList.values().iterator().next(); %>
<%=dm.title%>
 
 

湄南小鎮係創辦於民國84年,在台灣草創初期階段,即指派 幹部赴泰國「焜湄餐廳」,接受各項正統之泰國料理訓練,除 了充分了解各項食材之特色外,並針對國人口味的泰國菜,同 時聘請具30年經驗之泰籍顧問潘妮女士,親自定期來台指導, 以維持品質,嚴格把關。

民國84年初,泰國菜風潮初起,湄南小鎮於台北市光復店, 全國第一家推出泰式料理「現點、現炒、吃到飽」模式,讓國 人能以平價消費,即可享用到美味的泰式料理,首創之舉更造 成業界轟動。


湄南小鎮之經營模式及理念,在其經營團隊對泰國料理的熱愛執著及獨特見解下,小至食材、醬料 、口味之品質穩定,大至物料配送保存、中央廚房的概念等,皆逐一推動執行,更讓同業望塵莫及, 而經常維持六、七十道隨時快炒、新鮮上菜的特色,更是湄南小鎮獨領風騷的重要原因,以奠定今 日湄南小鎮之口碑。

目前湄南小鎮各分店皆為直營連鎖店,在北部有復興店、南京店、林森店、桃園店、中壢店等五家分店,其 各分店皆派駐具專業熱忱的經理人,及以服務客戶至上的服務人員,在您享受熱騰騰佳餚的同時, 更讓您有賓至如歸的感覺,以提供最完善的現場服務。

 
©2005.Mae Nam Thai Food. All rights reserved.