您的位置:首页 > Web前端 > JavaScript

运用jsp简单实现 类似HTML框架结构的运用:

2014-07-28 17:53 330 查看
Login_top.jsp 文件

需去除的代码:

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

主代码:

    <form action="" method="post">

      登陆名:<input type="text" name="name">

      密码:<input type="password" name="pwd">

      <input type="submit" value="登陆">

    </form>

index.jsp中放入login_top.jsp头部:

<body>

<%@ include file="login_top.jsp" %>

</body>

index.jsp中放入login_top.jsp《Div中》:

可以实现类似HTMl的框架功能:--出现在框架左边

<body>

<div id="top">top</div>

<div id="left"><%@ include file="login_top.jsp" %></div>

<div id="right">right</div>

</body>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jsp
相关文章推荐