2012年10月3日 星期三

struts2之form標籤theme屬性說明


struts2中theme屬性包括xhtml,html,simple,ajax 。默認是xhtml
theme:設置struts2標籤的主題,預設為xhtml。 theme=xhtml時:會默認額外生成tr,td。 theme=simple時:就生成標籤所對應的html標籤形式。
在預設情況下,表單元素是分佈在不同行的。如下代碼:

<s:form action="login2"><s:textfield label="用戶名" name="username"/><s:password label="密碼"name="password"/><s:submit label="提交"/> </s:form>

我們看著以上的代碼跟HTML的差不了多少,但是因為struts2表單默認將表單內的每一個元素都分在單獨的一行,label屬性就如同我們在HTML 中在<input type="text"/>前面的文字標籤一樣。如果我們不想讓它自動換行,那就應該寫成如下格式:
<s:form action="login2" theme="simple"><s:textfield label="用戶名" name="username"/><s:password label="密碼 ”name="password"/><s:submit label="提交"/> </s:form>
但在設置theme="simple"後,表單元素的label屬性將失效,這時我們就得在表單元素前面加入想用label顯示的文字。如:
<s:form action="login2" theme="simple">用戶名:<s:textfield label="用戶名" name="username"/>密碼:<s:password label="密碼" name="password"/><s:submit label="提交"/> </s:form>
此時顯示的為將不在是label中的值,而是顯示文字方塊前面的文字,按鈕則顯示它原來的預設值:sbumit。

21 則留言:

匿名 提到...

buy phentermine phentermine order online australia - buy phentermine in usa online

匿名 提到...

order an [URL=http://jacket-dresses.net/]moncler sale[/URL] online wdkIYYOy [URL=http://jacket-dresses.net/ ] http://jacket-dresses.net/ [/URL]

匿名 提到...

cheap tGEXGkws [URL=http://www.louis-vuitton-online-shop2013.com/]lv online outlet[/URL] and get big save nPLcFopL [URL=http://www.louis-vuitton-online-shop2013.com/ ] http://www.louis-vuitton-online-shop2013.com/ [/URL]

匿名 提到...

order an cqxMuxlU [URL=http://www.ugg-boots-uk2013.net/]genuine ugg boots uk[/URL] for more IqfpAubc [URL=http://www.ugg-boots-uk2013.net/ ] http://www.ugg-boots-uk2013.net/ [/URL]

匿名 提到...

I am sure you will love zgSHvYxo [URL=http://www.chanel--online-shop.net/]chanel knockoffs[/URL] online shopping TdwIYmFr [URL=http://www.chanel--online-shop.net/ ] http://www.chanel--online-shop.net/ [/URL]

匿名 提到...

order an XTlLLsjV [URL=http://www.burberry-outlet2013.com/]burberry scarves[/URL] online ubyUKUAe [URL=http://www.burberry-outlet2013.com/ ] http://www.burberry-outlet2013.com/ [/URL]

匿名 提到...

best for you WXsLpQkU [URL=http://www.louis--vuitton--online--shop.org/]loui vuitton outlet online[/URL] for gift xQtEemrN [URL=http://www.louis--vuitton--online--shop.org/ ] http://www.louis--vuitton--online--shop.org/ [/URL]

匿名 提到...

order an tvQvPYKS [URL=http://www.louis--vuitton--online--shop.org/]louis vuitton factory outlet online[/URL] online shopping zrpPJpOd [URL=http://www.louis--vuitton--online--shop.org/ ] http://www.louis--vuitton--online--shop.org/ [/URL]

匿名 提到...

you must read EyISdwGq [URL= - designer knockoff handbags[/URL - for more frbTJlum [URL= - [/URL -

匿名 提到...

you will like SvlolOTB [URL=http://www.cheapguccireplica.tumblr.com/]gucci outlet online[/URL] to your friends rFDVfMTM [URL=http://www.cheapguccireplica.tumblr.com/ ] http://www.cheapguccireplica.tumblr.com/ [/URL]

匿名 提到...

must look at this wWIFbElY [URL=http://www.gucci-onlinestore.tumblr.com/ - gucci outlets[/URL - with low price WICUvwyO [URL=http://www.gucci-onlinestore.tumblr.com/ - http://www.gucci-onlinestore.tumblr.com/ [/URL -

匿名 提到...

Wow, marvelous weblog structure! How lengthy have you been blogging for?
you made running a blog glance easy. The entire look of your website is
fantastic, as well as the content!

Also visit my webpage how to qualify for fha loan with bad Credit

匿名 提到...

Hmm it looks like your website ate my first comment (it
was super long) so I guess I'll just sum it up what I had written and say, I'm thoroughly enjoying your blog.

I as well am an aspiring blog blogger but I'm still new to everything. Do you have any tips for first-time blog writers? I'd definitely appreciate
it.

Here is my website :: mortgage lenders for bad credit

匿名 提到...

I would like to thank you for the efforts you have
put in writing this site. I'm hoping to see the same high-grade blog posts by you later on as well. In truth, your creative writing abilities has inspired me to get my very own website now ;)

Feel free to surf to my weblog affiliate Networks

匿名 提到...

Undeniably believe that that you stated. Your favorite reason seemed to be on the net the simplest factor to have in mind of.
I say to you, I definitely get irked whilst folks consider concerns that they just
don't realize about. You controlled to hit the nail upon the top and also outlined out the whole thing with no need side effect , other folks can take a signal. Will likely be again to get more. Thanks

Also visit my homepage - Email Console

匿名 提到...

An interesting discussion is definitely worth comment. I believe
that you need to publish more on this issue, it might not be a taboo matter but typically people don't speak about these subjects. To the next! Many thanks!!

Also visit my blog post; bad credit home lender mortgage

匿名 提到...

Your current post fеaturеs confirmеd
useful to uѕ. It’s quіte useful and you're certainly extremely well-informed of this type. You have popped my personal face to be able to different thoughts about this particular subject matter together with interesting and strong written content.

my blog: Meridia
Here is my website meridia

匿名 提到...

Hi, everything is going well here and ofcourse every one is
sharing facts, that's truly excellent, keep up writing.

Also visit my web site ... krankenkasse privat gesetzlich

匿名 提到...

Thanks for any other great article. The place else may anyone get that type of info in such an ideal approach of writing?
I have a presentation next week, and I'm on the search for such information.

Here is my weblog us virgin Island Vacations

匿名 提到...

Toms shoes are about new to the market. You may acquire noticed them around, they accessory a little like an espadrille, but they do not acquire the cork bottoms, instead, they acquire an adaptable sole. They are an actualization of shoe admired by boyish people, and abnormally students. They acquire the abounding above of acclimation altogether the allegation for actualization and comfort.Toms For Your Toes[url=http://www.cheaptomsbuy.com]Cheap Toms sale[/url] While you may appropriately acquire the talents of designing, somebody does even now should sew the accoutrements to actualize your technology a reality. This may appropriately blast alarm for bearing a cease with a accoutrements abundance to appraisal the bed-making options for you. This could as well accommodate you with the anticipation to seek advice from beeline accepting a artisan to actualize any alterations and accessory modifications in detail you may appropriately accept overlooked. Your cruise will be as well admittance you to absolutely abridge the commercial amount of bed-making it. The absolutely specific affair apropos the cast casts is its adeptness to angle out by adjustment of the army with its one-of-a-kind architecture & admiration collection. Sizes, colors, styles and prints are abounding & plethoric! What Forms of Payment Does TOMS Shoes Accept? [url=http://www.cheaptomssite.com]Toms Online[/url] A company called Toms Shoes have gone one better by devising a policy to donate a pair of shoes to children in poor countries for every pair bought by the buying public. This company was founded in America in 2006 after its owner saw poor children running around without footwear. Sometimes these children did not go to school as schools do not admit pupils if they do not have any shoes to wear. [url=http://www.tomsfans.com]Cheap Toms Sale[/url] TOMS Shoes is a for-profit footwear company that is based in Santa Monica, California, which also operates a non-profit subsidiary, Friends of TOMS. The company was founded in 2006 by Blake Mycoskie, an entrepreneur from Arlington, Texas. The company designs and sells lightweight shoes based on the Argentine alpargata design. With every pair sold, TOMS donates a new pair of shoes to a child in need.
Relate Artcile

[url=http://www.000webhost.com/profile.php?lookup=4411]offercool toms women shoes for cheap price[/url]
[url=http://kledy.co.uk/]offercomfortable toms women shoes for cheap price[/url]

匿名 提到...

I almost never leave a response, but i did some searching and wound up here "struts2之form標籤theme屬性說明".

And I actually do have a couple of questions for you if it's allright. Is it just me or does it give the impression like a few of these comments look as if they are written by brain dead visitors? :-P And, if you are writing at additional places, I would like to keep up with everything fresh you have to post. Could you make a list of every one of your communal sites like your linkedin profile, Facebook page or twitter feed?

Also visit my page :: diets that work for women