MyEclipse开发Java Web程序

  MyEclipse介绍
MyEclipse,是在eclipse基础上加上自己的插件开发而形成的功能强大的企业集开发环境,主要用于Java、Jave EE以及移动应用的开发。MyElipse的功能非常强大,支持也十分广泛,尤其是对各种开源产品的支持相对不错。
 
二 MyEclipse与Eclipse的区别
MyEclipse:收费,集成了很多收费的插件。比如:SSH,安装等。
Eclipse:免费开源,不包括任何附加功能的插件。
 
三 MyEclipse配置JRE
windows->Preference->Java->Installed JREs


 
 
 MyEclipse集成Tomcat服务器
windows->Preference->Myeclipse->Server->Tomcat


 
 
五 在MyEclipse启动Tomcat服务器,并测试


 


 
 
六 编写第一个web程序
1、创建项目
File->New->Web Project


 
 
2、编写index.jsp
<%@  page  language = "java"  import = "java.util.*"  pageEncoding = "ISO-8859-1" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServerPort()+path+ "/" ;
%>
 
<! DOCTYPE  HTML  PUBLIC  "-//W3C//DTD HTML 4.01 Transitional//EN">
< html >
   < head >
     < base  href = " <%= basePath %> " >
     < title > My JSP 'index.jsp' starting page </ title >
         < meta  http-equiv = "pragma"  content = "no-cache" >
         < meta  http-equiv = "cache-control"  content = "no-cache" >
         < meta  http-equiv = "expires"  content = "0" >    
         < meta  http-equiv = "keywords"  content = "keyword1,keyword2,keyword3" >
         < meta  http-equiv = "description"  content = "This is my page" >
         <!--
        <link  rel =" stylesheet " type="text/ css "  href ="styles.css">
        -->
   </ head >
 
   < body >
    Hello,This is my JSP page.  < br >
   </ body >
</ html >
 
3、发布项目


 
4、运行Tomcat并测试


 
 
七 MyEclipse Web的目录结构


 
 
八 遇到的问题
1、在配置Tomcat时,弹出错误: An error has occurred. See error log for more details. com/genuitec/eclipse/core/vU。
解决方法:因为 曾经安装过 MyEclipse8.5,再安装MyEclipse10时,发现D:\Genuitec\Common\plugins目前下的插件并没有被替换,于是把MyEclipse8.5卸掉,并将D:\Genuitec\Common目录删除,再重新安装MyEclipse10,没问题。全新安装MyEclipse10也没有问题。

猜你喜欢

转载自cakin24.iteye.com/blog/2393913