Wicket. 2013.09.12 Hiroto Yamakawa



Similar documents
Document and entity information

レッドハット 製 品 プライスリスト Red Hat Enterprise Linux2013 新 製 品 (ベースサブスクリプション) 更 新 :2015 年 4 22

Panasonic AC-DC Power Supply Design Support Service

この 外 国 弁 護 士 による 法 律 事 務 の 取 扱 いに 関 する 特 別 措 置 法 施 行 規 則 の 翻 訳 は 平

レッドハット 製 品 プライスリスト Red Hat Enterprise Linux 製 品 (RHEL for HPC) 更 新 :2015 年 4 22

Graduate Program in Japanese Language and Culture (Master s Program) Application Instructions

Discover the power of reading for university learners of Japanese in New Zealand. Mitsue Tabata-Sandom Victoria University of Wellington

Cost Accounting 1. B r e a k e v e n A n a l y s i s. S t r a t e g y I m p l e m e n t a t i o n B a l a n c e d S c o r e c a r d s

Advanced Training Program for Teachers of the Japanese-Language Application Instructions For FY 2016

How To Teach English At Kumon

医 学 生 物 学 一 般 問 題 ( 問 題 用 紙 1 枚 解 答 用 紙 2 枚 )

Data Mining for Risk Management in Hospital Information Systems

育 デジ (Iku-Digi) Promoting further evolution of digital promotion

TS-3GB-S.R v1.0 VoIP Supplementary Services Descriptions: Call Forwarding - Unconditional

Current Situation of Research Nurse Education and Future Perspectives in Japan

Direct Marketing Production Printing & Value-Added Services: A strategy for growth

Electricity Business Act ( Act No. 170 of July 11, 1964)

Bushido: Way of the Samurai. Golden Screens. Chokuo TAMURA Hawks with pine and plum blossom x cm each

EDB-Report. 最 新 Web 脆 弱 性 トレンドレポート( ) ~ Exploit-DB( 公 開 されている 内 容 に 基 づいた 脆 弱 性 トレンド 情 報 です

Public Financial Assistance for Formal Education in Japan

レッドハット 製 品 プライスリスト 標 準 価 格. Red Hat Enterprise Linux 製 品 (RHEL Server)

ใบสม ครเข าร วมโครงการน ส ตแลกเปล ยนมหาว ทยาล ยเกษตรศาสตร

BULBOUS CELL MEDIA GROUP

For victims of traffic accidents

Agenda. About Gengo. Our PostgreSQL usage. pgpool-ii. Lessons

Why today? What s next?

Abbreviations. Learning Goals and Objectives 学 習 到 達 目 標. Structure of Presentation

Cash, Receivables & Marketable Securities

Teacher Training and Certificate System

第 2 回 Linux-HA Japan 勉 強 会


AW Travelling Light

Using the Moodle Reader Module to Facilitate an Extensive. Reading Program

How To Run A Server On A Microsoft Cloud Server (For A Small Amount Of Money)

California Subject Examinations for Teachers

外 部 委 託 が 進 む 中 での 地 方 自 治 体 職 員 の 雇 用 の 保 護 PROTECTION OF EMPLOYMENT FOR LOCAL GOVERNMENT WORKERS UNDER OUTSOURCING

Green Solution with Simegy

SPECIFICATION. Not recommend for new design. MS6M Power Integrated Module 7MBR15UF060 MS6M Fuji Electric Device Technology Co.,Ltd.

Upper Secondary Education in Japan

第 9 回 仮 想 政 府 セミナー Introduction Shared Servicesを 考 える ~Old but New Challenge~ 東 京 大 学 公 共 政 策 大 学 院 奥 村 裕 一 2014 年 2 月 21 日

My experience of Ruby Education in Taiwan

Chiba Institute of Technology Graduate School

Linux Foundation Automotive Summit - Yokohama, Japan

7 myths about cars and free trade agreements

Posting and Reading Messages (PC version) 1/4


HIF 2015 Japanese Language and Japanese Culture Program

Changing Views on Motivation in a Globalizing World

Melonbooks DL Howto How to register, purchase and enjoy Doujin contents that are sold in Melonbooks DL and shut-out disgusting excuse of reproduction.

Ritsumeikan University Global 30 Project AY 2012 Follow-up

<HNAS_SNMP 監 視 取 扱 説 明 書 別 紙 2 イベントリスト> Event ID

さくらインターネット 研 究 所 上 級 研 究 員 日 本 Vyattaユーザー 会 運 営 委 員 松 本 直 人

Ibaraki University. Graduate School of Agriculture. (Master s Program)

Most EFL teachers in Japan find that there are groups of verbs which consistently

Chiba Institute of Technology Graduate School

EFL Information Gap Activities for Architecture Majors

Preschool Education and Care in Japan

Act on Special Measures Concerning Nuclear Emergency Preparedness (Act No. 156 of December 17, 1999)

Getting Started. A guide for newly qualified translators

AUTOMOBILE LIABILITY SECURITY ACT

Visitors International

Network Camera SNC-Z20N/Z20P 設 置 説 明 書 JP. Installation Manual GB. Manuel d installation FR. Manual de instalación ES お 買 い 上 げいただきありがとうございます

LEAVING CERTIFICATE 2011 MARKING SCHEME JAPANESE HIGHER LEVEL

The Course of Study is the series of guidelines for subject

Industrial Accident Compensation Insurance Application Guidance for Foreign Workers <Volume 2>

Bluetooth FAQ. This document is an FAQ (Frequently Asked Questions) about Bluetooth in general and Logitech products using Bluetooth technology.

Design Patterns. Elemental Microformats. Compound Microformats KEY. Datetime Pattern <abbr class="foo"

Network Camera SNC-CS3N/CS3P 設 置 説 明 書 JP. Installation Manual GB. Manuel d installation FR. Manual de instalación ES お 買 い 上 げいただきありがとうございます

New Publication of IIMA Global Market Volatility Index

Component Based Web Development with Apache Wicket

For thousands of years, teachers have looked for products to assist them in educating

Interest in the relationship between religion and language

Design Act ( Act No. 125 of 1959)

Gender Equality in Education in Japan

GRADUATE SCHOOL OF INTERNATIONAL RELATIONS

Patent Act ( Act No. 121 of 1959)

Hello, Chicago Okinawa Kenjinkai members,

Procedures to apply for Doctoral Degree

Corporate Management Strategy of a Life Insurance Company

MPLS Configration 事 例

Employment Security Act (Act No. 141 of 1947)

Unwillingness to Use Social Networking Services for Autonomous Language Learning among Japanese EFL Students

The existence of credential effects in Canadian nursing education; Quebec versus the rest of Canada

Absolute Beginner s Guide to Hiragana (With an Introduction to Grammar and Kanji)

Higher Education in Japan

Internal USB port kit installation

JF Standard for Japanese-Language Education 2010

PRACTICE. Field Trial against Cyber-attacks through International Collaboration ISPs Effort to Establish Quick Response Scheme. September 24th, 2013

Digital Graphic Printer

Welcome Guide. SD/TF Card Reader. Model: AR200

オープンソース NFV プラットフォーム の 取 り 組 み

Transcription:

Wicket 2013.09.12 Hiroto Yamakawa

@gishi_yama yamakawa@photon.chitose.ac.jp Apache Wicket 6 Wicket Wicket-Sapporo New!

"...Wicket Java " Java Apache Wicket, "Apache Wicket Web ",, pp.17 "...Apache Wicket is a Java software framework that aims to bridge the between object-oriented programming and the fact that the web is built on HTTP, which is a stateless protocol." Martijn Dashorst, Eelco Hillenius, "Wicket in Action", Manning Publications Co., pp.23 "Wicket simplifies web development and makes it fun." Igor Vaynberg, "Apache Wicket Cookbook", Packt Pablishing, pp.1

Wicket Java Web

" Web Wicket Web, "Wicket 1 Hello, Wicket",, http://gihyo.jp/dev/feature/01/wicket/0001 "

Wicket =

General schema of page request handling for a component oriented framework Andrea D B, Carsten H, Christian K, Daniel B, "Apache Wicket User Guide", http://wicketguide.comsysto.com/guide/chapter2.html#chapter2_2 Wicket Wicket

http://wicket.apache.org/

POJO XML Java Web Apache Wicket

HTML Java

<p>foo</p> <p>bar</p> foo, bar JSP Web... HTML HTML (HTML )

<p wicket:id="foo">foo</p> <p wicket:id="bar">bar</p> Apache Wicket... TestPage.html TestPage.java add(new Label("foo", new Model("こんにちは!"))); add(new Label("bar", new Model("Wicket-Sapporoへようこそ!"))); <p>こんにちは!</p> <p>wicket-sapporoへようこそ!</p> Browser

wicket:id Java HTML HTML (HTML )

HTML

POJO HTML Java

XML Web.xml servlet-filter, servlet-mapping

Web.xml <filter> <filter-name>myapp</filter-name> <filter-class>org.apache.wicket.protocol.http.wicketfilter</filter-class> <init-param> <param-name>applicationclassname</param-name> <param-value>jp.example.myapplication</param-value> </init-param> </filter> <filter-mapping> <filter-name>myapp</filter-name> <!-- コンテキストパス 以 下 はWicketの 制 御 の 対 象 にする 場 合 --> <url-pattern>/*</url-pattern> </filter-mapping> URL Java Java

XML XML

...

Swing

CleanURL Ajax JUnitTest Java Wicket 6 Ajax JQuery i18n Html

Wicket Auth/Roles API API Google Guice Spring CDI Velocity JMX Bootstrap API

Web Framework Benchmarks(Round 6, Language:Java, Tests:Single Query, HardWare:i7) http://www.techempower.com/benchmarks/ JSON

http://www.cafepress.com/apachewicket

"Several books have been written about Apache Wicket, 5 in English, 2 in German and 1 in Japanese." (Books about Wicket, http://wicket.apache.org/learn/books/ )

Wicket Ver,1.4 http://www.amazon.co.jp/dp/4798022217/ Wicket

Wicket User Guide ver,6 https://code.google.com/p/wicket-guide/ Wicket http://wicketguide.comsysto.com/

Wicket Wicket-JA http://www.wicket-ja.org/

Q. Wicket-Ja ML... A. ML

...

http://builtwithwicket.tumblr.com/

( in Japan... e SNS

Wicket Java POJO HTML/ XML

Wicket

MacOSX OS Mavan3 Jetty 1. https://github.com/gishi-yama/wicket_workshop 2. Download ZIP 3. $ cd wicket_workshop-master $ mvn package $ mvn jetty:run 4. http://localhost:8080/wiclet_workshop/

Wicket Maven Wicket QuickStart Maven http://wicket.apache.org/start/quickstart.html Maven pom.xml <dependency> <groupid>org.apache.wicket</groupid> <artifactid>wicket-core</artifactid> <version>6.10.0</version> </dependency>

Wicket Wicket INF/lib/ Maven http://wicket.apache.org/ /WEB- wicket-core.jar wicket-request.jar wicket-util.jar

Wicket Wicket SLF4J Wicket QuickStart SLF4J Log4J Logback http://logback.qos.ch/ http://www.slf4j.org/ SLF4J

Wicket Web.xml web.xml <filter> <filter-name>myapp</filter-name> <filter-class>org.apache.wicket.protocol.http.wicketfilter</filter-class> <init-param> <param-name>applicationclassname</param-name> <param-value>jp.example.myapplication</param-value> </init-param> </filter> <filter-mapping> <filter-name>myapp</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> filter/filter-name filter/init-param/param-value filter-mapping/url-pattern

WebApplication package jp.example; public class MyApplication extends WebApplication { /* snip */ } web.xml filter/initparam/param-value <init-param> <param-name>applicationclassname</param-name> <param-value>jp.example.myapplication</param-value> </init-param>

public class MyApplication extends WebApplication { } @Override public Class<? extends Page> gethomepage() { return HomePage.class; } HomePage.class.java

HTML HTML SimplePage.html <!DOCTYPE html> <html lang="ja" xmlns:wicket="http://wicket.apache.org"> <head> <meta charset="utf-8" /> </head> <body> <p>message1 is here.</p> </body> </html>

HTML wicket:id <body> <p wicket:id="label1">message1 is here.</p> </body> wicket:id

HTML public class SimplePage extends WebPage { public SimplePage() { } } SimplePage.java WebPage HTML HTML Wicket

HTML public class SimplePage extends WebPage { public SimplePage() { // 1. 表 示 したいデータ(オブジェクト)を 用 意 する. String message1 = "こんにちは!"; // 2. 表 示 したいオブジェクトをModelオブジェクトでラップします IModel<String> model1 = new Model<>(message1); // 3. Modelを 対 応 するHTMLのwicket:id 用 のコンポーネントにセットします Label label1 = new Label("label1", model1); } // 4. コンポーネントをページにaddします add(label1); }

HTML...

Wicket, "Apache Wicket Web ",, pp.29

HTML 1 HTML Wicket:id add http://www.wicket-library.com/wicketexamples/compref/

Label IModel<String> model = new Model<>("こんにちは!"); Label foolabel = new Label("foo", model); add(foolabel); MultiLineLabel Label Model IModel<String> model = new Model<>("こんにちは!\n 今 日 も 良 い 天 気 ですね!"); MultiLineLabel foolabel = new MultiLineLabel("foo", model); add(foolabel);

Link IModel<Bean> model = new Model<>(new Bean()); Link<Bean> link = new Link<Bean>("foo", model) { private static final long serialversionuid = 1L; @Override public void onclick() { // リンクやボタンがクリックされたときのイベント 処 理 // この 例 では LinkにセットされたModel( 中 身 はBeanオブジェクト)を // 次 ページへ 渡 して 遷 移 する setresponsepage(new NextPage(getModel())); } }; add(link);

Form TextField : IModel<Bean> model = new CompoundPropertyModel<>(new Bean()); Form<Bean> form = new Form<Bean>("foo", model)) { private static final long serialversionuid = 1L; @Override protected void onsubmit() { // Submitボタンがクリックされたときのイベント 処 理 // たとえば BeanをDBに 登 録 する など } }; add(form); form.add(new TextField<String>("input")); ) CompoundPropertyModel TextField Bean#input

Wicket HTML Form form setmodel(imodel) getmodel() HTML wicket:id

wicket:id HTML <form wicket:id="form"> <input type="text" wicket:id="name"> </form> <p wicket:id="label">message</p> Java Form<Bean> form = new Form<Bean>("form", formmodel) { /* snip */ }; // wicket:id="form" は 最 上 位 なので ページにadd add(form); // wicket:id="name" は "form" の 入 れ 子 の 位 置 にあるので // wicket:id="form" のコンポーネントであるformにadd form.add(new TextField<String>("name")); Label label = new Label("label", labelmodel); // wicket:id="label" は 最 上 位 なので ページにadd add(label);

Model String str = "こんにちは"; IModel<String> model = new Model<>(str); add(new Label("foo", model);

ListModel Model List<Integer> list = new ArrayList(); list.add(1); list.add(2); IModel<List<Integer> listmodel = new ListModel<>(list);

Bean CompoundPropertyModel wicket:id

CompoundPropertyModel IModel beanmodel = new CompoundPropertyModel<>(new Bean()) setdefaultmodel(beanmodel); add(new Label("loginId"); add(new Label("name");

ResourceModel Java Code i18n IModel<String> beanmodel = new ResourceModel("form.error"); form.error= 送 信 エラーが 発 生 しました 入 力 値 を 確 認 してください

setobject(object) getobject() Serializable

Wicket HTML HTML HTML wicket:id Wicket