日期:2014-05-20  浏览次数:20752 次

急啊,帮忙,在线等!
帮忙看下面的代码,就是往JAVA   BEAN中传参数,BEAN中接参数返回!
<%@   page   contentType= "text/html;charset=gb2312 "%>  
<html>  
<head> <title> 增加商品分类 </title> </head>  
<body> <center>  
<jsp:useBean   id= "categoryBean "   class= "ch08.b "   scope= "page "   />  
<%=  
categoryBean.test( "2 ")  
%>  
<p>  
</center>  
</body>  
</html>  


package   ch08;  
public   class   b  
{  
public   String   test(String   new1)  
{  
if   (new1   ==   "1 ")     return   "test ";
else   return   "test1 ";
     
}  
}  

就是不行呀,怎么办!

------解决方案--------------------
可以的,你控制台没什么错误提示?
------解决方案--------------------
没问题啊
我的JSP文件名为test.jsp
然后执行,http://127.0.0.1:8080/ch08/test.jsp
输出test1