淘宝将推开放平台项目(转)

by sundy 8/14/2009 5:45:46 AM

      7月18日早间消息,淘宝公司确认即将推出开放平台项目TOP(taobao open platform),此举意味着这家中国最大的C2C网站正式加入开放平台的阵营,并逐渐对外开放API(应用程序可编程接口)。

U2020P2T1D2335122F13DT20080718055859

据了解,淘宝从去年开始便在酝酿开放平台事宜,这是阿里巴巴集团在互联网战略上所迈出的重要一步。之前,包括淘宝、阿里巴巴、支付宝等平台的应用开发主要由阿里软件提供支持,这种模式也注定它没法充分满足用户的个性化需求。

业内人士认为,Facebook开放平台的示范效应,以及国内互联网企业陆续加入开放平台阵营,是淘宝最终选择走向开放的原因。也有分析人士预计,百度C2C很可能会采取开放平台策略对付淘宝,早日选择开放能让淘宝在竞争中占据主动。

相关人士透露,从去年年底淘宝曾与阿里软件邀请独立软件开发商(ISV)去杭州洽谈合作,其实就是讨论加入淘宝开放平台计划,前期已有数十家ISV取得相关资格。通过淘宝API,合作伙伴可创建全新商务应用,直达用户,赢取潜在的利润。

在淘宝网站上,一个关于淘宝TOP的网页已悄然上线,上面有关于淘宝开放平台项目的详细介绍。据悉,淘宝开放平台将提供淘宝网C2C电子商务平台的API接口、开发环境以及商务应用环境。

值得注意的是,淘宝开放API采取了渐进策略。“在不危及淘宝网及阿里集团信息安全的前提下,我们逐步开放淘宝API。”淘宝方面表示,目前已有包括卖方营销平台、买方浏览工具、宝贝管理等12个大类的商务应用可对外开放,其中4个领域已有厂商进入。

2005年2月,淘宝网向所有电子商务用户开放网上支付平台,成就了今天号称拥有9千万用户的支付宝。如今,淘宝以开放API的姿态打响了C2C保卫战的枪声。

目前,国内开放平台的互联网企业已有近十家,其老对手易趣就有数百家ISV为其提供开发应用。业内人士认为,淘宝开放平台会吸取易趣对ISV的管理与运营不够紧密的经验,实现与ISV的共赢。(全智)

淘宝开放(开发)平台地址:

http://open.taobao.com/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Newscaster | Internet Communion

Live Android,讓你也可以在PC跑Android

by sundy 8/14/2009 5:30:00 AM

android_live

想要一嚐Android作業系統滋味的人,可以不必去買 "貴鬆鬆" 的HTC Magic,已經有人寫出可以在PC上跑的版本,叫做 "live-android" ,可以在像是VMWARE的虛擬機器或是用Live CD的方式執行。

不過,或許是才剛開發不久,Annti試了好幾部電腦都不行,最後才在同事的Dell成功進去系統,操作起來跟Android Phone的感覺一樣,只是畫面比較大(廢話),如果可以再搭配Hero的Sense介面,那就更棒了。

ISO下載:請點我

这是我机器上的效果:

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Mobile & Wireless | Newscaster

无意中翻出自己这多年前开发的小部分移动程序(通用)

by sundy 8/13/2009 2:50:49 PM

因为自己行业移动系统开发的比较多 。 因此难以列举 。 就拿几个自己写着玩的小东西来看看吧,没有别的用意 ,只是让人知道我还曾经写过程序 (曾经年轻过) 呵呵 !
1 , 拼图游戏 , 和朋友两人开发玩的 。 适用机型 P802 , P910 等
2, 手机通讯录备份系统(通过GPRS )国内第一套类似Sycmal标准,但是和移动没有谈下来。因此荒废了。
3,给中国铝业集团开发的移动办公(6年前的事情了) , J2ME
4,4年前自己开发的J2ME界面类库,当时很少这样的东西 。
5, 2003年开发的无线餐饮点菜系统PPC 客户端 for PPC
6 ,手机视频监控系统 (行业软件,就不上传了)
7, 数字洛阳移动客户端
8, 交通厅展示客户端

附件
mjigsaw.SIS (155.16 KB)

2007-7-25 21:19, 下载次数: 42

拼图游戏 for Symbian

WirelessBackup_S60.SIS (50.99 KB)

2007-7-25 21:19, 下载次数: 11

手机通讯录在线备份恢复 for Symbian 60

WirelessBackup_70s.SIS (50.99 KB)

2007-7-25 21:19, 下载次数: 7

手机通讯录在线备份恢复 for Symbian 70

J2ME界面组件库RichUI-20040503a.rar (13.08 KB)

2007-7-25 21:19, 下载次数: 16

4年前自己开发的J2ME界面类库,用在郑州铁路局手持客运系统上

程序截图.rar (825.11 KB)

2007-7-25 21:19, 下载次数: 29

无线餐饮点菜系统部分截图

MobileTechnical1.1.jar.rar (89.99 KB)

2007-7-25 21:19, 下载次数: 34

数字洛阳移动客户端(将rar扩展名去掉再安装)

mobileOA.jar.rar (88.27 KB)

2007-7-25 21:19, 下载次数: 45

给中国铝业集团开发的移动办公(将rar扩展名去掉再安装)

Traffice-Src.jar.rar (59.76 KB)

2007-7-25 21:25, 下载次数: 28

交通厅展示客户端(去rar扩展名)

backup.PNG (56.52 KB)

2007-7-25 21:25

通讯录备份系统模拟器截图

20070725_32cf92eb3ee44d0d6f426XxIdDwEwp75

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Mobile & Wireless

工信部是个易变的"女人"- 从每台电脑必须安装到绝不强制所有电脑安装绿坝

by sundy 8/13/2009 1:34:00 PM

中新网8月13日电 工业和信息化部部长李毅中表示,安装“绿坝”过滤软件是让青少年远离网络不良信息毒害,是一种公益行为,无可指责。有个别人非要把这个问题扩大化、政治化,甚至引申到攻击我们对互联网的管理制度,我觉得不符合事实,也是不负责任的。

20130838

国新办13日上午举行新闻发布会,有记者就“绿坝”软件等问题提问:关于“绿坝”,前一段时间工业和信息化部宣布要推迟强制安装这个软件,目前工业和信息化部有什么打算?

李毅中表示,“绿坝”是指在计算机上装一个过滤软件,把有碍于未成年人健康成长的黄色淫秽信息过滤掉。这项工作是从2006年开始的。刚才我也提到了,随着计算机、手机等等信息的传播,确实有不少黄色淫秽信息、录像、照片通过这些渠道在影响着、毒害着未成年人。政府和各方面收到很多家长声泪俱下的控诉“救救我的孩子”。我想这不仅是家长的呼吁,也是许多社会团体、许多人士共同的希望。因此,工业和信息化部在相关部门的配合支持下,从2006年启动这项工作,向社会公开招标,选中了两家过滤软件,然后用政府购买的方式买断这两个软件的产品和服务,在学校、网吧等公共场合,安装过滤软件,目的就是把这些有害信息过滤掉,减少、减轻对未成年人的毒害,这完全是一项公益行为,无可指责。

李毅中表示,我们首先是在学校、网吧等社会公众场合的计算机里面装这种软件,由于软件刚刚开发,过滤效果是90%,社会反响比较好,希望能够扩大一些范围。这样经过一番调查研究以后,工业和信息化部今年5月19日出台了一个文件,提出在国内生产的计算机和销售的计算机上,装这两个软件,目的就是要减轻、减少对社会的危害。

这件事情的本意是按市场规则、按自愿的原则办的,因为装上这个软件以后,你可以用,也可以不用。在买计算机的时候,赠送一个软盘或者是光盘,选择权在家长、在社会,但缺点、毛病是这个文件考虑不周,它没有表述清楚,给大家的印象好像是强制性的。所以这个文件发布以后,在社会上引起了比较大的反响,我觉得绝大多数的意见都是善意的,都是对我们工作考虑不周的情况提的意见和建议。

李毅中表示,也有一些人士针对一些不清楚的地方提出了质疑,比如说装你这个软件以后是不是个人隐私就被别人控制了?这个软件除了过滤黄色淫秽信息以外还有没有别的功能?还有一些人士提出质疑,这个是不是和WTO有矛盾?国内国外都有这样的一些意见,我也收到了美国、西欧一些商社给我和陈德铭先生的来信,我觉得大多数都是善意的。我们在6月30号进行答记者问,把上述情况做了解释和说明,我就不详细解释了。

但是有个别人非要把这个问题扩大化、政治化,甚至引申到攻击我们对互联网的管理制度,我觉得不符合事实,也是不负责任的。我们在答记者问里面已经讲得很明白,鉴于各种原因推迟强制安装这个软件。下一步如何安装和预装,我们将广泛听取各方面意见,改进这个方案。在学校、网吧等公众场合的计算机里,我们还是要装的。对于广大的消费者,充分尊重大家选择的自由,绝不会出现在所有销售的计算机里一律都要强制装上,不存在这个问题。我相信会做出妥善的处理。

李毅中表示,对于这个软件自身存在一些不足和缺陷,正在进行改进,当然我们也不排除有更好的软件,可以更多的选择,更加市场化。(据中国网文字直播整理)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Gossip | Newscaster

I just do some development on Android . now show the installing process!

by sundy 8/12/2009 2:56:47 AM

Installing the Android SDK

This page describes how to install the Android SDK and set up your development environment. If you haven't downloaded the SDK, you can do so from the Download page. Once you've downloaded the SDK, return here.

If you encounter any problems during installation, see the Installation Notes at the bottom of this page.

Upgrading?

If you have already developed applications using an earlier version of the SDK, please read Upgrading the SDK, instead.

Preparing for Installation

Before you begin, take a moment to confirm that your development machine meets the System Requirements.

If you will be developing on Eclipse with the Android Development Tools (ADT) Plugin — the recommended path if you are new to Android — make sure that you have a suitable version of Eclipse installed on your computer (3.3 or newer). If you need to install Eclipse, you can download it from this location:

http://www.eclipse.org/downloads/

A Java or RCP version of Eclipse is recommended.

Installing the SDK

After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named android_sdk_<platform>_<release>. The directory contains a local copy of the documentation (accessible by opening documentation.html in your browser) and the subdirectories tools/, add-ons/, platforms/, and others. Inside each subdirectory of platforms/ you'll find samples/, which includes code samples that are specific to each version of the platform.

Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the Android plugin or when using the SDK tools.

Optionally, you may want to add the location of the SDK's primary tools directory to your system PATH. The primary tools/ directory is located at the root of the SDK folder. Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory.

  • On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
      export PATH=${PATH}:<your_sdk_dir>/tools
  • On a Mac, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile if you haven't already set one up on your machine.
  • On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools/ directory to the path.

Note that, if you update your SDK in the future, you should remember to update your PATH settings to point to the new location, if different.

If you will be using the Eclipse IDE as your development environment, the next section describes how to install the Android Development Tools plugin and set up Eclipse. If you choose not to use Eclipse, you can develop Android applications in an IDE of your choice and then compile, debug and deploy using the tools included in the SDK (skip to Next Steps).

Installing the ADT Plugin for Eclipse

Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT), that is designed to give you a powerful, integrated environment in which to build Android applications. It extends the capabilites of Eclipse to let you quickly set up new Android projects, create an application UI, add components based on the Android Framework API, debug your applications using the Android SDK tools, and even export signed (or unsigned) APKs in order to distribute your application.

In general, using Eclipse with ADT is a highly recommended approach to Android development and is the fastest way to get started. (If you prefer to work in an IDE other than Eclipse, you do not need to install Eclipse or ADT, instead, you can directly use the SDK tools to build and debug your application.)

Once you have Eclipse installed, as described in Preparing for Installation, follow the steps below to download the ADT plugin and install it in your respective Eclipse environment.

Eclipse 3.3 (Europa)
Eclipse 3.4 (Ganymede)

  1. Start Eclipse, then select Help > Software Updates > Find and Install....
  2. In the dialog that appears, select Search for new features to install and click Next.
  3. Click New Remote Site.
  4. In the resulting dialog box, enter a name for the remote site (e.g. "Android Plugin") and enter the URL:
    https://dl-ssl.google.com/android/eclipse/

    If you have trouble aqcuiring the plugin, try using "http" in the URL, instead of "https" (https is preferred for security reasons).

    Click OK.

  5. You should now see the new site added to the search list (and checked). Click Finish.
  6. In the subsequent Search Results dialog box, select the checkbox for the "Android Plugin". This will select the nested tools: "Android DDMS" and "Android Development Tools". Click Next.
  7. Read and accept the license agreement, then click Next.
  8. On the following Installation window, click Finish.
  9. The ADT plugin is not digitally signed. Accept the installation anyway by clicking Install All.
  10. Restart Eclipse.
  1. Start Eclipse, then select Help > Software Updates....
  2. In the dialog that appears, click the Available Software tab.
  3. Click Add Site...
  4. Enter the Location:
    https://dl-ssl.google.com/android/eclipse/

    If you have trouble aqcuiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).

    Click OK.

  5. Back in the Available Software view, you should see the plugin listed by the URL, with "Developer Tools" nested within it. Select the checkbox next to Developer Tools and click Install...
  6. On the subsequent Install window, "Android DDMS" and "Android Development Tools" should both be checked. Click Next.
  7. Read and accept the license agreement, then click Finish.
  8. Restart Eclipse.

Now modify your Eclipse preferences to point to the Android SDK directory:

  1. Select Window > Preferences... to open the Preferences panel (Mac: Eclipse > Preferences).
  2. Select Android from the left panel.
  3. For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
  4. Click Apply, then OK.

Done! If you haven't encountered any problems, then you're ready to begin developing Android applications. See the Next Steps section for suggestions on how to start.

Troubleshooting ADT Installation

If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

  • If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to:
    http://dl-ssl.google.com/android/eclipse/
  • If you are behind a firewall (such as a corporate firewall), make sure that you have properly configured your proxy settings in Eclipse. In Eclipse 3.3/3.4, you can configure proxy information from the main Eclipse menu in Window (on Mac, Eclipse) > Preferences > General > Network Connections.

If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT zip file to your local machine and manually install the it:

  1. Download the ADT zip file (do not unpack it).
  2. Follow steps 1 and 2 in the default install instructions (above).
  3. In Eclipse 3.3, click New Archive Site....
    In Eclipse 3.4, click Add Site..., then Archive...
  4. Browse and select the downloaded zip file.
  5. Follow the remaining procedures, above, starting from steps 5.

To update your plugin once you've installed using the zip file, you will have to follow these steps again instead of the default update instructions.

Other install errors

Note that there are features of ADT that require some optional Eclipse components (for example, WST). If you encounter an error when installing ADT, your Eclipse installion might not include these components. For information about how to quickly add the necessary components to your Eclipse installation, see the troubleshooting topic ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".

For Linux users

If you encounter this error when installing the ADT Plugin for Eclipse:

An error occurred during provisioning.
Cannot connect to keystore.
JKS

...then your development machine lacks a suitable Java VM. Installing Sun Java 6 will resolve this issue and you can then reinstall the ADT Plugin.

Next Steps

Once you have completed installation, you are ready to begin developing applications. Here are a few ways you can get started:

Learn about Android

  • Take a look at the Dev Guide and the types of information it provides
  • Read an introduction to Android as a platform in What is Android?
  • Learn about the Android framework and how applications run on it in Application Fundamentals
  • Take a look at the Android framework API specification in the Reference tab

Explore the SDK

Explore some code

  • Set up a Hello World application (highly recommended, especially for Eclipse users)
  • Follow the Notepad Tutorial to build a full Android application
  • Create a new project for one of the other sample applications included in <sdk>/platforms/<platfrom>/samples, then compile and run it in your development environment

Visit the Android developer groups

  • Take a look at the Community tab to see a list of Android developers groups. In particular, you might want to look at the Android Developers group to get a sense for what the Android developer community is like.

Installation Notes

Ubuntu Linux Notes
  • If you need help installing and configuring Java on your development machine, you might find these resources helpful:
  • Here are the steps to install Java and Eclipse, prior to installing the Android SDK and ADT Plugin.
    1. If you are running a 64-bit distribution on your development machine, you need to install the ia32-libs package using apt-get::
      apt-get install ia32-libs
    2. Next, install Java:
      apt-get install sun-java6-bin
    3. The Ubuntu package manager does not currently offer an Eclipse 3.3 version for download, so we recommend that you download Eclipse from eclipse.org (http://www.eclipse.org/ downloads/). A Java or RCP version of Eclipse is recommended.
    4. Follow the steps given in previous sections to install the SDK and the ADT plugin.
Other Linux Notes
  • If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed in the System Requirements. In particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Java & OpenSource Domain | Mobile & Wireless

电子商务万人创业大行动的随想

by sundy 8/11/2009 7:00:00 AM

0030690184

我越想越觉得网商的规模化培训是一个很好的机会 。 我暂且起名叫“万人创业大行动” 。
要实现这个计划 , 我有如下想法:
1,不仅仅是培训 ,而是帮助在淘宝上开店,因此,特别是对商品的选择,采购的渠道,我们要有个较为充分的准备 。甚至于要帮助学员思考什么样的商品合适  。
2,一定不是长期培训 。周期控制在3个月内 。
3,对培训后的各种情况产生充分的准备 。
4,比较好的牵头人 。 需要一位较为重量的牵头人 。 几位较强的老师组成的师资团队 。
5,好的培训计划 。
关于培训计划,如下的电商的培训计划是我看过比较好的,不过还不够好 。
http://www.probiz.cn/training/course090514.html
如下是我看重的一本淘宝开店书籍
http://www.verycd.com/topics/2759562/
如果这个计划具有足够的吸引力和操作性 。 能将政府,学校 ,渠道商 , 阿里巴巴拉在一起  。那么我们的电商系很有可能借着一个契机就直接建起来了 。 而且还是直接跃升为龙头专业 。
以上是一点儿随想浅谈 。

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Education & Consultation

美国索尼发布两款新电子书终端,备有199美元低价位产品

by sundy 8/10/2009 6:56:33 AM

美国索尼电子(Sony Electronics)发布了电子书终端“Reader”的两款新机型。将于2009年8月底在美国上市。
一款是定价为199美元的“Reader Pocket Edition”。配备比现有机型的6英寸电子纸略小的5英寸电子纸。电子纸由美国电子墨水(E Ink)制造。其卖点是便携性好,“可单手操作,也可放入衣服口袋中”。机身可保存350册书的内容。充电一次,可用2周左右。在利用电子纸的电子书终端中,199美元的价格属于业界最低价位。

090810sons1
另一款是配备触摸面板的“Reader Touch Edition”。可用手指或附带的输入笔(专用笔)操作。配备电子墨水制造的6英寸电子纸。终端上配备有Oxford American English Dictionary,叩击书籍内容中的单词,便可查出其意思。
两款产品均未配备通信功能。利用附带的软件,可从电脑向终端传送内容。除了Windows之外,还支持采用Mac操作系统的个人电脑。

090810sons2
索尼电子曾公布,经与美国谷歌合作,用Reader可读取100万以上公共域(Public Domain)的内容。此次的新机型也支持这一功能。(记者:小谷 卓也)
■日文原文
米Sonyが電子書籍端末の新モデルを発表,199米ドルの低価格品など2機種
■相关报道
美国索尼电子书终端可阅览100多万册书籍,对抗“全球最大”的Barnes&Noble
三星上市电子书终端,与大型书店合作售价33万9000韩元
英Elonex推出电子书终端,与Borders合作可阅读4万5000册图书

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Gossip | Game Life | Education & Consultation

与我英文名同名的作品:传说的1983!《少年sundy》怀旧本惊现秋叶原

by sundy 8/7/2009 3:31:49 PM

月15日,一套怀旧本《少年sundy-1983》惊现秋叶原,这本包含9篇特选的曾在1983年于《少年sundy》漫画杂志上连载的作品,之所以选1983年的作品是因为当时该刊漫画连载量是目前为止最多的同时汇集了众多著名的漫画家的作品,更有人称之为“传说中的1983”。其中大部分都是大家所熟悉的如安达充成名作《棒球英豪》高桥留美子的《福星小子》以及岛本和彦的《炎之转校生》等。排版形式也和80年代一样的风格,怀旧味满载!

39_143958_3e0387442261eb1  39_143958_68d899dfaaa2636
而说到《少年sundy》,可谓是日本数一数二的漫画周刊。自1959年开始创刊,50年来多次创造了惊人的销量,与集英社的《少年jump》难分高下,我们著名的矮冬瓜柯南就是在这本杂志上连载,是日本小学馆镇馆之本。这次所发售的怀旧特辑其实也是为了纪念周刊连载50周年而特别企划的周年增刊。所以单是凭借多位漫画大神的人气,相信也会有很好的销量

39_143958_6db9dc69dff0e0b39_143958_c3c41310d37fe81

39_143958_5411a4a8bc0dece  39_143958_f95e8451e4dcebf

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Game Life

Struts源码分析4:ActionForward

by sundy 8/7/2009 11:57:40 AM

前言:发现很多j2ee的程序员基础都差得不行 ,会用ssh的甚至都不知道为何要这样,以及如何设计的 。因此为大家简单的剖析一下Struts的设计 ,以资借鉴 。

ActionForward继承了下ForwardConfig,然后就写了6个构造函数……然后就没了 汗=。=!
有一句话没翻译出来,有看得懂的来帮个忙吧 :
NOTE - This class would have been deprecated and
replaced by org.apache.struts.config.ForwardConfig except for the fact that
it is part of the public API that existing applications are using.
下面是翻译后的源码。

package org.apache.struts.action;
import org.apache.struts.config.ForwardConfig;
/**
* 一个ActionForward为控制器类RequestProcessor指向了一个目的地,由控制器执行跳转。
* 但也可能作为Action中的行为,直接执行RequestDispatcher.forward或
* HttpServletResponse.sendRedirect方法。这个类的实例可以会根据需要被动态创建,
* 也可以被设定为与一个ActionMapping绑定,通过名字查找这个mapping实例的多个跳转目的地。

* 一个ActionForward包含以下几个基本属性,其他的附加属性可以根据需要由子类提供。

* contextRelative(上下文关系): path路径值必须被解释为上下文相关路径(context-relative)

* name : 用来查找相关的ActionMapping。
* <li><strong>name</strong> - Logical name by which this instance may be
* looked up in relationship to a particular ActionMapping. </li>
*
* path : 一个让控制器实现转发(forward)的,模型相关/上下文相关URI;或一个让控制器
* 实现重定向(redirected)的,绝对/相对URI。
*
* redirect : 当需要控制器以重定向的方法执行path时则设为true,否则为false
*
* 这个类继承了 ForwardConfig 类和 contextRelative属性
*
* 注意 :这个类不推荐使用,而应由ForwardConfig取代 ..后面的翻不出来了。
* NOTE - This class would have been deprecated and
* replaced by org.apache.struts.config.ForwardConfig except for the fact that
* it is part of the public API that existing applications are using.</p>
*          
*/
public class ActionForward extends ForwardConfig {
/**
     * 无参构造函数 - 以默认值实例化
*/
public ActionForward() {
this(null, false);
    }
/**
     * 构造函数 - 参数path</p>
     *
*/
public ActionForward(String path) {
this(path, false);
    }
/**
     * 构造函数 - 参数 path,redirect
*/
public ActionForward(String path, boolean redirect) {
super();
        setName(null);
        setPath(path);
        setRedirect(redirect);
    }
/**
     *构造函数 - 参数 name,path,redirect
*/
public ActionForward(String name, String path, boolean redirect) {
super();
        setName(name);
        setPath(path);
        setRedirect(redirect);
    }
/**
     * 构造函数 - 参数 name,path,redirect,module 模块前缀
*/
public ActionForward(String name, String path, boolean redirect,
        String module) {
super();
        setName(name);
        setPath(path);
        setRedirect(redirect);
        setModule(module);
    }
/**
     * 构造函数 - 用已有的ActionForward对象实例化。
*/
public ActionForward(ActionForward copyMe) {
this(copyMe.getName(), copyMe.getPath(), copyMe.getRedirect(),
            copyMe.getModule());
    }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Java & OpenSource Domain

Struts源码分析3:ActionForm

by sundy 8/7/2009 11:56:30 AM

前言:发现很多j2ee的程序员基础都差得不行 ,会用ssh的甚至都不知道为何要这样,以及如何设计的 。因此为大家简单的剖析一下Struts的设计 ,以资借鉴 。

import org.apache.struts.upload.MultipartRequestHandler;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
/**
* 一个ActionForm是可以与一个或多个任意的ActionMapping关联的JavaBean。这个bean的里属性
* 在对应Action.execute方法调用前,由对应的request初始化。    
*
* 当这个bean的属性被赋值后,Action.execute方法调用之前,bean的validate方法
* 将被调用,这个方法用来校验用户提交的属性值。如果发现错误,就返回一个包含了这些错误内容的
* error信息。controller将返回至相应的输入表单。如果无错误,validate方法就返回null,
* 相应的Action.execute方法将被调用。

* 这个类必须被继承使用。子类要为所有会被公开(expose)的bean属性提供get和set方法,以及
* 重写一些public或protected方法以提供具体实现。

* 由于ActionForm是JavaBeans,所以根据JavaBeans的规范,子类也会实现Serializable(可序列
* 化)接口。为了使用ActionForm相关的introspection API ?,一些容器会要求一个Form对象满足
* 所有JavaBean规范。

*/
public abstract class ActionForm implements Serializable {
// ----------------------------------------------------- Instance Variables
/**
     * <p>The servlet instance to which we are attached.</p>
*/
protected transient ActionServlet servlet = null;
/**
     * MultipartRequestHandler
     * 这个form的多请求处理对象。        //transient表示该属性将不被序列化。
     *  //wzl注:该对象的作用大约是结合upload包里的类,实现文件的上传功能。
     *  //由于还没接触过,所以下面的相关方法不再翻译
*/
protected transient MultipartRequestHandler multipartRequestHandler;
// ------------------------------------------------------------- Properties
/**
     * @return The servlet instance to which we are attached.
*/
protected ActionServlet getServlet() {
return (this.servlet);
    }
/**
     * ActionServletWrapper
     * 将所属的控制器servlet以ActionServletWrapper对象返回。
     * //该对象也在servlet上提供了对MultipartRequestHandler的使用。
     * @return An instance of ActionServletWrapper
*/
public ActionServletWrapper getServletWrapper() {
return new ActionServletWrapper(getServlet());
    }
/**
     * <p>Return the <code>MultipartRequestHandler</code> for this form The
     * reasoning behind this is to give form bean developers control over the
     * lifecycle of their multipart requests through the use of the
     * <code>finish</code> and/or <code>rollback</code> methods of
     * <code>MultipartRequestHandler</code>.  This method will return
     * <code>null</code> if this form's enctype is not "multipart/form-data".
     * </p>
     * 
     * @return The {@link org.apache.struts.upload.MultipartRequestHandler}
     *         for this form.
     * @see org.apache.struts.upload.MultipartRequestHandler
*/
public MultipartRequestHandler getMultipartRequestHandler() {
return multipartRequestHandler;
    }
/**
     * 设定所属的servlet(若非空)实例。
     *
     * @param servlet The new controller servlet, if any
*/
public void setServlet(ActionServlet servlet) {
this.servlet = servlet;
// :FIXME: Should this be releasing resources?
    }
/**
     * <p>Set the Handler provided for use in dealing with file uploads.</p>
     *
     * @param multipartRequestHandler The Handler to use for fileuploads.
*/
public void setMultipartRequestHandler(
        MultipartRequestHandler multipartRequestHandler) {
this.multipartRequestHandler = multipartRequestHandler;
    }
// --------------------------------------------------------- Public Methods
/**
     *  //直接调用下面那个重载HTTP的。
*/
public void reset(ActionMapping mapping, ServletRequest request) {
try {
            reset(mapping, (HttpServletRequest) request);
        } catch (ClassCastException e) {
            ; // FIXME: Why would this ever happen except a null
        }
    }
/**
     * 用来重置bean中的属性。这个方法在属性被控制器赋值前调用。
     * 
     * 默认的方法体为空,实际中发现,唯一需要被重置的是声明到session中表单的checkboxs属性
     * 除此以外的属性,都会在域声明时被初始化。
     * 
     * 如果为了实现form能被多个请求取值而将其放到了session中,那么你必须非常注意那些被
     * 重置(reset)的值,如上面提到的,对于每一个输入表单内容的页面,必须将session范围中的
     * checkboxs提前重置为fales。这是因为只有当checkbox为fales时才表示客户没有提交该值。
     * 如果一个session中的checkbox没有被提前重置的话,他将永远不会为fales。
     * 
     * 这个方法不适合用来给"修改"类型的页面中的表单赋初始值(这应该在setup Action中)。你唯一需要
     * 关心的就是将checkbox的值改为fales。所以这个方法一般不用实现
     * 
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// Default implementation does nothing
    }
/**
     *  //直接调用下面那个重载HTTP的。
*/
public ActionErrors validate(ActionMapping mapping, ServletRequest request) {
try {
return (validate(mapping, (HttpServletRequest) request));
        } catch (ClassCastException e) {
return (null);
        }
    }
/**
     * 用来验证request中的属性值,并返回一个ActionErrors对象,它包含了验证中发现的错误信息。
     * 如果验证成功,则返回null 或一个无错误信息记录的ActionErrors对象。
     * 
     * 默认的执行体为空并返回null,子类中必须重写这个方法以提供需要的验证操作。
     * 
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     * @return 验证失败就返回错误信息; 验证成功则返回null或空的信息。
     *         
     * @see DynaActionForm
*/
public ActionErrors validate(ActionMapping mapping,
        HttpServletRequest request) {
return (null);
    }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Java & OpenSource Domain

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2007 - 2008 Design by Sundy Linghua-Zhang 蜀ICP备08108648号

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012

Sign in