Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: new version 1.3.0

Name

Bootstrap Plugin

Publisher

Johannes Geppert

License

Open Source (ASL2)

Version

1.23.1 0

Compatibility

Struts 2.1.x +

Homepage

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

Download

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

Showcase

http://www.weinfreund.de/struts2-bootstrap-showcase/index.action

...

Simple and flexible HTML, CSS, and Javascript for popular user interface components and interactions.

...

Installation

...

Manual

...

Copy the struts2-bootstrap-plugin.jar into your WEB-INF/lib path.

Maven

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

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

Use the Bootstrap Form Theme

.
</dependencies>

Usage

Prepare your JSP

Include the Taglib and use the HeadTag to load necessary resources.

Code Block

<%@ 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>

Use the Bootstrap Form Theme

Code Block
Code Block

            <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"<s:actionerror theme="bootstrap"/>
                        name="name"
          <s:actionmessage theme="bootstrap"/>
            <s:fielderror  tooltiptheme="Enter your Name herebootstrap"/>


                <s:textfield
    form action="index" enctype="multipart/form-data" theme="bootstrap" cssClass="form-horizontal"
                    label="TextfieldA sample withhorizontal ErrorForm">
                <s:textfield
        name="error"/>

                <s:textarealabel="Name"
                        tooltipname="Enter your Biographyname"
                        labeltooltip="Biography"
Enter your Name here"/>

                 <s:textfield
    name="bio"
                      label="Textfield with cols="20Error"
                        rowsname="3error"/>

                <s:selecttextarea
                        tooltip="ChooseEnter Youryour Favourite ColorBiography"
                        label="Favorite ColorBiography"
                        listname="{'Red', 'Blue', 'Green'}bio"
                        namecols="favouriteColor20"
                        emptyOptionrows="true"
3"/>

                <s:select
            headerKey="None"
            tooltip="Choose Your Favourite Color"
         headerValue="None"/>

                <s:checkboxlistlabel="Favorite Color"
                        tooltiplist="Choose your Friends{'Red', 'Blue', 'Green'}"
                        labelname="FriendsfavouriteColor"
                        list="{'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}emptyOption="true"
                        nameheaderKey="friendsNone"/>

                <s:checkboxlist
           headerValue="None"/>

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

                <s:radio:checkboxlist
                        tooltip="Checkboxes with inline position"
                        tooltiplabelposition="Choose your Best Friendinline"
                        label="BestFriends FriendInline"
                        list="{'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
                        name="bestFriendfriendsInline"/>

                <s:radio
                        tooltip="Choose your Best  Friend"
         cssErrorClass="foo"/>

                <s:radiolabel="Best Friend"
                        tooltiplist="Radio Buttons with inline position{'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
                        labelname="Best Friend InlinebestFriend"
                        labelpositioncssErrorClass="inlinefoo"/>

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

                <s:checkboxlabelposition="inline"
                        tooltiplist="Confirmed that your are Over 18{'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
                        labelname="Age 18+bestFriend"
                        namecssErrorClass="legalAgefoo"/>

                <s:doubleselectcheckbox
                        tooltip="Choose Your StateConfirmed that your are Over 18"
                        label="StateAge 18+"
                        name="region" list="{'North', 'South'}""legalAge"/>

                <s:doubleselect
                        valuetooltip="'South'Choose Your State"
                        doubleValuelabel="'Florida'State"
                        doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texasname="region" list="{'North', 'FloridaSouth'}"
                        doubleNamevalue="state'South'"
                        headerKeydoubleValue="-1'Florida'"
                        headerValue="---------- Please Select ----------"
         doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}"
        emptyOption="true"/>

                <s:filedoubleName="state"
                        tooltipheaderKey="Upload Your Picture-1"
                        label="PictureheaderValue="---------- Please Select ----------"
                        nameemptyOption="picturetrue"/>

                <s:optiontransferselectfile
                        tooltip="SelectUpload Your Favourite Cartoon CharactersPicture"
                        label="Favourite Cartoons Characters"
Picture"
                        name="picture"/>

                name="leftSideCartoonCharacters"<s:optiontransferselect
                        leftTitletooltip="Left TitleSelect Your Favourite Cartoon Characters"
                        rightTitlelabel="RightFavourite Cartoons TitleCharacters"
                        list="{'Popeye', 'He-Man', 'Spiderman'} name="leftSideCartoonCharacters"
                        multipleleftTitle="trueLeft Title"
                        headerKeyrightTitle="headerKeyRight Title"
                        headerValuelist="--- Please Select ---{'Popeye', 'He-Man', 'Spiderman'}"
                        emptyOptionmultiple="true"
                        doubleList="{'Superman', 'Mickey Mouse', 'Donald Duck'} headerKey="headerKey"
                        doubleNameheaderValue="rightSideCartoonCharacters--- Please Select ---"
                        doubleHeaderKeyemptyOption="doubleHeaderKeytrue"
                        doubleHeaderValuedoubleList="--- Please Select ---{'Superman', 'Mickey Mouse', 'Donald Duck'}"
                        doubleEmptyOptiondoubleName="truerightSideCartoonCharacters"
                        doubleMultipledoubleHeaderKey="truedoubleHeaderKey"/>


                        <s:textareadoubleHeaderValue="--- Please Select ---"
                        labeldoubleEmptyOption="Your Thougthstrue"
                        namedoubleMultiple="thoughtstrue"/>

                <s:textarea
              tooltip="Enter your thoughts here"/>

       label="Your Thougths"
        <s:submit cssClass="btn"/>
            </s:form>

Installation

Manual

Copy the struts2-bootstrap-plugin.jar into your WEB-INF/lib path.

Maven

Code Block

<dependencies>
    name="thoughts"
               ...
    <dependency>
     tooltip="Enter your  <groupId>com.jgeppert.struts2.bootstrap</groupId>
  thoughts here"/>

      <artifactId>struts2-bootstrap-plugin</artifactId>
          <version>1.2.1</version><s:submit cssClass="btn"/>
    </dependency>
        ...
</dependencies>s:form>

Resources

Version History

Version

Date

Author

Notes

1.3.0

Feb 22, 2012

Johannes Geppert

Version 1.3.0

1.2.1

Feb 17, 2012

Johannes Geppert

Version 1.2.1

1.2.0

Feb 4, 2012

Johannes Geppert

Version 1.2.0