| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2466 人关注过本帖
标题:求助大神~jsp运行以后老说这里是错的
只看楼主 加入收藏
hiyourstory
Rank: 1
等 级:新手上路
帖 子:7
专家分:4
注 册:2014-10-21
结帖率:0
收藏
 问题点数:0 回复次数:2 
求助大神~jsp运行以后老说这里是错的
而且中文还是乱码,用myeclipse运行

<%@ page language="java" import="java.util.*,com.shopping.model.*" pageEncoding="utf-8"%>

<%
String goodstype = request.getParameter("goodstype");
if(goodstype==null){
    goodstype=1+"";
}
GoodsBeanBo gbb = new GoodsBeanBo();
ArrayList al =(ArrayList)gbb.getGoodsList(goodstype);

GoodsBean[]gb=new GoodsBean[6];
for(int i =0; i<al.size(); i++)
{
    gb[i]=(GoodsBean)al.get(i);
}

%>
 <html>
     <head>
         <script type="text/javascript">
            function lookup0(){
                <%
                    GoodsBean goods=gb[0];
                    request.setAttribute("goods", goods);
                %>
                window.open("show.jsp","_self");
            }
            function lookup1(){
                <%
                    GoodsBean good1=gb[1];
                    request.setAttribute("goods", good1);
                %>
                window.open("show.jsp","_self");
            }
            function lookup2(){
                <%
                    GoodsBean good2=gb[2];
                    request.setAttribute("goods", good2);
                %>
                window.open("show.jsp","_self");
            }
            
        </script>
     </head>
     <body>
     <form>
         <table>
             <tr>
                 <th height ="17" colspan="2" scope="col"><font color="#FF00FF">商品名称:   <%=gb[0].getGoodsName() %></font></th>
                 <th height ="28%" colspan="2" scope="col"><font color="#FF00FF">商品名称:<%=gb[1].getGoodsName() %></font></th>
                 <th height ="31%" colspan="2" scope="col"><font color="#FF00FF">商品名称:<%=gb[2].getGoodsName() %></font></th>
             </tr>

             <tr>
                 <th height ="17" colspan="2" scope="col"><font color="#FF00FF">商品价格:   <%=gb[0].getGoodsPrices() %></font></th>
                 <th height ="28%" colspan="2" scope="col"><font color="#FF00FF">商品价格:<%=gb[1].getGoodsPrices() %></font></th>
                 <th height ="31%" colspan="2" scope="col"><font color="#FF00FF">商品价格:<%=gb[2].getGoodsPrices() %></font></th>
             </tr>
             <tr>
                 <th height ="17" colspan="2" scope="col"><font color="#FF00FF">商品简介 :  <%=gb[0].getGoodsInfo() %></font></th>
                 <th height ="28%" colspan="2" scope="col"><font color="#FF00FF">商品简介:<%=gb[1].getGoodsInfo() %></font></th>
                 <th height ="31%" colspan="2" scope="col"><font color="#FF00FF">商品简介:<%=gb[2].getGoodsInfo() %></font></th>
             </tr>
             <tr>
                 <th height ="17" colspan="2" scope="col"><font color="#FF00FF"><input type="button" onclick="lookup0()" value="查看"/></font></th>
                 <th height ="28%" colspan="2" scope="col"><font color="#FF00FF"><input type="button" onclick="lookup1()"  value="查看"/></font></th>
                 <th height ="31%" colspan="2" scope="col"><font color="#FF00FF"><input type="button" onclick="lookup2()"  value="查看"/></font></th>
             </tr>
         
         </table>
         </form>
     </body>
 </html>

[ 本帖最后由 hiyourstory 于 2014-12-25 21:45 编辑 ]
搜索更多相关主题的帖子: java 中文 null import 而且 
2014-12-25 21:44
hiyourstory
Rank: 1
等 级:新手上路
帖 子:7
专家分:4
注 册:2014-10-21
收藏
得分:0 
2014-12-26 09:41
java小蚂蚁
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:上海
等 级:贵宾
威 望:18
帖 子:558
专家分:2186
注 册:2013-7-2
收藏
得分:0 
没看出来拿错了,你标红的地方

学海无涯#¥%……&*(
2015-01-17 12:12
快速回复:求助大神~jsp运行以后老说这里是错的
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032818 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved