使MyEclipse(8.0以下)可以看struts1.2.6的源码,javadoc,还可进行智能提示

 

在使用struts2开发和学习的过程中,我们都应该知道实时查看源码的重要性,以下笔记是使用myeclipse6.5导入struts2.1.6源文件的过程 
首先到 http://struts.apache.org/download.cgi#struts216下载 struts-2.1.6-src.zip显示有20MB其实就4MB 
在使用使用struts2中需要使用xwork,xwork的源文件需要单独下载, http://www.opensymphony.com/xwork/download.action 
点击 All: Contains all jars, libs, sources and docs, 
本人是新手对Maven不了解。 
这个xwork是all-in-one的包,将里面的 xwork-2.1.2-sources.jar拿出来。 

接下来就是Myeclipse导入这些源码了。 
选择你的项目右键Properties--》java build path --》选择struts-core-2.1.6.jar 
点击jar文件前面的小三角符号--》Source Attacment--》Edit--》External File --》选择刚才下载的 struts-2.1.6-src.zip即可 
xwork-2.1.2.jar源文件的导入一样,在此不多废话,已经很详细了。 

=====================

在MyEclipse显示struts2源码和doc文档及自动完成功能 

在MyEclipse中显示struts的源码 
-------右键点击/webAppName/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar 
-------propertes 
-------Java Source Attachment 
-------External Folder 
选择目录:D:/struts-2.1.8.1/src/core/src/main/java 


在MyEclipse中显示struts的doc文档 
-------右键点击/Struts2_01/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar 
-------propertes 
-------Javadoc Location 
-------Javadoc URL 
-------Browser 
选择目录:file:/D:/struts-2.1.8.1/docs/struts2-core/apidocs/ 


Struts.xml文件添加自动完成功能(不过MyEclipse8.0中已经不用再配置这个了,里面自带了struts下的xml标准) 

-------先在struts文件夹中的lib包中的 struts2-core-2.1.8.1.jar  解压开,里面有struts-2.0.dtd  文件 
-------struts.xml文件中头部有:http://struts.apache.org/dtds/struts-2.0.dtd 
-------window 
-------preferences 
-------搜索catalog 
-------add 
-------在Location中加入struts-2.0.dtd所在的地址(可以在struts框架中的lib文件夹中解压struts2-core-2.1.6.jar,然后可以找到dtd文件),Key Type 中选择URL,Key中加入http://struts.apache.org/dtds/struts-2.0.dtd

 

你可能感兴趣的:(使MyEclipse(8.0以下)可以看struts1.2.6的源码,javadoc,还可进行智能提示)