1. 创建J2EE工程
2. 在windows->preference->MyEclipse正确配置Tomcat5(需要Tomcat5以上)设置
3. Deployee MyEclipse J2ee Project to server(也就是点工具栏中MyEclipse的第1个按钮)
4. 点击Add, 将工程部署到Tomcat中.
5. Run Appliction Server, 选择Tomcat5
然后, 在Jsp中设置断点, IE中浏览相应的网页时, 就会跳到Debug Perpective中了, 在视图中可以在.jsp中调试.
遇到的问题和解决:
如何Tomcat设置的JRE路径是指到完整的JDK的bin目录, 比如: d:\jdK1.5\bin
在Run Application Server时会遇到
" A configuration error occurred during startup. Please verify the
preference filed with the prompt: Transport dt_socket failed to
initialize, rc = 509. " 错误.
解决方法: 把d:\jdK1.5\jre\bin目录下的dt_socket.dll拷贝到d:\jdK1.5\bin目录下.
在main.jsp中加入下面的语句
<jsp:include page="footer.jsp" flush="true" />
结果main.jsp中的中文能够正确显示, 而footer.jsp的页面中文乱码.
方法:
在footer.jsp中, 添加<%@ page contentType="text/html;charset=GBK"%>这一行.