猿问

<java:useBean>那个地方出现Unknown tag (java:useBean),而且后面的学生姓名,年龄等代码报错,求大神解决

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>


<%

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>

 <java:useBean id="User" class="Student.Stu"  scope="page"/>

   <h1>使用useBean动作创建Javabean的实例</h1>

   <br>

   学生姓名:<%=User.getName() %><br>

   学生年龄:<%=User.getAge() %><br>

   学生专业:<%=User.getProject() %><br>

   

  </body>

</html>


qq_柒分醉_03927370
浏览 3906回答 1
1回答

大咪

Unknown tag (java:useBean)这个意思就是说你这个标签不能被识别呀。。 <java:useBean id="User" class="Student.Stu"  scope="page"/>//应该是jsp:吧  <jsp:useBean id="User" class="Student.Stu"  scope="page"/>//这样试试
随时随地看视频慕课网APP

相关分类

Java
我要回答