Customize tag lib 2

本文介绍如何通过自定义Struts2组件和标签库来创建一个数据表格,该表格使用jQuery插件进行增强,并展示了从定义组件到配置及使用的完整步骤。

We also can customize the tag lib using component class, here are the steps:

1. Define the component

 

 

2. Define the tag, here we'll define a datagrid using jQuery plugin, so you should add necessary javascript before using the tag.

 

 

3. Define the tld, which should be added to "WEB-INF/tld/tms-tags.tld".

 

 

4. Configure the tag in web.xml

 

 

5. Use the tag lib in jsp

 

 

Ok, you'll see the result.

['food_lib_category_add', 'food_lib_food_add_ingredients', 'food_lib_food_ok', 'food_lib_food_tag', 'food_lib_food_delete_history', 'food_lib_ifa_all', 'food_lib_ifa_shelf', 'food_lib_ifa_humidity_zone', 'food_lib_ifa_my_zone', 'food_lib_ifa_fresh_box', 'food_lib_ifa_my_zone2', 'food_lib_ifa_fresh_box2', 'food_lib_ifa_freezer', 'food_lib_ifa_str_add_to', 'food_lib_ifa_str_add_to_shelf', 'food_lib_ifa_str_add_to_humidity_zone', 'food_lib_ifa_str_add_to_my_zone', 'food_lib_ifa_str_add_to_fresh_box', 'food_lib_ifa_str_add_to_freezer', 'food_lib_ifa_str_food_storage_management', 'food_lib_food_add_to_fridge', 'food_lib_food_add_to_common_list', 'food_lib_food_save_no_empty', 'food_lib_food_vegetables', 'food_lib_food_fruit', 'food_lib_food_meat', 'food_lib_food_fishery', 'food_lib_food_bean_products', 'food_lib_food_condiments', 'food_lib_food_beverages', 'food_lib_food_drinks_and_other', 'food_lib_food_customize', 'food_lib_no_related_ingredients', 'food_lib_expiration_date', 'food_lib_all', 'food_lib_fridge', 'food_lib_freezer', 'food_lib_variable_temperature', 'food_lib_food_all', 'food_lib_fresh', 'food_lib_overdue', 'food_lib_expired', 'food_lib_days_3', 'food_lib_days_7', 'food_lib_days_15', 'food_lib_days_30', 'food_lib_day', 'food_lib_days', 'food_lib_cancel', 'food_lib_comm_list', 'food_lib_enter_food_name_here', 'food_lib_food_due_date', 'food_lib_title_food_management', 'food_lib_selecting_all', 'food_lib_delete_confirm', 'food_lib_delete_cancel', 'food_lib_hint_cabin_empty', 'food_lib_delete_food', 'food_lib_hint_delete_foods', 'food_lib_kind', 'food_lib_kinds', 'food_lib_hint_deleting_food', 'food_lib_food_deleted_successfully', 'food_lib_food_name', 'food_lib_title_add_new_food', 'food_lib_search_for_ingredients', 'food_lib_network_connection_failure', 'food_lib_reload', 'food_lib_remind_common_list', 'food_lib_remind_custom_list', 'food_lib_delete_succeeded', 'food_lib_remind_common_list_max', 'food_lib_title_internal_view', 'food_lib_remind_food_name_exist', 'food_lib_food_add_to_freezer', 'food_lib_food_add_to_variable_temperature', 'food_lib_Add_ingredients'] 这个数组在py类中定义
最新发布
12-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值