基本步骤
1、创建一个Myeclipse Web Project
打开myeclipse运行环境,file>New>Project>j2ee>Web project,点击next,在projectName中输入项目名,例如:helloWorld。其中值得提出的是:Context Root URL是在取得你的应用程序的URL,例如:http://localhost:8080/helloWorld.选择完成。
2、编写jsp
选择:New>JSP,其路径设为:helloWorld/WebRoot,Template to use为默认。
编写测试代码。例如在<body><%out.println("I am glad to meet you!");%></body>
3、运行
在project菜单中选择:Build Automatically。
右击MyJsp.jsp,选择run Validate
进入Preferences > MyEclipse > Validation,选择所有
启动tomat
在IE中输入:http://localhost:8080/helloWorld/MyJsp.jsp
出现页面,显示结果:I am glad to meet you!