struts <html: tags 和 struts <s: tags 有什么区别 [英] What is the difference between struts <html: tags and struts <s: tags

查看:33
本文介绍了struts <html: tags 和 struts <s: tags 有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在一些论坛中看到他们将 struts 标签初始化为

I can see in some forums they are initializing struts tag as

<%@taglib prefix="html" uri="http://struts.apache.org/tags-html" %>

他们正在将标签初始化为 等.

and they are initializing tags as <html:form> etc..

但我使用 struts 标签作为

but i am using struts tag as

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

并用作 标签.我的问题是,struts <html:form> 标签和 <s:form> 标签之间有什么区别,或者它们只有前缀有变化.

and using as <s:form> tag. my qustion is, Is there any difference in between struts <html:form> tag and <s:form> tag, or they have only change in prefix only.

推荐答案

我对 Struts1 不太了解,但如果我是对的,你提到的 来自经典的 Struts1 和 来自 S2.

I do not have much idea about Struts1, but if i am correct the one you mention <html:form> are from classic Struts1 and <s:form> is from S2.

基本上,您可以使用任何前缀在 S2 标签中定义,例如 a、b、c 等.如果您希望可以自由使用 html 作为前缀,您需要告诉 S2

Basically you can use any prefix to define in S2 tags like a, b,c etc.If you want you are free to use html as you prefix all you need to tell S2 about this like

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

简而言之,它只是声明并使用 s 作为前缀是一种约定.

in short its only the declaration and using s as prefix is kind of convention.

这篇关于struts &lt;html: tags 和 struts &lt;s: tags 有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆