สมัครสมาชิก   เข้าระบบ  
ประกาศ: UKM 14 ที่ ม.มหาสารคาม เลื่อนเป็นวันที่ 9-10 ม.ค. 2552
การก่อสร้างซอฟต์แวร์
वीर
อ่าน: 243
แก้ 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 

หมวดหมู่: เรื่องทั่วไป
คำสำคัญ: maven  tapestry 5  utf-8
สร้าง: อา. 10 มิ.ย. 2550 @ 23:30   แก้ไข: พ. 08 ส.ค. 2550 @ 02:56   ขนาด: 2467 ไบต์
ความคิดเห็น
ไม่มีรูป
1. insiderboy
เมื่อ จ. 11 มิ.ย. 2550 @ 07:49
288597 [ลบ]

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

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

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

ไม่มีรูป
2. pphetra
เมื่อ จ. 11 มิ.ย. 2550 @ 09:59
288858 [ลบ]

กรณี servlet api ปกติ เรามักจะใส่ scope = compile ลงไปใน dependency ด้วย 
เพื่อบอกให้รู้ว่า ใช้เฉพาะตอน compile ไม่ต้อง pack ใส่ war เวลา deploy
compile
P
3. वीर
เมื่อ จ. 11 มิ.ย. 2550 @ 14:55
289233 [ลบ]

insiderboy: Tapestry ก็เป็น framework ที่แข่งขันกับ struts เหมือนกัน แต่ว่าดูเหมือนก็ต่างกันไม่น้อย
P
4. वीर
เมื่อ จ. 11 มิ.ย. 2550 @ 15:02
289242 [ลบ]

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

 

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

 

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

 

ไม่มีรูป
5. pphetra
เมื่อ จ. 11 มิ.ย. 2550 @ 22:43
289654 [ลบ]

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

ชื่อ:
อีเมล:
IP แอดเดรส: 38.103.63.56
  เรียกใช้งานตัวจัดการข้อความ
ข้อความ:
 
รหัสสุ่ม: (ใส่รหัสสุ่มที่แสดงไว้ด้านบน)
  ยกเลิก
การพัฒนาซอฟต์แวร์