首页 > Web开发 > 详细

Struts2学习笔记-jsp中引用struts2框架

时间:2016-03-31 01:58:46      阅读:218      评论:0      收藏:0      [点我收藏+]

如果在jsp中需要引用struts2 框架,需在前面加上以下内容

    <%@taglib prefix="s" uri="/struts-tags" %>

taglib代代表引入库,uri是库的位置,prefix代表会在下文中使用的时候,以什么的前序为开头,下面是一个例子

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    <center>
        <s:property value="popedom" />
        <br /> <b>User Login</b><br />
        <s:form>
            <s:textfield label="Login User" name="userName"></s:textfield>
            <s:password label="Password" name="passwrod"></s:password>
            <s:submit value="submit"></s:submit>
        </s:form>

    </center>
</body>
</html>

 

Struts2学习笔记-jsp中引用struts2框架

原文:http://www.cnblogs.com/oscar1987121/p/5339687.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!