weixin_43473189 2020-02-13 17:04 采纳率: 0%
浏览 601

我使用iframe实现了点击左边栏 只有右边的内容变化 但在跳转到servlert并转向jsp时,jsp的表格样式无法显示

图片说明

        <div id="page_content">
    <iframe name="mainiframe" src="admin_shouye.jsp" id="mainiframe" scrolling="no" onload="resizeFrameHeight()" frameborder="0" width="100%"></iframe>


</div>

servlet:

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    DoctorDao ddao = new DoctorDao();
    List<Doctor> findAll = ddao.findAllDoctor();
    System.out.println(findAll);
    request.setAttribute("doc", findAll);
     request.getRequestDispatcher("Admin/doctor_find.jsp").forward(request, response);
    //response.sendRedirect("admin/doctor_find.jsp");


}

jsp:<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<style> #outer { width: 800px; height: 500px; position: absolute; }

Insert title here

















                    </tr>
                </thead>
                <tbody>
                    <c:forEach items="${doc}" var="doc">
                        <tr>
                            <td>${doc.doctor_id}</td>
                            <td>${doc.doctor_name}</td>
                            <td>${doc.img}</td>
                            <td>${doc.doctor_pwd}</td>
                            <td>${doc.sex}</td>
                            <td>${doc.age}</td>
                            <td>${doc.phone}</td>
                            <td>${doc.email}</td>
                            <td>${doc.level}</td>
                            <td>${doc.skill}</td>
                            <td>${doc.active}</td>
                        </tr>
                    </c:forEach>
                </tbody>


            </table>
        </center>
</div>


编号 姓名 个人照片 密码 性别 年龄 手机号 邮箱 等级 技能 状态
  • 写回答

1条回答 默认 最新

  • GJ_HQQ 2020-02-13 17:14
    关注

    大致看看是因为
    你的servlet的request.setAttribute("doc", findAll);键为doc
    但是你的jsp页面的是${doc},那么你的requestjsp拿不到的,应该是${requestScope.doc}
    大致看了,是这样,如果还不行那肯定有其他错误

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器