แก้ Tapestry 5 ให้ใช้กับ UTF-8


เข้าไปอ่าน http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding มา พยายามจะแก้ตามเขาหละ แต่ว่าแก้แล้ว Eclipse เตือนว่ามี Error ที่

requestGlobals.getHTTPServletRequest().setCharacterEncoding("UTF-8");

ประมาณว่าเกี่ยวกับ  HTTPServletRequest หลังจากที่ตามหาอยู่พักใหญ่ก็เลยคิดว่าต้องลง servlet-api ซึ่งทำได้ไม่ยากแก้ pom.xml นิดหน่อย เดี๋ยว Maven ลงให้เอง 

--- pom.xml.old 2007-06-10 18:30:49.000000000 +0200
+++ pom.xml     2007-06-10 17:51:27.000000000 +0200
@@ -24,6 +24,14 @@
             <version>1.2.9</version>
         </dependency>
 
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.4</version>
+        </dependency>
+
+
+
         <!-- A dependency on either JUnit or TestNG is required, or the surefire plugin (which runs the tests)
              will fail, preventing Maven from packaging the WAR. Tapestry includes a large number
              of testing facilities designed for use with TestNG (http://testng.org/), so it's recommended. -->

 

หลังจากสั่ง mvn compile แล้ว mvn ก็ download มาลงให้เลย

 

ป.ล. ช่วงนี้งงๆ ใช้ Maven บ้าง Subversion บ้างสั่ง svn compile เฉย :-P 

คำสำคัญ (Tags): #maven#tapestry 5#utf-8
หมายเลขบันทึก: 102352เขียนเมื่อ 10 มิถุนายน 2007 23:30 น. ()แก้ไขเมื่อ 28 มีนาคม 2012 01:02 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (5)

ตัว Tapestry เป็นframework เหมือนพวก struct ไหมครับ..

ยังไม่เคยลองใช้ framework ใน java เลยครับ แต่เคย

ได้ยินว่า struct เป็น framework ตัวหนึ่ง - - 

กรณี servlet api ปกติ เรามักจะใส่ scope = compile ลงไปใน dependency ด้วย 
เพื่อบอกให้รู้ว่า ใช้เฉพาะตอน compile ไม่ต้อง pack ใส่ war เวลา deploy
compile
insiderboy: Tapestry ก็เป็น framework ที่แข่งขันกับ struts เหมือนกัน แต่ว่าดูเหมือนก็ต่างกันไม่น้อย

pphetra: พี่ pok ตามมาอ่านด้วย ขอบคุณครับ

 

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>compile</scope>
        </dependency>

 

ผมแก้แล้วหน้าตาแบบนี้ (สงสัยต้องลองทำ war ตรงคำตอบดู) 

 

เสริม
insiderboy: struts มีลักษณะเป็นแบบ action centric
ส่วน tapestry มีลักษณะเป็นแบบ component centric

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท