diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml index 99bceb716..292512881 100644 --- a/apps/showcase/pom.xml +++ b/apps/showcase/pom.xml @@ -155,7 +155,7 @@ net.sourceforge.htmlunit htmlunit - 2.27 + 2.37.0 test @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 2.22.1 + 2.22.2 it.org.apache.struts2.showcase.*Test diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java index edbe4ae2b..6a5d85f67 100644 --- a/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java +++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java @@ -36,6 +36,7 @@ public class MoreSelectsAction extends ActionSupport { private List _prioritisedFavouriteCars; private List _prioritisedFavouriteCountries; private List favouriteNumbers; + private List favouriteCities; // Cartoon Characters @@ -124,6 +125,14 @@ public class MoreSelectsAction extends ActionSupport { return list; } + public List getFavouriteCities() { + return favouriteCities; + } + + public void setFavouriteCities(List favouriteCities) { + this.favouriteCities = favouriteCities; + } + // actions public String input() throws Exception { diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java index 56dbf9bfb..541adccff 100644 --- a/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java +++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java @@ -27,6 +27,7 @@ import org.apache.struts2.action.ServletContextAware; import javax.servlet.ServletContext; import java.io.BufferedReader; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -88,9 +89,16 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa } } - String rootPath = ServletActionContext.getServletContext().getRealPath("/"); + final String rootPath = ServletActionContext.getServletContext().getRealPath("/"); + final String rootPathUnix = (rootPath != null ? rootPath.replace(File.separator, "/") : null); // Make path Unix-like for comparison (e.g. on Windows) + final String rootPathFileURI = "file://" + rootPathUnix; + final String collapsedRootPathFileURI = rootPathFileURI.replace("//", "/"); // Config string may have been transformed + final String rootPathWarFileURI = "war:file://" + rootPathUnix; + final String collapsedRootPathWarFileURI = rootPathWarFileURI.replace("//", "/"); // Config string may have been transformed - if (config != null && (rootPath == null || config.startsWith(rootPath))) { + if (config != null && (rootPath == null || config.startsWith(rootPath) || + config.startsWith(rootPathFileURI) || config.startsWith(collapsedRootPathFileURI) || + config.startsWith(rootPathWarFileURI) || config.startsWith(collapsedRootPathWarFileURI))) { int pos = config.lastIndexOf(':'); configLine = Integer.parseInt(config.substring(pos + 1)); config = config.substring(0, pos).replace("//", "/"); @@ -192,7 +200,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa } /** - * Reads in a strea, optionally only including the target line number + * Reads in a stream, optionally only including the target line number * and its padding * * @param in The input stream diff --git a/apps/showcase/src/main/webapp/WEB-INF/hangman/hangmanNonAjax.ftl b/apps/showcase/src/main/webapp/WEB-INF/hangman/hangmanNonAjax.ftl index 2571d271a..046ab4bab 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/hangman/hangmanNonAjax.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/hangman/hangmanNonAjax.ftl @@ -125,7 +125,7 @@ <#else> " width="381" height="44" /> - <@s.a href="%{#startHref}"> + <@s.a href="%{#startHref}" escapeHtmlBody="false"> " width="250" height="43" /> <#else> @@ -139,6 +139,7 @@ <@s.a href="%{#url}" id="%{#currentCharacter}" + escapeHtmlBody="false" > " width="36" border="0" /> diff --git a/apps/showcase/src/main/webapp/WEB-INF/person/new-person.ftl b/apps/showcase/src/main/webapp/WEB-INF/person/new-person.ftl index 07a66d4a6..6af4da446 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/person/new-person.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/person/new-person.ftl @@ -59,7 +59,7 @@
- <@s.submit value="Create person" cssClass="btn btn-primary"/> + <@s.submit value="Create person" cssClass="btn btn-primary" escapeHtmlBody="false"/>
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefix.ftl b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefix.ftl index 6e4432ea5..806883716 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefix.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefix.ftl @@ -35,7 +35,7 @@

The text you've entered is ${text!''}

- <@s.a href="javascript:history.back();" cssClass="btn btn-info"> Back + <@s.a href="javascript:history.back();" cssClass="btn btn-info" escapeHtmlBody="false"> Back diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefixExample.ftl b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefixExample.ftl index 98b0a9232..63312c786 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefixExample.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/actionPrefixExample.ftl @@ -57,13 +57,13 @@ <@s.textfield label="Enter Some Text" name="text" /> - <@s.submit action="actionPrefix" value="%{'action prefix'}" cssClass="btn" /> + <@s.submit action="actionPrefix" value="%{'action prefix'}" cssClass="btn" escapeHtmlBody="false" /> - <@s.submit method="alternateMethod" value="%{'method prefix'}" cssClass="btn" /> + <@s.submit method="alternateMethod" value="%{'method prefix'}" cssClass="btn" escapeHtmlBody="false" /> - <@s.submit value="Normal Submit" cssClass="btn" /> + <@s.submit value="Normal Submit" cssClass="btn" escapeHtmlBody="false" /> - <@s.submit action="redirectActionPrefixAction" value="%{'redirectAction without prefix'}" cssClass="btn" /> + <@s.submit action="redirectActionPrefixAction" value="%{'redirectAction without prefix'}" cssClass="btn" escapeHtmlBody="false" /> diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/methodPrefix.ftl b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/methodPrefix.ftl index e1460408e..b94bf6d88 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/methodPrefix.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/methodPrefix.ftl @@ -35,7 +35,7 @@

The text you've enter is ${text!''}

- <@s.a href="javascript:history.back();" cssClass="btn btn-info"> Back + <@s.a href="javascript:history.back();" cssClass="btn btn-info" escapeHtmlBody="false"> Back diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/normalSubmit.ftl b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/normalSubmit.ftl index a1431f71e..3052ff173 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/normalSubmit.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/normalSubmit.ftl @@ -35,7 +35,7 @@

The text you've enter is %{text}

- <@s.a href="javascript:history.back();" cssClass="btn btn-info"> Back + <@s.a href="javascript:history.back();" cssClass="btn btn-info" escapeHtmlBody="false"> Back diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/redirectActionPrefix.ftl b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/redirectActionPrefix.ftl index 481ad9724..602f6bee7 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/redirectActionPrefix.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/actionPrefix/redirectActionPrefix.ftl @@ -38,7 +38,7 @@ The text you've enter is ${text!''}

- <@s.a href="javascript:history.back();" cssClass="btn btn-info"> Back + <@s.a href="javascript:history.back();" cssClass="btn btn-info" escapeHtmlBody="false"> Back diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.jsp index f69d823d4..923e4c624 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.jsp +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.jsp @@ -38,7 +38,7 @@ - + @@ -114,8 +114,8 @@ emptyOption="true" /> diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.vm b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.vm index 1e52a6df1..c7ca9312c 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.vm +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/example.vm @@ -31,16 +31,20 @@

#sform ("action=exampleSubmitVelocity" "method=post" "enctype=multipart/form-data") - #stextfield ("label=Name" "name=name") - #stextarea ("label=Biography" "name=bio" "cols=20" "rows=3") - #sselect ("label=Favourite Color" "list={'Red', 'Blue', 'Green'}" "name=favouriteColor" "emptyOption=true" "headerKey=None" "headerValue=None") - #sselect ("label=Favourite Language" "list=favouriteLanguages" "name=favouriteLanguage" "listKey=key" "listValue=description" "emptyOption=true" "headerKey=None" "headerValue=None") - #scheckboxlist ("label=Friends" "list={'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" "name=friends") - #scheckbox ("label=Age 18+" "name=legalAge") - #sdoubleselect ("label=State" "name=region" "list={'North', 'South'}" "value='North'" "doubleValue='Florida'" "doubleList=top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" "doubleName=state" "headerKey=-1" "headerValue=---------- Please Select ----------" "emptyOption=true" ) - #sdoubleselect ("label=Favourite Vehical" "name=favouriteVehicalType" "list=vehicalTypeList" "listKey=key" "listValue=description" "value='MotorcycleKey'" "doubleValue='YamahaKey'" "doubleList=vehicalSpecificList" "doubleListKey=key" "doubleListValue=description" "doubleName=favouriteVehicalSpecific" "headerKey=-1" "headerValue=---------- Please Select ----------" "emptyOption=true" ) - #sfile ("label=Picture" "name=picture") - #soptiontransferselect ("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" ) + #stextfield ("label=Name" "name=name" "tooltip=Enter your Name here") + #stextfield ("label=Birthday" "name=birthday" "tooltip=Select Your Birthday") + #stextfield ("label=Wake up time" "name=wakeup" "tooltip=Enter the time you wake up") + #stextarea ("label=Biography" "name=bio" "tooltip=Enter your Biography" "cols=20" "rows=3") + #sselect ("label=Favourite Color" "tooltip=Choose Your Favourite Color" "list={'Red', 'Blue', 'Green'}" "name=favouriteColor" "emptyOption=true" "headerKey=None" "headerValue=None") + #sselect ("label=Favourite Language" "tooltip=Choose Your Favourite Language" "list=favouriteLanguages" "name=favouriteLanguage" "listKey=key" "listValue=description" "emptyOption=true" "headerKey=None" "headerValue=None") + #scheckboxlist ("label=Friends" "tooltip=Choose your Friends" "list={'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" "name=friends") + #sradio ("label=Best Friend" "tooltip=Choose your Best Friend" "list={'Wes', 'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}" "name=bestFriend" "cssErrorClass=foo") + #scheckbox ("label=Age 18+" "name=legalAge" "tooltip=Confirm that you are Over 18") + #sdoubleselect ("label=State" "name=region" "tooltip=Choose Your State" "list={'North', 'South'}" "value='North'" "doubleValue='Florida'" "doubleList=top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" "doubleName=state" "headerKey=-1" "headerValue=---------- Please Select ----------" "emptyOption=true" ) + #sdoubleselect ("label=Favourite Vehicle" "name=favouriteVehicalType" "tooltip=Choose your Vehicle" "list=vehicalTypeList" "listKey=key" "listValue=description" "value='MotorcycleKey'" "doubleValue='YamahaKey'" "doubleList=vehicalSpecificList" "doubleListKey=key" "doubleListValue=description" "doubleName=favouriteVehicalSpecific" "headerKey=-1" "headerValue=---------- Please Select ----------" "emptyOption=true" ) + #sfile ("label=Picture" "name=picture" "tooltip=Upload Your Picture") + #soptiontransferselect ("label=Favourite Cartoon Characters" "name=leftSideCartoonCharacters" "tooltip=Select Your Favourite Cartoon Characters" "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" ) + #stextarea ("label=Your Thoughts" "name=thoughts" "tooltip=Enter your thoughts here" "cols=20" "rows=3") #ssubmit("cssClass=btn btn-primary") #sreset("cssClass=btn btn-danger") #end diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.jsp index 75560ba78..ac87d1d8b 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.jsp +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.jsp @@ -36,8 +36,8 @@ - - + + @@ -50,22 +50,24 @@ - - + + - - + + - - + + diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.vm b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.vm index f0f03699a..e159bef17 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.vm +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/exampleSubmited.vm @@ -33,41 +33,45 @@ #slabel ("label=Name" "name=name") #slabel ("label=Birthday" "name=birthday") - - + + #sdate ("name=wakeup" "format=hh:mm aa") #slabel ("label=Biography" "name=bio") #slabel ("label=Favourite Color" "name=favouriteColor") #slabel ("label=Friends" "name=friends") + #slabel ("label=Best Friend" "name=bestFriend") #slabel ("label=Legal Age" "name=legalAge") #slabel ("label=Region" "name=region") #slabel ("label=State" "name=state") #slabel ("label=Picture" "name=picture") #slabel ("label=Favourite Language" "name=favouriteLanguage") - #slabel ("label=Favourite Vehical Type" "name=favouriteVehicalType") - #slabel ("label=Favourite Vehical Specific" "name=favouriteVehicalSpecific") + #slabel ("label=Favourite Vehicle Type" "name=favouriteVehicalType") + #slabel ("label=Favourite Vehicle Specific" "name=favouriteVehicalSpecific") - Favourite Cartoon Characters (Left): - + + - Favourite Cartoon Characters (Right): - + + + #slabel ("label=Thoughts" "name=thoughts")
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp index b1399671b..dccf8da69 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp @@ -110,7 +110,7 @@ Non Favourite Sports: - + .  diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl b/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl index 19dac0114..e97fa0820 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl @@ -51,7 +51,7 @@ <@s.form action="transfer4"> <@s.token/> <@s.textfield label="Amount" name="amount" required=true value="400"/> - <@s.submit value="Transfer money" cssClass="btn btn-primary"/> + <@s.submit value="Transfer money" cssClass="btn btn-primary" escapeHtmlBody="false"/>