JSP中javabeans的问题

来源:百度知道 编辑:UC知道 时间:2024/05/10 05:30:09
An error occurred at line: 10 in the jsp file: /process.jsp
GetUserInput cannot be resolved to a type
7: </head>
8: <body>
9:
10: <jsp:useBean id="userInfo" class="GetUserInput">
11: <jsp:setProperty name="userInfo" property="*" />
12: </jsp:useBean>
13:

用bean捕获输入,输入有两个参数:userName,gameId。
但报了以上的错误,麻烦大家帮帮忙

你的class=“getuserinput”有问题,应该为你的javabean的完整路径名,比如包名为com.test ,javabean名为getuserinput 则应该写为com.test.getuserinput 。
错误是无法找到所需要的类文件 所以无法解析getuserinput

GetUserInput cannot be resolved to a type
没有导入这个类
<@ page import="包名.GetUserInput"/>

<jsp:useBean id="usename" class="包名.类名">
加上类名就可以了