javaEE-eclipse配置tomcat服务器和jsp页面调试

tomcat服务器配置html

第一步:Window->Preferences->Server->Runtime Environments,点击Add,选择对应要建立的tomcat服务器版本号,新建一个local server ,配置本地tomcat地址,和jdk服务。java

这样系统里就存在tomcat服务器了,开始新建工程,经过新建dynamic web project 示例以下:web

新建工程以后 ,就会发如今选项卡视图部分service下 存在你刚才的项目名称tomcat

jsp页面调试服务器

若是编辑的jsp页面代码jsp

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String world = request.getParameter("world");
HelloWorld hello = new HelloWorld();
String helloworld = hello.sayHello(world);%>
<%=helloworld %>
</body>
</html>

若是须要new一个类的实例出来 必须在开头引入类的包  如例子中的(HelloWorld)类ui

编译便可经过实现效果 ,否则会出现 HelloWorld类spa

HelloWorld cannot be resolved to a type 错误调试

相关文章
相关标签/搜索