记录、分享

struts2 当spring遇到json插件时的异常 及解决(引用)

struts2 当spring遇到json插件时的异常 及解决




1 我的Action代码
package common.regist.action;
import com.opensymphony.xwork2.ActionSupport;
import common.regist.Interface.IRegistService;
import domain.User;
public class RegistAction extends ActionSupport {
private IRegistService service;

private String responseText;

private String username = "";

private User user;

public IRegistService getService() {
  return service;
}
public void setService(IRegistService service) {
  this.service = service;
}

public User getUser() {
  return user;
}

public void setUser(User user) {
  this.user = user;
}

public String validateUserName() {
  if(service.validateUser(username).size()==0)
  {
   this.setResponseText("true");
   return ActionSupport.SUCCESS;
  }
  this.setResponseText("false");
  return ActionSupport.SUCCESS;
}


public String execute() throws Exception {
  service.regist(user);
  return super.execute();
}

public String getResponseText() {
  return responseText;
}

public void setResponseText(String responseText) {
  this.responseText = responseText;
}

public String getUsername() {
  return username;
}
public void setUsername(String username) {
  this.username = username;
}

}

配置文件里:
<package name="ajax" extends="json-default" namespace="/login">
  <action name="validateUserName" class="registAction" method="validateUserName">
   <result type="json"></result>
  </action>
  </package>

发生的异常
org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.sql.SQLException: Positioned Update not supported.
低调的猫(624767717) 15:04:17
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.ResultSet.getCursorName(ResultSet.java:1917)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:220)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:302)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:221)
at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:152)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:120)
at com.googlecode.jsonplugin.JSONWriter.write(JSONWriter.java:88)
at com.googlecode.jsonplugin.JSONUtil.serialize(JSONUtil.java:90)
at com.googlecode.jsonplugin.JSONResult.execute(JSONResult.java:119)


分析---------------------------------------------------------------------------------------
在我的Action中一共有4个properties,其中有个bean是service,而且是在spring framework中已经实例化了的,问题就出在它身上了。于是在struts-config中加入该bean的exclude,再测试,成功了!
发送action的request后,服务返回JSON数据。

解决-----------------------------------------------------------------------------------------
<action name="validateUserName" class="registAction" method="validateUserName">
   <result type="json">
     <param name="excludeProperties">      //序列化属性中排除 service
                     service
   </param>

</result>
  </action>
  </package>

posted @ 2011-06-09 15:58 张生 阅读(1010) | 评论 (0)编辑 收藏

Eclipse下使用Subversion

作者:朱先忠编译 转自天极http://dev.yesky.com/356/2578856.shtml
CVS很酷,但Subversion更酷。然而,如果你在使用Eclipse进行开发,那么你可能直到近来才能利用Subversion带来的优点
摘要 CVS很酷,但Subversion更酷。然而,如果你在使用Eclipse进行开发,那么你可能直到近来才能利用Subversion带来的优点。随着 Subclipse的发行,Subversion可能会最终在你的Eclipse IDE环境充分发挥其威力而压倒CVS。
一、SCM和Subversion简介

  软件配置管理(SCM)是管理源码并保持其安全的良好艺术,它能实现源码与其他团队成员之间保持共享,并且能够对之加以保护。良好地利用SCM,你能够容易地跟踪软件的发行和新的开发分支;这样以来,可以更为容易地标识和修正发行产品中的错误。

其实,有大量的SCM工具可用,既有开源的和也有商业化的,例如StarTeam,Perforce,BitKeeper和ClearCase。在开源 世界里,事实上的SCM标准是并发版本管理系统(CVS),它被广泛应用于世界范围内的成百上千的开源和商业工程。然而,CVS也存在下列许多固有的缺 陷,这使得它无法非常完美地适合于现代工程开发:

· 实质上针对文本文件的设计使得CVS处理二进制文件能力比较差。在每一次提交时,二进制文件被以整体形式传输和存储,这将带来带宽和磁盘空间的浪费。

· 在CVS中,你不能移动文件和目录。你唯一的选择基本上就是删除并且重新添加它们,从而失去了整个过程中的所有的文件历史信息。

· CVS中没有实现原子提交的概念。比方说,你要把10个文件提交到服务器,而该提交操作往往在整个过程的中途停了下来。(这很可能会发生,如果某人同时提 交一个文件,或甚至如果你的网络失败或你的PC重新启动的话。)在这种情况下,服务器将仅记录下你的修正的一半信息,这可能会使代码基部分处于一种潜在地 不稳定的状态。

Subversion是一种比较新的开源SCM工具,其设计目的是力图从根本上克服原CVS所具有的限制。它是一种良好设计的工具,具有适合于现代开发的许多新特征:

· 提交是原子化的。提交的文件都能够被正确加入到一个新的修订当中,否则仓库不会被更新;并且每一个新的修订仅由一次提交中的变化部分组成。

· Subversion对文本和二进制文件使用一种巧妙的二进制技术,这既优化了网络流量也优化了仓库磁盘空间。

· 在Subversion中,每一次修订都代表了一个特定时间内完整的目录树拷贝。文件和目录可以不加限制地进行移动。

· Subversion仅存储两个版本之间的修改内容,这不仅节约了磁盘空间,并且意味着标识一个新版本或创建一种新的子内容几乎可以立即实现。

· 你可以以多种途径来存取一个Subversion仓库,具体则依赖于你的需要:使用HTTP或HTTPS(与WebDAV一起使用),使用快速的专利性svn:协议,或直接经由本地文件,等等。

二、Subclipse插件与Eclipse的集成

一种良好的SCM应该与你的工作环境紧密地集成到一起。没有谁真正喜欢转到命令行以把文件添加到仓库。Eclipse很早就实现了CVS集成,但是直到 最近Subversion用户仍没有被引起重视。现在,新的Subclipse插件提供了在Eclipse中的一种平滑的Subversion集成。

(一) 安装Subclipse插件

下面,你以通常的方法从更新站点下安装Subclipse:

1. 打开"Find and install"窗口("Help>Software Updates>Find and Install")。

2. 选择"Search for new features to install"选项并点击Next。

3. 点击"New Remote Site"并且创建一远程站点,使用名字Subclipse和URL http://subclipse.tigris.org/update_1.0.x(参考图1)。

4. 在结果安装窗口中,把"Subeclipse in the Features"选择到安装列表中,并且通过向导来开始安装插件。

5. 完成这些之后,重新启动Eclipse。现在,你可以继续往下进行!


图1.安装Subclipse插件

(二) 建立Repository定义

现在,既然你已经安装完插件;那么,接下来,你需要告诉它你的工程仓库位于何处。你是在SVN Repository视图中实现的。打开这个视图("Windows>Show View>Other>SVN Repository")并且在上下文菜单中选择"New>Repository Location"以显示一个如图2所示的对话框。输入适当的URL并且点击"Finish"。


图2.添加一个仓库定义


(三) 检出(Check Out)一个工程

一旦建立一个仓库,你就可以在SVN Repository视图中浏览所有的内容(见图3)。我们后面将会看到,这个视图是一种与Subversion进行交互的非常方便的方式。




图3.SVN Repository视图。



现在,让我们把一个工程检出到你的Eclipse工作区中。这只需选择你需要的Subversion仓库,打开上下文菜单,并且选择"Checkout"即可。这将打开一个具有两个选项的向导:

· Check out as a Project configured using the New Project Wizard-这个选项打开新工程向导,这可以让你使用内建的Eclipse工程类型配置工程。这个选项通常是最好用的,因为它让你使用相同的工程模板和 配置屏幕,而当你创建一个常规工程时你经常使用它们。

· Check out as a Project in the Workspace-这个选项简单地在你的包含检出源码的工作区中创建一个Eclipse工程。

在以上两种情况下,你仍然需要更新工程的构建路径,因为在检出该工程源码之前,Eclipse不能确定这些Java源码所在的位置。

(四) 把一个新工程导入到仓库中

如果你只是启动了一个新的工程,那么你需要把它导入到Subversion仓库。Subclipse提供了一种方便的方式来直接从你的IDE内部实现这 一点。为此,只需要从Package Explorer视图下选择你的工程,并且在上下文菜单中选择"Team>Share Project"。你可以使用现有仓库之一或创建一新的仓库定义。在你指定仓库和工程名之后,你能指定你想放到仓库中的文件和目录并且提供一个初始注释 (见图4)。这种方法特别有用,因为它让你有选择地导入仅由Subversion管理的文件,即使该工程还包含其它文件(例如生成的类,临时文件或其它不 是必需的内容等)。


图4.把一个工程导入到一个Subversion仓库中

三、在Eclipse中使用Subversion

现在,既然你的支持Subversion的工程已经启动并且运行起来,那么大多数必要的Subversion命令就可经由"Team"上下文菜单存取 (参考图5)。你可以在Package Explorer中看到你的本地文件的状态(参考图6),其中,任何修改了的文件都被标记上一个星号。存储在仓库中的文件都显示一个小黄桶图标(代表了一 个数据库);还没有被添加到仓库中的文件以一个问号显示。


图5.大多数Subversion命令能被经由Team菜单存取

图6.你可以在Package Explorer中看到本地文件的状态

(一) 与Repository保持同步

从仓库中更新你的文件并且把你的变化提交到仓库是相当直接的过程,这可以使用"Team>Update and Team>Commit"菜单选项来实现。在提交你的变化之前,你可能想看一下自从你的上次更新以来是否服务器上有任何文件被修改。为此,你可以使 用"Team >Synchronize with Repository"。这个命令让你看到有哪些内容已经被局部地修改,有哪些内容在服务器上修改,以及这两种修改之间的任何冲突(参考图7)。你还可以 以可视化方式看到冲突的版本,并且在提交你的变化之前纠正任何比较突出的冲突。


图7.与仓库保持同步

(二) 使用属性

属性是Subversion具有创新性的特征之一。在Subversion中,你可以把元数据("properties")关联到任何文件或目录。你可以定义任何你喜欢的属性,但是Subversion也提供了一些有用的内置属性,例如下面图8中所提供的这些属性:

· svn:executable属性,允许你在支持这种能力的操作系统上设置一个文件的可执行标志。

· svn:need-lock属性,可以用来在文件(例如,对二进制文件非常有用)上强加排斥锁。一个定义了svn:need-lock属性的文件一次只能 被一个人修改。当该文件被检出时,它是只读的。如果你想修改该文件,你需要首先使用"Team>Lock"菜单选项。之后,使用"Team> Unlock"释放该文件,或仅提交你的变化。这一行为将释放该锁并且让其它的用户也得到该文件上的一把锁。


图8.把一个Subversion属性添加到一个文件中

三) Tag和Branch

在Subversion中,很容易创建新的tag和branch。你可以使用tag来标识一个特定的版本(使用一种可读的名字,例如"Release 1.0")。;而一个branch用于新的开发工作而不影响主源码基(称作trunk)。在一个branch上的开发仍会继续进行,直到开发者已经为把变 化集成回主trunk作好准备。

在Subversion中,branch和tag都是通过制作给定修订的一个虚拟副本(以另一个名字 和/或另一个目录)创建的。在常规情况下,branch存储在branches目录下,tag位于tags目录下,尽管在实践中为了满足你的工程你可以使 用自己的任何定制。

从Eclipse中,"Team>Branch/Tag"菜单能够使你创建branch和tag(参考图9)。其中,Browse按钮提供了一种方便的方法来查看有哪些branch和tag存在于仓库中。

当你使用"Team>Switch"创建成功一个新的branch或tag时,你可以非常容易地在branches之间进行切换。无论何时你切换 到一个不同的branch(或返回到trunk),Subversion将仅更新文件(它需要保持你的当前工作的副本与目的branch之间的同步)。


图9.创建一个新的branch或tag

(四) 修订历史

象大多数SCM系统一样,Subversion让你跟踪你的源码的变化。"Team>Show in Resource History"菜单选项能够使你查询这些变化的列表(包括对一个文件,目录或甚至整个工程的改变)(见图10)。

记住,在Subversion中,提交是原子性的-一次提交由一组文件变化和一个全局注释组成。"SVN Resource History"视图向你显示每一次提交的一个简明视图,包括修改的文件和相关注释。


图10.历史资源

四、结论

Subversion是一种强有力的和非常灵活的SCM工具,也是CVS的一个成功的后继者。结合Subclipse,Subversion能最终在你的Eclipse IDE环境中得到全面的发挥。

posted @ 2011-05-03 09:18 张生 阅读(325) | 评论 (0)编辑 收藏

eclipse集成SVN的server。

以下是安装SERVER的方法,COPY防丢失。http://www.open.collab.net/cn/downloads/desktops/installing_cdee.html?_=d
需要注册。


The CollabNet Desktop – Eclipse Edition

CollabNet Desktop – Eclipse Edition is a freely downloadable set of plugins that CollabNet provides for the Eclipse IDE. This desktop works with and is part of the CollabNet Platform.

To find, download, and install the latest functionality, follow the instructions in the next two sections:

  • Finding the New CollabNet Desktop – Eclipse Edition Features
  • Installing CollabNet Desktop – Eclipse Edition

Once you complete the installation, you will be asked if you want to restart the Eclipse SDK. This is not required, but it is recommended.

Finding the New CollabNet Desktop – Eclipse Edition Features

To find the new CollabNet Desktop – Eclipse Edition features, follow these steps:

  1. From the Eclipse Help menu, select Software Updates → Find and Install.

    Figure 1: The Eclipse Help menu


  2. In the Install/Update window, select Search for new features to install and click Next.

    Figure 2: The Install/Update window


  3. In the Install window, if you want to use the Eclipse Update Installer, select New Remote Site.

    If you can’t use the Eclipse Update Installer (for example, if your proxy servers do not allow access to the Eclipse Update Installer or if you have limited Internet access), select New Archived Site.

    Figure 3: The Install window



  1. If you selected New Remote Site, fill in the following information:
    • In the Name field, enter "CollabNet Desktop"
    • Copy one of the following into the URL field:
      • For Eclipse 3.5/3.6, copy this URL:
        http://downloads.open.collab.net/eclipse/update-site/e3.5
      • For Eclipse 3.4, copy this URL:
        http://downloads.open.collab.net/eclipse/update-site/e3.4
      • For Eclipse 3.3, copy this URL:
        http://downloads.open.collab.net/eclipse/update-site/e3.3
      • For Eclipse 3.2, copy this URL:
        http://downloads.open.collab.net/eclipse/update-site/e3.2

    When you have completed the information, click OK.


    Figure 4: The New Update Site window


If you selected New Archived Site, follow these instructions:

  • Download the version of the CollabNet Desktop –
    Eclipse Edition you want to install:
  • In the Select Local Site Archive window, navigate to
    the location where you saved the CollabNet Desktop –
    Eclipse Edition and select Open.

    Figure 5: The Select Local Site Archive window


  • In Edit Local Site, fill in the File name, verify the path to
    the CollabNet Desktop – Enterprise Edition download,
    and press OK.

    Figure 6: The Edit Local Site window




  1. From the Install window, select CollabNet Desktop and Finish.

    Note: The Eclipse Update Manager automatically ensures that you have all the required plugins to run CollabNet Desktop – Eclipse Edition. CollabNet suggests you install everything listed in the Updates window.

    Figure 7: The Install window


    The Update Manager connects to the site or opens the local archive to find the features available to install.

    Figure 8: The Update Manager reading the remote site



Installing CollabNet Desktop – Eclipse Edition

To install the new CollabNet Desktop – Eclipse Edition features, follow these steps:

  1. From the Updates window, select CollabNet Desktop and click Next.

    Figure 9: The Updates window showing search results


  2. Review the license terms on the Feature License screen. If you agree to these terms, select "I accept the terms in the license agreements" and click Next.

    Figure 10: The Install window showing license information


  3. From the Install window, review the components you are about to install. If you want to install the components in locations other than the default location, specify the new location.

    Note: you can have multiple instances of Eclipse on your machine, running different feature configurations.

    Figure 11: The Install window showing the installation directories


  4. Click Finish and the Update Manager downloads the components you selected.

    Note: you can have multiple instances of Eclipse on your machine, running different feature configurations.

    Figure 12: The Install window downloading the components


  5. In the Verification window, check that you have selected the feature you want to install, and click Install All.

    Figure 13: The Verification window


    Note: If you see a warning in the Verification window about installing an unsigned feature, you can ignore it. The CollabNet features are not signed.

    The Update Manager installs the components you selected.

    Figure 14: The Update Manager installing files


  6. When the installation is complete, click OK to restart Eclipse.

  7. Figure 15: The Install/Update window asking you to restart

posted @ 2011-04-28 11:47 张生 阅读(1000) | 评论 (0)编辑 收藏

eclipse集成SVN的client。

http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

上面网址就是安装的方法。以下是COPY防丢失。

Get the right version!

Subclipse versions are tied to specific versions of the Subversion client API.  So you must have a matching version of the Subversion client API (JavaHL) for your version of Subclipse.  Any 1.x version of a Subversion client can talk to any 1.x version of a Subversion server, so generally the version does not matter too much.  However, if you use multiple client tools on the same Subversion working copy, then it is important that the version of those clients is all the same.  In addition, if you are on Linux, your distribution might only support a specific version of Subversion and JavaHL.  So you might want to stick with a specific version of Subclipse for that client.

More information on how to get JavaHL, and the right version for each version of Subclipse can be found in the wiki

Current Release

Eclipse 3.2/Callisto, 3.3/Europa, 3.4/Ganymede, 3.5/Galileo +

Subclipse 1.6.17 and 1.4.8 are now available for Eclipse 3.2+!

See the changelog for details. Existing Subclipse users should read the upgrade instructions for important information on changes you to need to make to your Eclipse preferences to see the new version in the update manager.

Subclipse 1.4.x includes and requires Subversion 1.5.x client features and working copy format.

Subclipse 1.6.x includes and requires Subversion 1.6.x client features and working copy format.

Links for 1.6.x Release:
Changelog: http://subclipse.tigris.org/subclipse_1.6.x/changes.html
Eclipse update site URL: http://subclipse.tigris.org/update_1.6.x
Zipped downloads: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

Links for 1.4.x Release:
Changelog: http://subclipse.tigris.org/subclipse_1.4.x/changes.html
Eclipse update site URL: http://subclipse.tigris.org/update_1.4.x
Zipped downloads: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

Eclipse 3.0/3.1

Subclipse 1.0.6 is now available for Eclipse 3.0/3.1!

See the changelog for details. Existing Subclipse users should read the 1.0.0 release announcement for details on how to upgrade to the 1.0.x release.

Links for 1.0.x Release:
Changelog: http://subclipse.tigris.org/subclipse/changes.html
Eclipse update site URL: http://subclipse.tigris.org/update_1.0.x
Zipped downloads: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

Eclipse 2.1.3

Subclipse 0.9.3.3 is linked against Subversion 1.1.4. Binaries for Windows are included.

Development for this version of Eclipse is no longer active. There are no new releases planned.

Download the Eclipse 2.x version

Installation Instructions

Here you will find a screenshot tour of the Subclipse installation process in Eclipse 3.x. These particular screens were captured in Eclipse 3.0.2 running on Windows XP.

 

Install Subclipse in Eclipse 3.x

Step 1:

Begin the installation from the Eclipse Help menu item.

Install screen

Step 2:

This screenshot show the screen as it initially comes up. In this case you will need to change the radio button to indicate that this is a new install.

Install screen

Step 3:

This screen will vary depending on the features you have installed already. You want to click on the New Remote Site button. If you are behind a proxy and the Eclipse install mechanism does not work, then you can download a zipped version of the update site and then click the New Local Site button instead.

Install screen

Step 4:

This screen is showing the New Remote Site dialog, filled in with the correct information to install Subclipse


Name: Subclipse 1.6.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.6.x

Name: Subclipse 1.4.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.4.x

Name: Subclipse 1.2.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.2.x

Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
URL: http://subclipse.tigris.org/update_1.0.x
Install screen

Step 5:

When you first come back to this screen, the site you added will NOT be selected. Be sure to select it before clicking Next.

Install screen

Step 6:

This next screen shows all of the features that are available to install.

Install screen

Step 7:

Click the button to accept the license agreement.

Install screen

Step 8:

Confirm the install location

Install screen

Step 9:

There is an Eclipse preference to turn off this next dialog. I have never seen a signed feature. Not even Eclipse.org nor IBM sign their features.

Install screen

Step 10:

Just a screenshot of the in-process installation.

Install screen

Step 11:

Eclipse needs to be restarted after installing Subclipse.

Install screen

Step 12:

Finally, after restarting Eclipse, the first thing you will typically want to do is open the Subclipse Repository perspective where you can define your repositories. Be sure to also check the online help as well as the Subclipse preferences located under Team -> SVN.

Install screen

Updating Subclipse in Eclipse 3.x

Eclipse 3.x has a feature in preference to automatically check for updates. Provided you are not behind a proxy that does not allow this feature, it should work for Subclipse. Otherwise just follow the instructions for installing Subclipse, except take the option to check for updates in Step 2.

If you are behind a proxy that does not work with Eclipse, then to install updates you just always follow the same instructions you used to install a new version. If you always unzip the site to the same local folder, you will not have to define the local site each time.



posted @ 2011-04-28 09:50 张生 阅读(2880) | 评论 (0)编辑 收藏

一款按钮的CSS。(网络转载)

<style>
.btn {
BORDER-RIGHT: #7b9ebd 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7b9ebd 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde); BORDER-LEFT: #7b9ebd 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #7b9ebd 1px solid
}
.btn1_mouseout {
BORDER-RIGHT: #7EBF4F 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7EBF4F 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#B3D997); BORDER-LEFT: #7EBF4F 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #7EBF4F 1px solid
}
.btn1_mouseover {
BORDER-RIGHT: #7EBF4F 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7EBF4F 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#CAE4B6); BORDER-LEFT: #7EBF4F 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #7EBF4F 1px solid
}
.btn2 {padding: 2 4 0 4;font-size:12px;height:23;background-color:#ece9d8;border-width:1;}
.btn3_mouseout {
BORDER-RIGHT: #2C59AA 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #2C59AA 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5); BORDER-LEFT: #2C59AA 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #2C59AA 1px solid
}
.btn3_mouseover {
BORDER-RIGHT: #2C59AA 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #2C59AA 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#D7E7FA); BORDER-LEFT: #2C59AA 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #2C59AA 1px solid
}
.btn3_mousedown
{
BORDER-RIGHT: #FFE400 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #FFE400 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5); BORDER-LEFT: #FFE400 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #FFE400 1px solid
}
.btn3_mouseup {
BORDER-RIGHT: #2C59AA 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #2C59AA 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5); BORDER-LEFT: #2C59AA 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #2C59AA 1px solid
}
.btn_2k3 {
BORDER-RIGHT: #002D96 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #002D96 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#FFFFFF, EndColorStr=#9DBCEA); BORDER-LEFT: #002D96 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #002D96 1px solid
}
</style>
<body>

<button class=btn title="CSS样式按钮">CSS样式按钮</button><P></p>
<button
class=btn1_mouseout onmouseover="this.className='btn1_mouseover'"
onmouseout="this.className='btn1_mouseout'"
title="CSS样式按钮">CSS样式按钮</button>  
<button
class=btn1_mouseout onmouseover="this.className='btn1_mouseover'"
onmouseout="this.className='btn1_mouseout'" DISABLED>CSS样式按钮</button>
<P>
<button class=btn2 title="CSS样式按钮">CSS样式按钮</button>
<P>
<button class=btn3_mouseout onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'"
onmousedown="this.className='btn3_mousedown'"
  onmouseup="this.className='btn3_mouseup'"
  title="CSS样式按钮">CSS样式按钮</button>
<P>
<button class=btn_2k3 title="CSS样式按钮">CSS样式按钮</button></body>

posted @ 2011-04-13 11:29 张生 阅读(472) | 评论 (0)编辑 收藏

tomcat配置cgi 转帖自http://blog.csdn.net/chcbz/archive/2010/11/24/6032924.aspx

1、修改conf/web.xml

找到并将cgi的servlet和servlet-mapping的注释去掉

  1. <servlet>  
  2.         <servlet-name>cgi</servlet-name>  
  3.         <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>  
  4.         <init-param>  
  5.           <param-name>debug</param-name>  
  6.           <param-value>0</param-value>  
  7.         </init-param>  
  8.         <init-param>  
  9.           <param-name>cgiPathPrefix</param-name>  
  10.           <param-value>cgi-bin</param-value>  
  11.         </init-param>  
  12.          <load-on-startup>5</load-on-startup>  
  13.     </servlet>  

注意:其中cgiPathPrefix是cgi文件的存放路径,默认是WEB-INF/cgi,我为了方面用awstats,所以改成cgi-bin

  1. <servlet-mapping>  
  2.         <servlet-name>cgi</servlet-name>  
  3.         <url-pattern>/cgi-bin/*</url-pattern>  
  4. </servlet-mapping>  

/cgi-bin/*意思是,访问cgi文件的默认地址为cgi-bin/*

2、修改conf/context.xml

  1. <?xml version='1.0' encoding='utf-8'?>  
  2. <Context privileged="true">  
  3.   
  4.     <!-- Default set of monitored resources -->  
  5.     <WatchedResource>WEB-INF/web.xml</WatchedResource>  
  6.       
  7.     <!-- Uncomment this to disable session persistence across Tomcat restarts -->  
  8.     <!-- 
  9.     <Manager pathname="" /> 
  10.     -->  
  11.   
  12.     <!-- Uncomment this to enable Comet connection tacking (provides events  
  13.          on session expiration as well as webapp lifecycle) -->  
  14.     <!-- 
  15.     <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> 
  16.     -->  
  17.   
  18. </Context>  

修改<Context>添加privileged="true"属性,否则页面提示Servlet CGI is not availabled,且tomcat会有错误提示java.lang.SecurityException: Restricted classclass org.apache.catalina.servlets.CGIServlet

3、如果tomcat的版本是6以下的,必须将server/lib/目录下的servlets-cgi.renametojar改名为servlets-cgi.jar

有以上三步,已经可以成功配置CGI了,访问地址如http://localhost:8080/cgi-bin/test.pl

posted @ 2011-03-15 15:59 张生 阅读(1122) | 评论 (0)编辑 收藏

晚八点飞机,现在JS跨域问题解决中,解决后再来修补内容,新BLOG第一帖。

晚八点飞机,现在JS跨域问题解决中,解决后再来修补内容

posted @ 2011-03-15 14:53 张生 阅读(445) | 评论 (1)编辑 收藏

仅列出标题
共2页: 上一页 1 2 
<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜