<strike id="5ntnv"><i id="5ntnv"><del id="5ntnv"></del></i></strike>
<strike id="5ntnv"></strike><ruby id="5ntnv"></ruby><del id="5ntnv"><dl id="5ntnv"><del id="5ntnv"></del></dl></del><strike id="5ntnv"><dl id="5ntnv"><del id="5ntnv"></del></dl></strike>
<strike id="5ntnv"></strike>
<strike id="5ntnv"></strike>
<span id="5ntnv"><dl id="5ntnv"></dl></span>
<strike id="5ntnv"><i id="5ntnv"><del id="5ntnv"></del></i></strike><th id="5ntnv"><noframes id="5ntnv"><span id="5ntnv"><dl id="5ntnv"><del id="5ntnv"></del></dl></span>
<span id="5ntnv"></span>
<strike id="5ntnv"><dl id="5ntnv"><del id="5ntnv"></del></dl></strike>
<strike id="5ntnv"><dl id="5ntnv"><del id="5ntnv"></del></dl></strike><strike id="5ntnv"><i id="5ntnv"></i></strike><span id="5ntnv"></span>
<strike id="5ntnv"></strike>
<strike id="5ntnv"></strike>
<th id="5ntnv"><noframes id="5ntnv">
<ruby id="5ntnv"></ruby>
<strike id="5ntnv"><dl id="5ntnv"></dl></strike>

貴州網站建設公司貴州網站建設公司

struts2使用struts2

1、使用下載插件

     http://code.google.com/p/struts2-bootstrap/

2、使用添加maven依賴

<dependency>
<groupId>com.jgeppert.struts2.bootstrap</groupId>
<artifactId>struts2-bootstrap-plugin</artifactId>
<version>2.0.0</version>
</dependency>

3、使用JSP頁面頭

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
...
<!-- Le HTML5 shim,使用 for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<sb:head/>
</head>
<body>
...
</body>
</html>

4、JSP頁面中可以直接用bootstrap標簽了

<s:actionerror theme="bootstrap"/>
<s:actionmessage theme="bootstrap"/>
<s:fielderror theme="bootstrap"/>

<s:form action="index" enctype="multipart/form-data" theme="bootstrap" cssClass="form-horizontal"
label="A sample horizontal Form">
<s:textfield label="Name" name="name" tooltip="Enter your Name here"/>

<s:textfield  label="Textfield with Error" name="error"/>

<s:textarea tooltip="Enter your Biography" label="Biography" name="bio" cols="20" rows="3"/>

<s:select tooltip="Choose Your Favourite Color" label="Favorite Color" list="{ 'Red',使用 'Blue', 'Green'}" name="favouriteColor" emptyOption="true"  headerKey="None"  headerValue="None"/>

<s:checkboxlist tooltip="Choose your Friends" label="Friends" list="{ 'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" name="friends"/>

<s:checkboxlist tooltip="Checkboxes with inline position" labelposition="inline" label="Friends Inline" list="{ 'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" name="friendsInline"/>

<s:radio tooltip="Choose your Best Friend" label="Best Friend" list="{ 'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" name="bestFriend"  cssErrorClass="foo"/>

<s:radio tooltip="Radio Buttons with inline position" label="Best Friend Inline" labelposition="inline" list="{ 'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" name="bestFriend" cssErrorClass="foo"/>

<s:checkbox tooltip="Confirmed that your are Over 18" label="Age 18+" name="legalAge"/>

<s:doubleselect tooltip="Choose Your State" label="State" name="region" list="{ 'North', 'South'}" value="'South'" doubleValue="'Florida'"  doubleList="top == 'North' ? { 'Oregon', 'Washington'} : { 'Texas', 'Florida'}"  doubleName="state" headerKey="-1" headerValue="---------- Please Select ----------"  emptyOption="true"/>

<s:file tooltip="Upload Your Picture" label="Picture" name="picture"/>

<s:optiontransferselect tooltip="Select Your Favourite Cartoon Characters" label="Favourite Cartoons Characters"  name="leftSideCartoonCharacters" leftTitle="Left Title" rightTitle="Right Title" list="{ 'Popeye', 'He-Man', 'Spiderman'}" multiple="true"  headerKey="headerKey" headerValue="--- Please Select ---" emptyOption="true" doubleList="{ 'Superman', 'Mickey Mouse', 'Donald Duck'}"
doubleName="rightSideCartoonCharacters" doubleHeaderKey="doubleHeaderKey" doubleHeaderValue="--- Please Select ---"  doubleEmptyOption="true" doubleMultiple="true"/>

<s:textarea label="Your Thougths" name="thoughts" tooltip="Enter your thoughts here"/>

<s:submit cssClass="btn"/>
</s:form>

struts2使用struts2-bootstrap-plugin插件 _ JavaClub全棧架構師技術筆記


問題1:Unable to load configuration. - bean - jar:file:/D:/ProgramServer/Tomcat7/wtpwebapps/happycar/WEB-INF/lib/struts2-bootstrap-plugin-2.0.0.jar!/struts-plugin.xml

原因?==》struts2升級到2.3.20

問題2:

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

 

作者:mingziday
來源鏈接:https://www.cnblogs.com/mingziday/p/4523602.html

贊(25349)
未經允許不得轉載:>貴州網站建設公司 » struts2使用struts2
国产欧美精品