eclipse 删除插件插件导出的问题

Eclipse与github整合完整版
-------------
新增文件夹...
新增文件夹
(多个标签用逗号分隔)
最近朋友都推荐使用github管理自己的项目,而且免费用户可以有5个仓库,恰好我也想了解下git,借此机会学习一下.
使用独立第三方git工具来进行版本控制,并不借助于eclipse,但我觉得eclipse肯定也有插件来解决这类问题,就像subclipse一样.
egit目前应该是eclipse上最好的git工具了,如果你使用的是eclipse Indigo,你可以直接点击help-&eclipse marketplace,然后在search tab页上find “egit”,找到后直接install.
如果你使用的不是Indigo,你可以从下载.
你需要在github上注册一个id,并且上创建一个Repository.如果有疑问请点击.
ssh key生成
Repository创建好以后需要提交自己的ssh key.一般来说,key的生成有两种方式:
使用官方指南提供的msysgit工具的ssh-keygen命令生成.
使用eclipse自带的ssh2工具生成.
我们这里选用第二方式,使用eclipse自带的ssh2工具,具体步骤:
如果你的ssh2已经有了需要使用的id key,请先备份,然后将目录清空.
点击Window-&Preferences-&General-&Network-&SSH2,点击Key Management tab页,点击Generate RSA Key,然后点击Save Private key,将key保存自定义目录.
点击Export Via SFTP,在弹出窗口填入,此时你的ssh目录会多出一个known_hosts文件,此文件与id_rsa.pub一样重要.
将生成的id_rsa.pub打开,删除空行复制里面的内容,然后粘贴到github的ssh keys中.
重启eclipse,查看ssh选项卡中是否能load出RSA Key与known hosts,如果不能检查以上步骤,否则你是连不上github的.
创建一个应用,然后在应用上右键-&Team-&Share Project,选择git,点击next,点击use or create repository in parent folder,不用理会上面的警告,直接finish.
在应用根目录下创建一个README,随便写入内容,然后右键-&team-&commit,但此时文件仍然在你本地,并没有push到远程服务器上.
接着右键-&team-&remote-&push,此处填写你的项目地址,协议,填写完后点击next,如果出现 ssh://:22 The authenticity of host “” can’t be established. RSA key的错误信息请重启eclipse,重启完毕后继续此步骤.
如果没有异常,在弹出窗口直接点击add all branches spec按钮,最后点击finish,整个过程完毕,点击github你的主页就能看到你的代码.
相关资讯  — 
相关文档  — 
发布时间: 15:01:20
同类热门经验
3286次浏览
2740次浏览
6500次浏览
3542次浏览
2203次浏览
OPEN-OPEN, all rights reserved.trackbacks-0
1. 在导出之前必须配置plugin.xml文件的build页面:选择要包括在二进制构建中的文件夹和文件中,把代码中使用的资源文件勾选中,这样在导出后的zip包才有相应的文件夹。
2. 第三方的lib必须在运行时的类路径上添加进来!
阅读(...) 评论() &当前位置: >
> 运用代码生成插件工程,脱离eclipse本身的新建工程向导(2)
运用代码生成插件工程,脱离eclipse本身的新建工程向导(2)
使用代码生成插件工程,脱离eclipse本身的新建工程向导(2)
&&& 在第一步完成后,我从pde的向导代码入手看eclipse生成代码的机制,发现经过一些小改造,其实完全可以脱离向导的实现,因为在向导中,eclipse保存一些信息作为创建插件工程的必须项。&&& 有兴趣的话可以看看eclipse的最终实现类:NewProjectCreationOperation,最终调用这类的execute(IProgressMonitor monitor)方法。&& 经过改造后的类如下:  import java.util.ArrayL
import java.util.S
import java.util.TreeS
import orre.resources.IC
import orre.resources.IF
import orre.resources.IF
import orre.resources.IP
import orre.resources.IProjectD
import orre.resources.IR
import orre.resources.IW
import orre.resources.IWorkspaceR
import orre.resources.ResourcesP
import orre.runtime.CoreE
import orre.runtime.IP
import orre.runtime.NullProgressM
import orre.runtime.P
import orre.runtime.SubProgressM
import orre.IClasspathE
import orre.IJavaE
import orre.IJavaP
import orre.IPackageF
import orre.IPackageFragmentR
import orre.JavaC
import orre.JavaModelE
import orre.build.IBuildE
import orre.build.IBuildModelF
import orre.plugin.IP
import orre.plugin.IPluginB
import orre.plugin.IPluginI
import orre.plugin.IPluginL
import orre.plugin.IPluginR
import org.eclipsre.ClasspathC
import org.eclipsre.TargetPlatformH
import org.eclipsre.build.WorkspaceBuildM
import org.eclipsre.bundle.BundlePluginB
import org.eclipsre.bundle.WorkspaceBundlePluginM
import org.eclipsre.ibundle.IB
import org.eclipsre.ibundle.IBundlePluginB
import org.eclipsre.ibundle.IBundlePluginModelB
import org.eclipsre.natures.PDE;
import org.eclipsre.plugin.WorkspacePluginModelB
import org.eclipsre.project.PDEP
import org.eclipsre.util.CoreU
import org.osgi.framework.C
* 创建插件工程
* @author aquarion
* @version 1.0
@SuppressWarnings("restriction")
public class CreatePluginProject {
private static WorkspacePluginModelBase fM
private static PluginClassCodeGenerator fG
public static void createPluginProject(String projectName) {
// 获取工作区
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
// 创建新项目
IProject project = root.getProject(projectName);
// 设置工程的位置
// IPath path = new Path("");
// 为项目指定存放路径,默认放在当前工作区
IWorkspace workspace = root.getWorkspace();
final IProjectDescription description = workspace
.newProjectDescription(project.getName());
description.setLocation(null);
// 设置工程标记,即为java工程
String[] newJavaNature = new String[1];
newJavaNature[0] = JavaCore.NATURE_ID; // 这个标记证明本工程是Java工程
description.setNatureIds(newJavaNature);
// 在文件系统中生成工程
NullProgressMonitor monitor = new NullProgressMonitor();
project.create(description, monitor);
project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(
monitor, 1000));
} catch (CoreException e) {
e.printStackTrace();
// 转化成java工程
IJavaProject javaProject = JavaCore.create(project);
// 创建输出路径
IFolder binFolder = javaProject.getProject().getFolder("bin");
binFolder.create(true, true, null);
javaProject.setOutputLocation(binFolder.getFullPath(), null);
} catch (CoreException e) {
e.printStackTrace();
// 设置Java生成器
IProjectDescription description2 = javaProject.getProject()
.getDescription();
ICommand command = description2.newCommand();
command.setBuilderName("orre.javabuilder");
description2.setBuildSpec(new ICommand[] { command });
description2
.setNatureIds(new String[] { "orre.javanature" });
javaProject.getProject().setDescription(description2, null);
} catch (CoreException e) {
e.printStackTrace();
// 创建源代码文件夹
IFolder srcFolder = javaProject.getProject().getFolder("src");
srcFolder.create(true, true, null);
} catch (CoreException e) {
e.printStackTrace();
// 验证并加入插件工程的Nature
project = createProject(project);
} catch (CoreException e1) {
e1.printStackTrace();
// 为一个java工程设置默认的class path
if (project.hasNature(JavaCore.NATURE_ID)) {
setClasspath(project);
} catch (JavaModelException e) {
e.printStackTrace();
} catch (CoreException e) {
e.printStackTrace();
// 生成Activator类
generateTopLevelPluginClass(project, projectName + ".Activator",
projectName);
} catch (CoreException e) {
e.printStackTrace();
// 生成mf文件
createManifest(project, projectName);
} catch (CoreException e) {
e.printStackTrace();
// 生成bulid.properties文件
createBuildPropertiesFile(project);
} catch (CoreException e) {
e.printStackTrace();
// 调整mf文件
adjustManifests(project, fModel.getPluginBase());
} catch (CoreException e) {
e.printStackTrace();
// 最终保存到文件系统中
fModel.save();
* 创建工程
* @param project
* @throws CoreException
private static IProject createProject(IProject project)
throws CoreException {
if (!project.exists()) {
CoreUtility.createProject(project, null, null);
project.open(null);
if (!project.hasNature(PDE.PLUGIN_NATURE)) {
CoreUtility.addNatureToProject(project, PDE.PLUGIN_NATURE, null);
if (!project.hasNature(JavaCore.NATURE_ID)) {
CoreUtility.addNatureToProject(project, JavaCore.NATURE_ID, null);
CoreUtility.addNatureToProject(project,
"org.eclipse.pde.UpdateSiteNature", null);
CoreUtility.addNatureToProject(project,
"org.eclipse.pde.FeatureNature", null);
CoreUtility.addNatureToProject(project,
"org.eclipse.pde.api.tools.apiAnalysisNature", null);
IFolder folder = project.getFolder("src");
if (!folder.exists()) {
CoreUtility.createFolder(folder);
* 设置class path
* @param project
* @throws JavaModelException
* @throws CoreException
private static void setClasspath(IProject project)
throws JavaModelException, CoreException {
IJavaProject javaProject = JavaCore.create(project);
// Set output folder
IPath path = project.getFullPath().append("bin");
javaProject.setOutputLocation(path, null);
IClasspathEntry[] entries = getClassPathEntries(javaProject);
javaProject.setRawClasspath(entries, null);
private static IClasspathEntry[] getClassPathEntries(IJavaProject project) {
IClasspathEntry[] internalClassPathEntries = getInternalClassPathEntries(project);
IClasspathEntry[] entries = new IClasspathEntry[internalClassPathEntries.length + 2];
System.arraycopy(internalClassPathEntries, 0, entries, 2,
internalClassPathEntries.length);
// Set EE of new project
String executionEnvironment = "JavaSE-1.6";
ClasspathComputer.setComplianceOptions(project, executionEnvironment);
entries[0] = ClasspathComputer.createJREEntry(executionEnvironment);
entries[1] = ClasspathComputer.createContainerEntry();
private static IClasspathEntry[] getInternalClassPathEntries(
IJavaProject project) {
IClasspathEntry[] entries = new IClasspathEntry[1];
IPath path = project.getProject().getFullPath().append("src");
entries[0] = JavaCore.newSourceEntry(path);
* 生成Activator类
* @param project
* @param className
* @param id
* @throws CoreException
private static void generateTopLevelPluginClass(IProject project,
String className, String id) throws CoreException {
fGenerator = new PluginClassCodeGenerator(project, className, id);
fGenerator.generate();
* 生成MF文件
* @param project
* @param name
* @throws CoreException
private static void createManifest(IProject project, String name)
throws CoreException {
IFile pluginXml = PDEProject.getPluginXml(project);
IFile manifest = PDEProject.getManifest(project);
fModel = new WorkspaceBundlePluginModel(manifest, pluginXml);
IPluginBase pluginBase = fModel.getPluginBase();
String targetVersion = "3.7";
pluginBase.setSchemaVersion(TargetPlatformHelper
.getSchemaVersionForTargetVersion(targetVersion));
pluginBase.setId(name);
pluginBase.setVersion("1.0.0.qualifier");
String temp = getName(name);
pluginBase.setName(temp);
pluginBase.setProviderName("");
if (fModel instanceof IBundlePluginModelBase) {
IBundlePluginModelBase bmodel = ((IBundlePluginModelBase) fModel);
((IBundlePluginBase) bmodel.getPluginBase())
.setTargetVersion(targetVersion);
bmodel.getBundleModel().getBundle()
.setHeader(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
((IPlugin) pluginBase).setClassName(name.toLowerCase() + ".Activator");
IPluginReference[] dependencies = getDependencies();
for (int i = 0; i & dependencies. i++) {
IPluginReference ref = dependencies[i];
IPluginImport iimport = fModel.getPluginFactory().createImport();
iimport.setId(ref.getId());
iimport.setVersion(ref.getVersion());
iimport.setMatch(ref.getMatch());
pluginBase.add(iimport);
// add Bundle Specific fields if applicable
if (pluginBase instanceof BundlePluginBase) {
IBundle bundle = ((BundlePluginBase) pluginBase).getBundle();
// Set required EE
String exeEnvironment = "JavaSE-1.6";
if (exeEnvironment != null) {
bundle.setHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT,
exeEnvironment);
// -----------------------
bundle.setHeader(Constants.BUNDLE_ACTIVATIONPOLICY,
Constants.ACTIVATION_LAZY);
// ------------------------
@SuppressWarnings({ "rawtypes", "unchecked" })
private static IPluginReference[] getDependencies() {
ArrayList result = new ArrayList();
if (fGenerator != null) {
IPluginReference[] refs = fGenerator.getDependencies();
for (int i = 0; i & refs. i++) {
result.add(refs[i]);
return (IPluginReference[]) result.toArray(new IPluginReference[result
.size()]);
* 生成Build.properties文件
* @param project
* @throws CoreException
private static void createBuildPropertiesFile(IProject project)
throws CoreException {
IFile file = PDEProject.getBuildProperties(project);
if (!file.exists()) {
WorkspaceBuildModel model = new WorkspaceBuildModel(file);
IBuildModelFactory factory = model.getFactory();
// BIN.INCLUDES
IBuildEntry binEntry = factory
.createEntry(IBuildEntry.BIN_INCLUDES);
fillBinIncludes(project, binEntry);
createSourceOutputBuildEntries(model, factory);
model.getBuild().add(binEntry);
model.save();
private static void fillBinIncludes(IProject project, IBuildEntry binEntry)
throws CoreException {
binEntry.addToken("META-INF/"); //$NON-NLS-1$
String libraryName =
binEntry.addToken(libraryName == null
"." : libraryName); //$NON-NLS-1$
private static void createSourceOutputBuildEntries(
WorkspaceBuildModel model, IBuildModelFactory factory)
throws CoreException {
String srcFolder = "src";
String libraryName =
if (libraryName == null)
libraryName = "."; //$NON-NLS-1$
// SOURCE.&LIBRARY_NAME&
IBuildEntry entry = factory.createEntry(IBuildEntry.JAR_PREFIX
+ libraryName);
if (srcFolder.length() & 0)
entry.addToken(new Path(srcFolder).addTrailingSeparator()
.toString());
entry.addToken("."); //$NON-NLS-1$
model.getBuild().add(entry);
// OUTPUT.&LIBRARY_NAME&
entry = factory.createEntry(IBuildEntry.OUTPUT_PREFIX + libraryName);
String outputFolder = "bin";
if (outputFolder.length() & 0)
entry.addToken(new Path(outputFolder).addTrailingSeparator()
.toString());
entry.addToken("."); //$NON-NLS-1$
model.getBuild().add(entry);
* 调整MF文件
* @param project
* @param bundle
* @throws CoreException
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void adjustManifests(IProject project, IPluginBase bundle)
throws CoreException {
// if libraries are exported, compute export package (173393)
IPluginLibrary[] libs = fModel.getPluginBase().getLibraries();
Set packages = new TreeSet();
for (int i = 0; i & libs. i++) {
String[] filters = libs[i].getContentFilters();
// if a library is fully exported, then export all source packages
// (since we don't know which source folders go with which library)
if (filters.length == 1 && filters[0].equals("**")) { //$NON-NLS-1$
addAllSourcePackages(project, packages);
for (int j = 0; j & filters. j++) {
if (filters[j].endsWith(".*")) //$NON-NLS-1$
packages.add(filters[j].substring(0,
filters[j].length() - 2));
@SuppressWarnings("rawtypes")
private static void addAllSourcePackages(IProject project, Set list) {
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] classpath = javaProject.getRawClasspath();
for (int i = 0; i & classpath. i++) {
IClasspathEntry entry = classpath[i];
if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
IPath path = entry.getPath().removeFirstSegments(1);
if (path.segmentCount() & 0) {
IPackageFragmentRoot root = javaProject
.getPackageFragmentRoot(project.getFolder(path));
IJavaElement[] children = root.getChildren();
for (int j = 0; j & children. j++) {
IPackageFragment frag = (IPackageFragment) children[j];
if (frag.getChildren().length & 0
|| frag.getNonJavaResources().length & 0)
list.add(children[j].getElementName());
} catch (JavaModelException e) {
* 获取Bundle-Name
* @param projectName
private static String getName(String projectName) {
String temp = new String(projectName);
int index = temp.lastIndexOf(".");
if (index != -1) {
temp = temp.substring(index + 1);
String fristChar = temp.substring(0, 1).toUpperCase();
temp = temp.substring(1);
temp = fristChar +
本问题标题:
本问题地址:
温馨提示:本问答中心的任何言论仅代表发言者个人的观点,与希赛网立场无关。请对您的言论负责,遵守中华人民共和国有关法律、法规。如果您的言论违反希赛网问答中心的规则,将会被删除。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&湘教QS2-164&&增值电信业务经营许可证湘B2-用ibator eclipse 插件自动生成sqlmap - kalogen - ITeye技术网站
博客分类:
现在我们着手来写一个ibatis的简单例子.
如果你是使用eclipse开发项目的话,那么,有一个eclipse的插件ibator,可以通过配置自动生成java代码sqlmap等,蛮好用。下面先做一个使用ibator插件的例子。
1.使用link方式在线安装ibator。
eclipse菜单
software updates--&
add site--&(填入在线安装地址:http://ibatis.apache.org/tools/ibator
--&一直下一步安装
2.新建一个web工程,导入相应的包,我使用的数据库是ORACLE,所以我需要导入的包是:
ojdbc14.jar或classes12.jar,把ibatis需要的jar包都导进去
此例我导入的jar包如下:
3.由于你安装了ibator插件,那么你在你的工程某个目录下单击右键--&new--&other里将会看到
Apache iBatis Ibator文件夹,下面只有一个选项,如下图。
点击以后要求你输入文件名(这个就是ibator的配置文件):
填入配置文件名称,可以随便设置配置文件名字。一般为“ibatorConfig.xml”,点确定后就创建好了一个ibator配置文件的模板。
&?xml version="1.0" encoding="UTF-8" ?&&!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http:
//ibatis.apache.org/dtd/ibator-config_1_0.dtd" &&ibatorConfiguration &
&ibatorContext id="context1" &
&jdbcConnection driverClass="???" connectionURL="???" userId="???" password="???" /&
&javaModelGenerator targetPackage="???" targetProject="???" /&
&sqlMapGenerator targetPackage="???" targetProject="???" /&
&daoGenerator targetPackage="???" targetProject="???" type="GENERIC-CI" /&
&table schema="???" tableName="???" &
&columnOverride column="???" property="???" /&
&/ibatorContext&&/ibatorConfiguration&
4.将对应配置参数替换掉上面的“?”号。我自己的替换文件是这样的:
&?xml version="1.0" encoding="UTF-8" ?&&!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" &&ibatorConfiguration &
&classPathEntry location="D:\Program Files\work_soft\apache-maven-2.0.9\repository\com\oracle\ojdbc14\10.2.0.1.0\ojdbc14-10.2.0.1.0.jar"/&
&ibatorContext id="content1"&
&jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@localhost:1522:zju" userId="ly" password="ly"&
&property name="" value=""/&
&/jdbcConnection&
&javaModelGenerator targetPackage="com.model" targetProject="ibatistest"&
&/javaModelGenerator&
&sqlMapGenerator targetPackage="com.xml" targetProject="ibatistest"&
&/sqlMapGenerator&
&daoGenerator targetPackage="com.dao" targetProject="ibatistest" type="IBATIS"&
&/daoGenerator&
&table tableName="TB_USER" domainObjectName="user"&
&/ibatorContext&&/ibatorConfiguration&
其中&table tableName="TB_USER"...& 这个"TB_USER"是在数据库中事先创建好的表,就是我们要通过ibatis操作的表。
&table..& 这里如果什么也不写的话,默认会使用数据库中的字段名产生pojo类&/table&
关于ibatorConfig.xml中配置参数具体内容可以参考一下apache文档
5.之后我们只需要在这个配置文件上点击右键--&点击Generate ibatis artifacts,这样就应该能生成对应的package和类了.我的生成如下图:
6.在我使用ibator的时候发生了以下几处错误:
1)Exception :getting jdbc Driver
由于我开始的时候将&classPathEntry location="D:"Program Files"work_soft"apache-maven-2.0.9"repository"com"oracle"ojdbc14"10.2.0.1.0"ojdbc14-10.2.0.1.0.jar"/&
这句放到了jdbcConnection里,而新版本是放到外面的,所以报此错误。
2)Cannot find source folder ibatistest/src
因为端口号没有配置正确1522配置成1521了,所以报这个问题,网上还有人说是端口号配置正确了防火墙拦截也有可能导致这个问题,那么只需要去把防火墙里的“例外”里添加你数据库使用的端口号就可以了,如果安装了防火墙软件也是一样道理,添加一个例外的端口。
做完以上的修改以后先用sqlplus试一下,如果能够登录那么就对了,如果不能够登录,那么你需要开启数据库的监听程序,这个比较多内容就不再这里说了,可以去网上查一下如何开启数据库的监听程序。
3)Cannot find source folder ibatistest/src,由于我开始的时候将&javaModelGenerator targetPackage="com.model" targetProject="ibatistest/src"&里的 targetProject的值设置为ibatistest/src,但是我没有创建这个文件夹,所以就报这个错误了,如果你没有创建任何源文件夹那么就是用你的工程名字就好了。
4)Invalid name specified: com/dao
由于我把com.dao写成com/dao所以说是无效的包名.
浏览: 336232 次
来自: 杭州
rewind方法的limit又是多少呢?等于capacity? ...
一种每次都获取到不同的随机数的办法int ranseed=12 ...
估计部署在某个端口下吧,仔细检查一下发布的配置文件
文件大点就嗝屁了~~~
我把实际的项目部署到tomcat下之后,输入任何一个tomca ...ASP有关问题_eclipse插件大全,30个惯用插件(转载)_HTTP幂等性概念跟应用__脚本百事通
稍等,加载中……
^_^请注意,有可能下面的2篇文章才是您想要的内容:
ASP有关问题
eclipse插件大全,30个惯用插件(转载)
HTTP幂等性概念跟应用
ASP有关问题
在线等ASP问题&!--#include
file= "util.asp "
&!--#include
file= "conn.inc "
dz=request.QueryString( "dz ")
Request( "cpbm ")
((len(trim(strCpbm))
"undefined "))
ProductList
Session( "ProductList ")
Split(Request( "cpbm "),
UBound(Products)
PutToShopBag
Products(I),
ProductList
Session( "ProductList ")
ProductList
Head= "以下是您所选购的物品清单 "
ProductList
Session( "ProductList ")
Len(ProductList)
Response.Redirect
"nothing.asp "
response.end
Request( "MySelf ")
ProductList
Split(Request( "cpbm "),
UBound(Products)
PutToShopBag
Products(I),
ProductList
Session( "ProductList ")
ProductList
Len(ProductList)
Response.Redirect
"nothing.asp "
response.end
rs=server.createobject( "adodb.recordset ")
in( "&ProductList& ") "
sql,conn,1,1,1
http-equiv= "Content-Type "
content= "text/
charset=gb2312 "&
&title& 以下是您所选购的物品清单 &/title&
language= "Javascript "&
fucCheckNUM(NUM)
strTemp= " ";
NUM.length==
(i=0;i &NUM.i++)
j=strTemp.indexOf(NUM.charAt(i));
window.location.href= "clear.asp "
topmargin= "5 "&
align= "center "&
width= "80% "
border= "0 "
cellspacing= "0 "&
width= "80% "
valign= "top "&
align= "center "&
align= "center "&
color= "#FF0000 "
&!--webbot
BOT= "GeneratedScript "
PREVIEW= "
Language= "JavaScript "&
FrontPage_Form1_Validator(theForm)
theForm.= "Q_ "
rs( "id ").
checkStr.charAt(i);
checkOK.charAt(j))
checkOK.length)
(!allValid)
alert( "在
请输入正确的商品数量!
域中,只能输入
个字符。 ");
theForm.= "Q_ "
rs( "Product_Id ").focus();
&!--webbot
BOT= "GeneratedScript "
Action= "eshop.asp "
Method= "POST "
onSubmit= "return
FrontPage_Form1_Validator(this) "
name= "FrontPage_Form1 "&
type= "hidden "
name= "MySelf "
value= "Yes "&
align= "center "&
border= "0 "
cellspacing= "1 "
width= "550 "
class=main
bgcolor= "6699CC "&
bgcolor= "#E6F7FF "&
width= "170 "
height= "22 "
align= "center "&
class= "style1 "& 商品编号 &/span&
width= "170 "
height= "22 "
align= "center "
bgcolor= "#E6F7FF "&
class= "style1 "& 商品名称 &/span&
width= "76 "
height= "22 "
align= "center "&
class= "style1 "& 商品价格 &/span&
width= "76 "
height= "22 "
align= "center "&
class= "style1 "& 商品数量 &/span&
width= "76 "
height= "22 "
align= "center "& dz &/td&
width= "60 "
height= "22 "
align= "center "&
class= "style1 "& 购买 &/span&
width= "72 "
height= "22 "
align= "center "&
class= "style1 "& 总价 &/span&
rs( "pn "))
Session(rs( "pn "))
Session(rs( "pn "))
session( "class ")= "vip "
ccur(rs( "Price "))
Quatity*dz*0.1
ccur(rs( "Price "))
bgcolor= "#FFFFFF "&
width= "82 "
align= "center "&
&%=rs( "pn ")%&
width= "170 "
align= "center "&
&%=rs( "Name ")%&
width= "76 "
align= "center "&
&%=rs( "Price ")%&
width= "76 "
align= "center "&
&!--webbot
bot= "Validation "
S-Display-Name= "请输入正确的商品数量! "
S-Data-Type= "Integer "
S-Number-Separators= "x "
Name= " &%= "Q_ "
rs( "pn ")%&
Value= " &%=Quatity%&
Size= "3 "&
width= "76 "
align= "center "&
session( "class ")= "vip "
response.Write(dz)
response.Write( "& ")
width= "60 "
Align= "center "&
Type= "CheckBox "
Name= "cpbm "
Value= " &%=rs( "pn ")%&
width= "72 "
Align= "center "&
session( "class ")= "vip "
a=ccur(rs( "Price "))*Quatity*b
response.Write(a)
a=ccur(rs( "price "))*quatity
response.Write(a)
if%& .00元 &/td&
rs.MoveNext
bgcolor= "#FFFFFF "&
Align= "Right "
ColSpan= "7 "
width= "546 "&
Color= "Red "& 总价格=人民币
&%=Sum%& .00元 &/font&
&blockquote&
align= "center "&
name= "B1 "
type= "submit "
class= "smallInput "
style= "font-size:
value= "更改数量 "&
name= "B2 "
type= "button "
class= "smallInput "
style= "font-size:
onClick= "window.close(); "
value= "继续购物 "&
name= "B3 "
type= "button "
class= "smallInput "
style= "font-size:
OnClick= "clean() "
value= "订单取消 "&
name= "b4 "
type= "button "
class= "smallInput "
onClick= "window.open( '../page/ment1.asp ') "
value= "去收银台 "&
align= "center "&
color= "#FF0000 "& 注意:改变“商品数量需按“更改数量” &/font&
&/blockquote&
conn.close
eclipse插件大全,30个惯用插件(转载)
eclipse插件大全,30个常用插件(转载)
eclipse插件大全,30个常用插件(转载)
1、PyDev – Eclipse的Python开发环境
工具地址:http://marketplace.eclipse.org/content/pydev-python-ide-eclipse
Pydev这个插件能够让用户利用Eclipse进行Python、Jython以及Iron Python开发,使Eclipse成为一流的Python IDE(集成开发环境)。
2、EasyEclipse for LAMP
工具地址:http://marketplace.eclipse.org/content/easyeclipse-lamp
EasyEclipse for LAMP是一个Eclipse发行版本,它支持使用动态语言来开发网络应用程序,并对PHP, Python, Perl, 以及 Ruby和Ruby On Rail开发提供了一个网络服务器和数据库、CVS和Subversion。
3、CFEclipse
工具地址:http://marketplace.eclipse.org/content/umlet-uml-tool-fast-uml-diagrams
Eclipse的ColdFusion插件具有DreamWeaver 和Homesite中经常使用的大多数功能,而且还具有很多它们不具备的功能。这个插件的目的是为CFML建立一个IDE。
4、Spket IDE
工具地址:/
Spket IDE是功能强大的JavaScript 和XML开发工具包。这个强大的编辑器可以进行JavaScript、XUL/XBL以及Yahoo! Widget开发。其中JavaScript编辑器具有代码完成(code completion)、语法标记以及内容概览等功能,协助开发人员创建高效的JavaScript代码。
工具地址:http://marketplace.eclipse.org/content/atl
ATL(Atlas转换语言)是一种模型转换语言以及工具套件。在模型驱动工程(MDE)领域,ATL可以从一套源模型中产生一套目标模型。ATL语言开发环境处在Eclipse平台顶部,提供了一系列的标准开发工具(语法标记、调试器等),旨在让ATL转变开发变得更加简单。
6、PTI - PHP工具集成
工具地址:http://marketplace.eclipse.org/content/pti-php-tool-integration
一方面,我们有许多支持PHP脚本开发的优秀工具,比如PHPUnit或者PHP CodeSniffer。而另一方面,强大的IDE(比如PHP开发工具工程,PDT),却不能使用这些工具。Eclipse PHP Tool Integration 工具集成(PTI)则是Eclipse插件的集合,旨在消除这方面的空白。
7、Skyway Builder Community Edition
工具地址:http://marketplace.eclipse.org/content/skyway-builder-community-edition
Skyway Builder Community Edition是一个基于Eclipse的代码生成工具,用于提高Spring应用程序的开发效率。它既能够生成完整的Spring应用程序代码,也能单 独生成Spring框架各个模块的代码包括(DAO, ORM, MVC, Services, and Core)。
8、Bravo JSP编辑器
工具地址:http://marketplace.eclipse.org/content/bravo-jsp-editor
Bravo JSP编辑器是一款所见即所得的JSP/html编辑器。
9、Eclipse的Koders IDE插件
工具地址:http://marketplace.eclipse.org/content/koders-ide-plugin-eclipse
Koders Desktop IDE Plugins可以让软件开发人员直接在Eclipse开发环境中进行源代码搜索。
10、Google Eclipse Search (GES)
工具地址:http://marketplace.eclipse.org/content/google-eclipse-search-ges
Google Eclipse Search (GES)工具是在IBM的Eclipse开发环境中集成了Google Desktop Search 谷歌桌面搜索(GDS)引擎的结果。旨在改进软件工程中的搜索功能,这与在因特网中搜索或者在你自己的台式机中搜索功能类似。
11、Regex Util
工具地址:http://marketplace.eclipse.org/content/regex-util
这款eclipse插件可以帮助开发人员创建正则表达式(regex)。其目的是让Regex的创建更加容易,更加迅速。它还能够高亮显示正则表达式语法、括号匹配、错误检测,能够提醒正则表达式的功能详细描述等。
工具地址:http://marketplace.eclipse.org/content/emacs
这款插件在Eclipse文本编辑器中提供了增强型的类似于Emacs的功能。
13、Eclipse SQL Explorer
工具地址:http://marketplace.eclipse.org/content/amaterasuml
Eclipse SQL Explorer是一个SQL瘦客户端,允许你查询和浏览任何遵守JDBC的数据库。它支持带有个人数据库(Oracle, DB2和 MySQL)专用功能的插件,并且能够扩展支持其他数据库的专用插件。
14、soapui-eclipse插件
工具地址:http://marketplace.eclipse.org/content/soapui-eclipse-plugin
soapUI是一款桌面应用程序,能够监测、触发、模仿以及测试(功能和负载)基于SOAP/WSDL和REST/EADL的HTTP网络服务。其主要目的是为开发人员/测试人员提供/或者测试网络服务(java, .net等)。该soapui-eclipse-plugin支持soapUI中的所有功能,而且还添加了一些eclipse专用功能:比如soapUI Nature,它可以在Project Explorer中显示集成soapUI工程,并且简化了代码生成向导;soapUI Perspective等。
15、SMODL开发套件
工具地址:http://marketplace.eclipse.org/content/smodl-development-suite
Smodl Development Suite能够让模型驱动的网络服务开发(从零开始模型设计或者根据现有的代码进行逆向工程时)更快、更简单、更灵活。该插件能够生成各种代码,如果模型改变的话他们还会保持同步。其运行引擎可以运行在不同的平台上,并可以给网络服务提供SOAP, XML-RPC和JSON-RPC绑定。该运行引擎能够动态产生描述网络服务的WSDL,并实施数据完整性(可以在模型中定义)。
16、Eclipse记事本插件
工具地址:http://marketplace.eclipse.org/content/eclipse-notepad-plugin
这款插件的目标简单明确,就是让开发人员写一些小的记录。这些记录存储在工作空间元数据内。
17、Apache Directory Studio
工具地址:http://marketplace.eclipse.org/content/apache-directory-studio
Apache Directory Studio(前身是LDAP Studio)是一个完整的目录工具平台,本来是用于LDAP服务器的,但是现在被专门用于Apache目录服务器。它有以下插件可以选择:LDAP浏览器插件;LDIF编辑器插件;Schema编辑器插件;在Studio中开启Apache Directory Server的插件以及一个配置Apache Directory Server的插件。
18、EHEP- Eclipse十六进制编辑器插件
工具地址:http://marketplace.eclipse.org/content/ehep-eclipse-hex-editor-plugin
EHEP这款Eclipse插件可以让用户查看或者修改任何用十六进制数表示的文件。该插件既能用十六进制数表格查看文件,也能够以文字形式查看文件。
19、Vaadin插件
工具地址:http://marketplace.eclipse.org/content/vaadin-plugin-eclipse
Vaadin是一款开源UI库,具有丰富的网络用户界面。它是一个简单的jar元件库,可以帮助Java开发人员更简单地创建有魅力的网络应用程序。
20、RMI插件
工具地址:http://marketplace.eclipse.org/content/genadys-rmi-plugin-eclipse
Genady的RMI Eclipse插件是一个全面的RMI应用程序开发解决方案。除了能够自动生成RMI 桩(stub)之外,该RMI插件还简化了应用程序进行Java虚拟机参数(比如安全政策和基本代码)配置的过程。
21、Lockness
工具地址:http://marketplace.eclipse.org/content/lockness-thread-dump-analyser
Lockness是一款分析Java Thread Dump的Eclipse插件。有了Lockness,很容易就能找出颈瓶状态或锁死状态中含有哪些线程。其最新版本已经做出改进,能够更好地支持由JDK6生成的Thread Dumps。
22、Fast Fox
工具地址:http://marketplace.eclipse.org/content/fast-fox
Fast Fox中简单然而功能强大的鼠标功能会让你的Eclipse IDE更加丰富多彩。那些经常进行的活动,比如“前一个编辑器”和“关闭编辑器”,现在只需要一个简单的鼠标移动就可以完成。你不必再去描绘复杂的符号,Fast Fox就有一个好用的环形菜单,让使用变得真正很简单。
23、ExploreFS
工具地址:http://marketplace.eclipse.org/content/explorefs
这个小插件(6K)的唯一目就是打开本地文件管理器中包含已选资源的文件夹。它在包浏览器、资源浏览器的快捷菜单中以及任何其他的显示文件或者Java类中添加了"Open in File System"项。它还可以找到包含Jar文件的类。Windows, Mac OS X, 以及Linux系统都可以用。
24、Saros - 分布式结对编程(Distributed Pair Programming)
工具地址:http://marketplace.eclipse.org/content/saros-distributed-collaborative-editing-and-pair-programming
Saros是一款Eclipse插件,其目的是进行协作文本编辑,特别是针对分布式结对编程,但是它能够一次支持任意多个参与者。任务中的所有成员都有一份相同的Eclipse工程备份,而且随着编辑逐步发展,Saros还会保持这些备份与编程同步。
25、RSS View
工具地址:http://marketplace.eclipse.org/content/rss-view
RSS View是一款RSS/Atom阅读器,其简洁明快的用户界面嵌入到Eclipse中,并且与你的工作台并存。你在一个地方就拥有所有的功能。RSS View可能还能够改善你的开发过程,因为它可以把bug跟踪系统、开发论坛或者wiki直接集成在你的IDE中。其功能包括:分组和过滤新闻动态条目,脱机新闻推送,以及几个用户自定义功能等。
26、FreeMem
工具地址:http://marketplace.eclipse.org/content/freemem
FreeMem是一款支持Eclipse的图表式内存监视器。
27、EclipseColorer
工具地址:http://marketplace.eclipse.org/content/eclipsecolorer
Eclipse Coloreris是一款Eclipse平台上的语法标记插件。它支持超过150种语言,有许多强大的功能以及大量的语法。它可以使用嵌套结构(jsp, asp, php)进行语言标记,具有强大的XML语言支持。
工具地址:http://marketplace.eclipse.org/content/log4e
Log4E插件能够帮助你在Java项目中轻松地创建记录器。它可以在以下几个任务中提供帮助:记录器声明,在某些方法条目中进行记录器插入,系统输出替换,已存在记录器语句的修改等。
29、AmaterasUML
工具地址:/Web_Links-index-req-viewlink-cid-630.html
AmaterasUML是一款Eclipse插件,它可以描绘支持类图、程序图表以及使用例图的UML。它还支持Java,比如它可以从Eclipse工作空间导入类/接口,以及把类图导出到Java源代码中等。
30、UMLet - 快速UML图形工具
工具地址:/Web_Links-index-req-viewlink-cid-492.html
这款免费的UML工具UMLet用户界面简单、没有弹出窗口,可以让你轻松画出UML图表。它能够让你快速地画出示意图;以pdf、eps、jpg、gif、svg、bmp、png格式以及系统剪切板模式导出图形;使用Eclipse 3+分享图表;还能够创建自己的自定义图形元素等。
原文链接:/best-eclipse-plugins
原文标题:30 Best Eclipse Plugins
HTTP幂等性概念跟应用
HTTP幂等性概念和应用基于HTTP协议的Web
API是时下最为流行的一种分布式服务提供方式。无论是在大型互联网应用还是企业级架构中,我们都见到了越来越多的SOA或RESTful的Web API。为什么Web
API如此流行呢?我认为很大程度上应归功于简单有效的HTTP协议。HTTP协议是一种分布式的面向资源的网络应用层协议,无论是服务器端提供Web服务,还是客户端消费Web服务都非常简单。再加上浏览器、Javascript、AJAX、JSON以及HTML5等技术和工具的发展,互联网应用架构设计表现出了从传统的PHP、JSP、ASP.NET等服务器端动态网页向Web
API + RIA(富互联网应用)过渡的趋势。Web API专注于提供业务服务,RIA专注于用户界面和交互设计,从此两个领域的分工更加明晰。在这种趋势下,Web
API设计将成为服务器端程序员的必修课。然而,正如简单的Java语言并不意味着高质量的Java程序,简单的HTTP协议也不意味着高质量的Web
API。要想设计出高质量的Web API,还需要深入理解分布式系统及HTTP协议的特性。
幂等性定义
本文所要探讨的正是HTTP协议涉及到的一种重要性质:幂等性(Idempotence)。在HTTP/1.1规范中幂等性的定义是:
Methods can also have the property of
“idempotence” in that (aside from error or expiration issues) the side-effects
of N & 0 identical requests is the same as for a single
从定义上看,HTTP方法的幂等性是指一次和多次请求某一个资源应该具有同样的副作用。幂等性属于语义范畴,正如编译器只能帮助检查语法错误一样,HTTP规范也没有办法通过消息格式等语法手段来定义它,这可能是它不太受到重视的原因之一。但实际上,幂等性是分布式系统设计中十分重要的概念,而HTTP的分布式本质也决定了它在HTTP中具有重要地位。
分布式事务 vs 幂等设计
为什么需要幂等性呢?我们先从一个例子说起,假设有一个从账户取钱的远程API(可以是HTTP的,也可以不是),我们暂时用类函数的方式记为
withdraw(account_id, amount);
withdraw的语义是从account_id对应的账户中扣除amount数额的钱;如果扣除成功则返回true,账户余额减少amount;如果扣除失败则返回false,账户余额不变。值得注意的是:和本地环境相比,我们不能轻易假设分布式环境的可靠性。一种典型的情况是withdraw请求已经被服务器端正确处理,但服务器端的返回结果由于网络等原因被掉丢了,导致客户端无法得知处理结果。如果是在网页上,一些不恰当的设计可能会使用户认为上一次操作失败了,然后刷新页面,这就导致了withdraw被调用两次,账户也被多扣了一次钱。如图1所示:
这个问题的解决方案一是采用分布式事务,通过引入支持分布式事务的中间件来保证withdraw功能的事务性。分布式事务的优点是对于调用者很简单,复杂性都交给了中间件来管理。缺点则是一方面架构太重量级,容易被绑在特定的中间件上,不利于异构系统的集成;另一方面分布式事务虽然能保证事务的ACID性质,而但却无法提供性能和可用性的保证。
另一种更轻量级的解决方案是幂等设计。上面的withdraw显然不满足幂等性,但我们可以一些技巧将它变成幂等的,比如:
create_ticket();
idempotent_withdraw(ticket_id, account_id, amount);
create_ticket的语义是获取一个服务器端生成的唯一的处理号ticket_id,它将用于标识后续的操作。idempotent_withdraw和withdraw的区别在于关联了一个ticket_id,一个ticket_id表示的操作至多只会被处理一次,每次调用都将返回第一次调用时的处理结果。这样,idempotent_withdraw就符合幂等性了,客户端就可以放心地多次调用。
基于幂等性的解决方案中一个完整的取钱流程被分解成了两个步骤:1.调用create_ticket()获取ticket_id;2.调用idempotent_withdraw(ticket_id,
account_id,
amount)。虽然create_ticket不是幂等的,但在这种设计下,它对系统状态的影响可以忽略,加上idempotent_withdraw是幂等的,所以任何一步由于网络等原因失败或超时,客户端都可以重试,直到获得结果。如图2所示:
和分布式事务相比,幂等设计的优势在于它的轻量级,容易适应异构环境,以及性能和可用性方面。在某些性能要求比较高的应用,幂等设计往往是唯一的选择。
HTTP的幂等性
HTTP协议本身是一种面向资源的应用层协议,但对HTTP协议的使用实际上存在着两种不同的方式:一种是RESTful的,它把HTTP当成应用层协议,比较忠实地遵守了HTTP协议的各种规定;另一种是SOA的,它并没有完全把HTTP当成应用层协议,而是把HTTP协议作为了传输层协议,然后在HTTP之上建立了自己的应用层协议。本文所讨论的HTTP幂等性主要针对RESTful风格的,不过正如上一节所看到的那样,幂等性并不属于特点的协议,它是分布式系统的一种特性;所以,不论是SOA还是RESTful的Web
API设计都应该考虑幂等性。下面将介绍HTTP GET、DELETE、PUT、POST四种主要方法的语义和幂等性。
GET方法用于获取资源,不应有副作用,所以是幂等的。比如:GET /account/123456,不会改变资源的状态,不论调用一次还是N次都没有副作用。请注意,这里强调的是一次和N次具有相同的副作用,而不是每次GET的结果相同。GET /latest-news这个HTTP请求可能会每次得到不同的结果,但它本身并没有产生任何副作用,因而是满足幂等性的。
DELETE方法用于删除资源,有副作用,但它应该满足幂等性。比如:DELETE /article/4231,调用一次和N次对系统产生的副作用是相同的,即删掉id为4231的帖子;因此,调用者可以多次调用或刷新页面而不必担心引入错误。
比较容易混淆的是HTTP
POST和PUT。POST和PUT的区别容易被简单地误认为“POST表示创建资源,PUT表示更新资源”;而实际上,二者均可用于创建资源,更为本质的差别是在幂等性方面。在HTTP规范中对POST和PUT是这样定义的:
The POST method is used to request that the
origin server accept the entity enclosed in the request as a new subordinate of
the resource identified by the Request-URI in the Request-Line. ……
resource has been created on the origin server, the response SHOULD be 201
(Created) and contain an entity which describes the status of the request and
refers to the new resource, and a Location header.
The PUT method requests that the enclosed
entity be stored under the supplied Request-URI. If the Request-URI refers to an
already existing resource, the enclosed entity SHOULD be considered as a
modified version of the one residing on the origin server. If the Request-URI
does not point to an existing resource, and that URI is capable of being defined
as a new resource by the requesting user agent, the origin server can create the
resource with that URI.
POST所对应的URI并非创建的资源本身,而是资源的接收者。比如:POST
/articles的语义是在/articles下创建一篇帖子,HTTP响应中应包含帖子的创建状态以及帖子的URI。两次相同的POST请求会在服务器端创建两份资源,它们具有不同的URI;所以,POST方法不具备幂等性。
而PUT所对应的URI是要创建或更新的资源本身。比如:PUT http://www.forum/articles/4231的语义是创建或更新ID为4231的帖子。对同一URI进行多次PUT的副作用和一次PUT是相同的;因此,PUT方法具有幂等性。
在介绍了几种操作的语义和幂等性之后,我们来看看如何通过Web API的形式实现前面所提到的取款功能。很简单,用POST
/tickets来实现create_ticket;用PUT
/accounts/account_id/ticket_id&amount=xxx来实现idempotent_withdraw。值得注意的是严格来讲amount参数不应该作为URI的一部分,真正的URI应该是/accounts/account_id/ticket_id,而amount应该放在请求的body中。这种模式可以应用于很多场合,比如:论坛网站中防止意外的重复发帖。
上面简单介绍了幂等性的概念,用幂等设计取代分布式事务的方法,以及HTTP主要方法的语义和幂等性特征。其实,如果要追根溯源,幂等性是数学中的一个概念,表达的是N次变换与1次变换的结果相同,有兴趣的读者可以从Wikipedia
上进一步了解。
RFC 2616, Hypertext
Transfer Protocol — HTTP/1.1, Method Definitions
Importance of Idempotence
如果您想提高自己的技术水平,欢迎加入本站官方1号QQ群:&&,&&2号QQ群:,在群里结识技术精英和交流技术^_^
本站联系邮箱:

我要回帖

更多关于 eclipse 删除插件 的文章

 

随机推荐