Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 28c17a1b77 |
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
@@ -34,9 +34,9 @@
|
||||
<name>Blank Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/blank</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/apps/blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
@@ -34,9 +34,9 @@
|
||||
<name>Starter Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/apps/mailreader</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
@@ -41,9 +41,9 @@
|
||||
</modules>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/apps</url>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -225,8 +225,8 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${struts2.springPlatformVersion}</version>
|
||||
<artifactId>spring-mock</artifactId>
|
||||
<version>2.0.7</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
@@ -34,9 +34,9 @@
|
||||
<name>Portlet Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/apps/portlet</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-showcase</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
<name>Struts 2 Rest Showcase Example</name>
|
||||
<description>Struts 2 Rest Showcase Example</description>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-showcase</artifactId>
|
||||
@@ -34,9 +34,9 @@
|
||||
<name>Showcase Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/apps/showcase</url>
|
||||
</scm>
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>sitemesh</artifactId>
|
||||
<version>2.4.2</version>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>uk.ltd.getahead</groupId>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
format.number = {0,number,#0.0##}
|
||||
|
||||
save=Save
|
||||
|
||||
item.edit=Edit {0}
|
||||
|
||||
@@ -58,27 +58,26 @@
|
||||
<div class="wrapper">
|
||||
<h2 class="accessibility">Navigation</h2>
|
||||
<ul class="clearfix">
|
||||
<li><s:a value="/showcase.jsp">Home</s:a></li>
|
||||
<li><s:a value="/ajax/index.jsp">Ajax</s:a></li>
|
||||
<li><s:a value="/chat/index.jsp">Ajax Chat</s:a></li>
|
||||
<li><s:a action="actionChain1!input" namespace="/actionchaining" includeParams="none">Action Chaining</s:a></li>
|
||||
<li><s:a action="index" namespace="/config-browser" includeParams="none">Config Browser</s:a></li>
|
||||
<li><s:a value="/conversion/index.jsp">Conversion</s:a></li>
|
||||
<li><s:a value="/empmanager/index.jsp">CRUD</s:a></li>
|
||||
<li><s:a value="/wait/index.jsp">Execute & Wait</s:a></li>
|
||||
<li><s:a value="/filedownload/index.jsp">File Download</s:a></li>
|
||||
<li><s:a value="/fileupload/index.jsp">File Upload</s:a></li>
|
||||
<li><s:a value="/freemarker/index.jsp">Freemarker</s:a></li>
|
||||
<li><s:a action="hangmanMenu" namespace="/hangman">Hangman</s:a></li>
|
||||
<li><s:a value="/jsf/index.jsp">JavaServer Faces</s:a></li>
|
||||
<li><s:a value="/tags/index.jsp">Tags</s:a></li>
|
||||
<li><s:a value="/tiles/index.action">Tiles</s:a></li>
|
||||
<li><s:a value="/token/index.jsp">Token</s:a></li>
|
||||
<li><s:a value="/validation/index.jsp">Validation</s:a></li>
|
||||
<li><s:a value="/interactive/index.jsp">Interactive Demo</s:a></li>
|
||||
<li><s:a value="/person/index.jsp">Person Manager</s:a></li>
|
||||
<li><s:a value="/integration/editGangster">Struts 1 Integration</s:a></li>
|
||||
<li class="last"><s:a value="/help.jsp">Help</s:a></li>
|
||||
<li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
|
||||
<li><a href="<s:url value="/ajax/index.jsp"/>">Ajax</a></li>
|
||||
<li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a></li>
|
||||
<li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
|
||||
<li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
|
||||
<li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
|
||||
<li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
|
||||
<li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
|
||||
<li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
|
||||
<li><a href="<s:url value="/fileupload/index.jsp" />">File Upload</a></li>
|
||||
<li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
|
||||
<li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
|
||||
<li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
|
||||
<li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
|
||||
<li><a href="<s:url value="/tiles/index.action" />">Tiles</a></li>
|
||||
<li><a href="<s:url value="/token/index.jsp"/>">Token</a></li>
|
||||
<li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
|
||||
<li><a href="<s:url value="/interactive/index.jsp"/>">Interactive Demo</a></li>
|
||||
<li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
|
||||
<li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<!DOCTYPE tiles-definitions PUBLIC
|
||||
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
|
||||
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
|
||||
"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
|
||||
|
||||
<tiles-definitions>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<hr/>
|
||||
|
||||
<s:url var="backToAjaxExamples" value="../index.jsp" />
|
||||
<s:url var="backToAjaxExamples" value=".." />
|
||||
|
||||
<s:a href="%{backToAjaxExamples}">Back To AJAX Examples</s:a>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<s:textfield label="%{getText('employee.firstName')}" name="currentEmployee.firstName"/>
|
||||
<s:textfield label="%{getText('employee.lastName')}" name="currentEmployee.lastName"/>
|
||||
<sx:datetimepicker label="Birthdate" name="currentEmployee.birthDate"/>
|
||||
<s:textfield label="Salary" name="currentEmployee.salary" value="%{getText('format.number',{currentEmployee.salary})}" />
|
||||
<s:textfield label="Salary" name="currentEmployee.salary"/>
|
||||
<s:checkbox fieldValue="true" label="Married" name="currentEmployee.married"/>
|
||||
<s:combobox list="availablePositions" label="Position" name="currentEmployee.position"/>
|
||||
<s:select list="#skillAction.availableItems" listKey="name" label="Main Skill"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Validation - Ajax</title>
|
||||
<sx:head cache="true" compressed="true"/>
|
||||
<sx:head cache="false" compressed="false"/>
|
||||
</head>
|
||||
|
||||
<s:url var="url" namespace="/validation" action="quizAjax"/>
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/assembly</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/assembly</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
@@ -71,8 +71,8 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<type>jar</type>
|
||||
<classifier>jdk14</classifier>
|
||||
<scope>runtime</scope>
|
||||
@@ -161,20 +161,6 @@
|
||||
<version>${version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-oval-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -234,7 +220,7 @@
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>xwork-core-javadoc</id>
|
||||
<id>xwork-javadoc</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
@@ -243,9 +229,9 @@
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<artifactId>xwork</artifactId>
|
||||
<classifier>javadoc</classifier>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.2</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
|
||||
@@ -262,24 +248,8 @@
|
||||
<configuration>
|
||||
<tasks>
|
||||
<mkdir dir="${project.build.directory}/cwiki" />
|
||||
<!--
|
||||
<exec executable="ssh" failonerror="true" >
|
||||
<arg line="${username}@people.apache.org /www/struts.apache.org/2.x/docs-zip2.sh" />
|
||||
</exec>
|
||||
<get src="http://struts.apache.org/2.x/docs.zip" dest="${project.build.directory}/docs.zip" ignoreerrors="false" />
|
||||
<unzip src="${project.build.directory}/docs.zip" dest="${project.build.directory}/cwiki" />
|
||||
<exec executable="wget">
|
||||
<arg value="-erobots=off" />
|
||||
<arg value="-nH" />
|
||||
<arg value="-nv" />
|
||||
<arg value="-E" />
|
||||
<arg value="-L" />
|
||||
<arg value="-r" />
|
||||
<arg value="http://struts.apache.org/2.x/docs/" />
|
||||
</exec>
|
||||
-->
|
||||
<copy todir="${project.build.directory}/cwiki">
|
||||
<fileset dir="${docsDir}" />
|
||||
</copy>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<goals>
|
||||
@@ -436,31 +406,7 @@
|
||||
<artifactId>struts2-tiles-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-oval-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-admin-bundle</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-demo-bundle</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
@@ -86,14 +86,6 @@
|
||||
<include>ANTLR-LICENSE.txt</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/oval/src/main/resources</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<includes>
|
||||
<include>OVAL-LICENSE.txt</include>
|
||||
<include>XSTREAM-LICENSE.txt</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/apps</directory>
|
||||
<outputDirectory>apps</outputDirectory>
|
||||
@@ -211,25 +203,6 @@
|
||||
<directory>../plugins/tiles/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-tiles-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/oval/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-oval-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/osgi/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<!-- bundles -->
|
||||
<fileSet>
|
||||
<directory>../bundles/admin/target/site</directory>
|
||||
<outputDirectory>docs/struts2-bundles/admin</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<directory>../bundles/demo/target/site</directory>
|
||||
<outputDirectory>docs/struts2-bundles/demo</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<!-- Include the source code in the assembly -->
|
||||
<fileSet>
|
||||
|
||||
@@ -127,14 +127,6 @@
|
||||
<directory>../plugins/tiles/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-tiles-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/oval/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-oval-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/osgi/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
||||
@@ -86,13 +86,5 @@
|
||||
<include>ANTLR-LICENSE.txt</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/oval/src/main/resources</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<includes>
|
||||
<include>OVAL-LICENSE.txt</include>
|
||||
<include>XSTREAM-LICENSE.txt</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
||||
@@ -128,14 +128,6 @@
|
||||
<exclude>target/**</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../bundles</directory>
|
||||
<outputDirectory>src/bundles</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>*/target/**</exclude>
|
||||
<exclude>target/**</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-admin-bundle</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>Struts 2 OSGi Admin Bundle</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<version>2.0.0</version>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<manifestLocation>META-INF</manifestLocation>
|
||||
<Struts2-Enabled>true</Struts2-Enabled>
|
||||
<Import-Package>*,com.opensymphony.xwork2</Import-Package>
|
||||
<Export-Package>org.apache.struts2.osgi.admin*</Export-Package>
|
||||
<Spring-Context>*;create-asynchronously:=false</Spring-Context>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,208 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.osgi.admin.actions;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import org.apache.struts2.osgi.BundleAccessor;
|
||||
import org.apache.struts2.osgi.OsgiHost;
|
||||
import org.apache.struts2.osgi.StrutsOsgiListener;
|
||||
import org.apache.struts2.osgi.OsgiConfigurationProvider;
|
||||
import org.apache.struts2.util.ServletContextAware;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleException;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Dictionary;
|
||||
|
||||
public class BundlesAction extends ActionSupport implements ServletContextAware {
|
||||
|
||||
private String id;
|
||||
|
||||
private BundleAccessor bundleAccessor;
|
||||
private Configuration configuration;
|
||||
private OsgiHost osgiHost;
|
||||
|
||||
public BundlesAction() {
|
||||
}
|
||||
|
||||
public String index() {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public String view() {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public String start() throws BundleException {
|
||||
Bundle bundle = osgiHost.getBundles().get(id);
|
||||
try {
|
||||
bundle.start();
|
||||
|
||||
//start() fires a BundleEvent.STARTED, which loads the config
|
||||
//we need to wait until the config is loaded from that bundle but
|
||||
//there no easy way/elegant way to know if the bundle was processed already
|
||||
Thread.sleep(1000);
|
||||
} catch (Exception e) {
|
||||
addActionError(e.toString());
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
public String stop() throws BundleException {
|
||||
Bundle bundle = osgiHost.getBundles().get(id);
|
||||
try {
|
||||
bundle.stop();
|
||||
} catch (Exception e) {
|
||||
addActionError(e.toString());
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
public String update() throws BundleException {
|
||||
Bundle bundle = osgiHost.getBundles().get(id);
|
||||
try {
|
||||
bundle.update();
|
||||
} catch (Exception e) {
|
||||
addActionError(e.toString());
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
public boolean isStrutsEnabled(Bundle bundle) {
|
||||
return "true".equalsIgnoreCase((String) bundle.getHeaders().get(OsgiHost.OSGI_HEADER_STRUTS_ENABLED));
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Bundle getBundle() {
|
||||
return osgiHost.getBundles().get(id);
|
||||
}
|
||||
|
||||
public List<PackageConfig> getPackages() {
|
||||
List<PackageConfig> pkgs = new ArrayList<PackageConfig>();
|
||||
Bundle bundle = getBundle();
|
||||
if (bundle.getState() == Bundle.ACTIVE) {
|
||||
for (String name : bundleAccessor.getPackagesByBundle(bundle)) {
|
||||
PackageConfig packageConfig = configuration.getPackageConfig(name);
|
||||
if (packageConfig != null)
|
||||
pkgs.add(packageConfig);
|
||||
}
|
||||
}
|
||||
return pkgs;
|
||||
}
|
||||
|
||||
public ArrayList<String> getHeaderKeys() {
|
||||
return Collections.list(getBundle().getHeaders().keys());
|
||||
}
|
||||
|
||||
public Collection<Bundle> getBundles() {
|
||||
List<Bundle> bundles = new ArrayList(osgiHost.getBundles().values());
|
||||
Collections.sort(bundles, new Comparator<Bundle>() {
|
||||
public int compare(Bundle bundle1, Bundle bundle2) {
|
||||
boolean bundle1StrutsEnabled = isStrutsEnabled(bundle1);
|
||||
boolean bundle2StrutsEnabled = isStrutsEnabled(bundle2);
|
||||
|
||||
if ((bundle1StrutsEnabled && bundle2StrutsEnabled) || (!bundle1StrutsEnabled && !bundle2StrutsEnabled))
|
||||
return bundle1.getSymbolicName().compareTo(bundle2.getSymbolicName());
|
||||
else {
|
||||
return bundle1StrutsEnabled ? -1 : 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
return bundles;
|
||||
}
|
||||
|
||||
public String displayProperty(Object obj) {
|
||||
if (obj.getClass().isArray()) {
|
||||
return Arrays.asList((Object[])obj).toString();
|
||||
} else {
|
||||
return obj.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public String getBundleState(Bundle bundle) {
|
||||
switch (bundle.getState()) {
|
||||
case Bundle.ACTIVE : return "Active";
|
||||
case Bundle.INSTALLED : return "Installed";
|
||||
case Bundle.RESOLVED : return "Resolved";
|
||||
case Bundle.STARTING : return "Starting";
|
||||
case Bundle.STOPPING : return "Stopping";
|
||||
case Bundle.UNINSTALLED : return "Uninstalled";
|
||||
default : throw new IllegalStateException("Invalid state");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAllowedAction(Bundle bundle, String val) {
|
||||
int state = -1;
|
||||
try {
|
||||
state = bundle.getState();
|
||||
} catch (Exception e) {
|
||||
addActionError("Unable to determine bundle state: " + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ("start".equals(val)) {
|
||||
return state == Bundle.RESOLVED;
|
||||
} else if ("stop".equals(val)) {
|
||||
return state == Bundle.ACTIVE;
|
||||
} else if ("update".equals(val)) {
|
||||
return state == Bundle.ACTIVE || state == Bundle.INSTALLED
|
||||
|| state == Bundle.RESOLVED;
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid state");
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setConfiguration(Configuration configuration) {
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setBundleAccessor(BundleAccessor bundleAccessor) {
|
||||
this.bundleAccessor = bundleAccessor;
|
||||
}
|
||||
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
osgiHost = (OsgiHost) servletContext.getAttribute(StrutsOsgiListener.OSGI_HOST);
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.osgi.admin.actions;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import org.apache.struts2.osgi.DefaultBundleAccessor;
|
||||
import org.apache.felix.shell.ShellService;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* This action executes commands on the Felix Shell
|
||||
*/
|
||||
public class ShellAction extends ActionSupport {
|
||||
private String command;
|
||||
private String output;
|
||||
|
||||
public String execute() {
|
||||
// get service
|
||||
ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream errByteStream = new ByteArrayOutputStream();
|
||||
PrintStream outStream = new PrintStream(outByteStream);
|
||||
PrintStream errStream = new PrintStream(errByteStream);
|
||||
|
||||
String outString = null;
|
||||
String errString = null;
|
||||
try {
|
||||
executeCommand(command, outStream, errStream);
|
||||
outString = outByteStream.toString().trim();
|
||||
errString = errByteStream.toString().trim();
|
||||
} catch (Exception e) {
|
||||
errString = e.getMessage();
|
||||
} finally {
|
||||
outStream.close();
|
||||
errStream.close();
|
||||
}
|
||||
|
||||
output = errString != null && errString.length() > 0 ? errString : outString;
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
|
||||
public String getCommand() {
|
||||
return command;
|
||||
}
|
||||
|
||||
public void setCommand(String command) {
|
||||
this.command = command;
|
||||
}
|
||||
|
||||
public String getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
public void executeCommand(String commandLine, PrintStream out, PrintStream err) throws Exception {
|
||||
ShellService shellService = getShellService();
|
||||
if (shellService != null)
|
||||
shellService.executeCommand(commandLine, out, err);
|
||||
else
|
||||
err.println("Apache Felix Shell service is not installed");
|
||||
}
|
||||
|
||||
private ShellService getShellService() {
|
||||
//bundle can be de-activated, so keeping a reference aorund is not a good idea
|
||||
DefaultBundleAccessor bundleAcessor = DefaultBundleAccessor.getInstance();
|
||||
ServiceReference ref = bundleAcessor.getServiceReference(ShellService.class.getName());
|
||||
return (ShellService) bundleAcessor.getService(ref);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
Copyright (c) 2009 Paul Bakaus, http://jqueryui.com/
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
|
||||
contribution history, see the revision history and logs, available
|
||||
at http://jquery-ui.googlecode.com/svn/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,174 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
@@ -1,8 +0,0 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2007 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
The binary distributions includes the following third party software:
|
||||
JQuery (http://jquery.com/).
|
||||
@@ -1 +0,0 @@
|
||||
${output!}
|
||||
@@ -1,62 +0,0 @@
|
||||
<!--
|
||||
/*
|
||||
* $Id: webconsole.html 590812 2007-10-31 20:32:54Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>OSGi Console</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/shell.css" />" />
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/main.css" />" />
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/redmond/jquery-ui-1.7.1.custom.css" />" />
|
||||
|
||||
<script src="<@s.url value="/static/js/shell.js" />"></script>
|
||||
<script src="<@s.url value="/static/js/jquery-1.3.2.min.js" />"></script>
|
||||
<script src="<@s.url value="/static/js/jquery-ui-1.7.1.custom.min.js" />"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="menu">
|
||||
<div style="float:right;">
|
||||
<@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
|
||||
<@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
|
||||
<a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-bullet"></span>
|
||||
Bundles
|
||||
</a>
|
||||
<a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-transferthick-e-w"></span>
|
||||
OSGi Shell
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="shell" >
|
||||
<form onsubmit="return false" id="wc-form">
|
||||
<div class="wc-results" id="wc-result">
|
||||
Welcome to the OSGi console! Type 'help' to see the list of available commands.
|
||||
<br />
|
||||
</div>
|
||||
<@s.url var="execUrl" namespace="/osgi/admin" action="execCommand" />
|
||||
<label for"command">Command:</label>
|
||||
<input name="command" onkeyup="keyEvent(event, '${execUrl}')" class="wc-command" id="wc-command" type="text" />
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,147 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>${bundle.symbolicName!}</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/main.css" />" />
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/redmond/jquery-ui-1.7.1.custom.css" />" />
|
||||
|
||||
<script src="<@s.url value="/static/js/jquery-1.3.2.min.js" />"></script>
|
||||
<script src="<@s.url value="/static/js/jquery-ui-1.7.1.custom.min.js" />"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#tabs").tabs();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="menu">
|
||||
<div style="float:left;">
|
||||
<#if action.isAllowedAction(bundle, "start")>
|
||||
<a href="bundle_${bundle.symbolicName}!start.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-play"></span>
|
||||
Start
|
||||
</a>
|
||||
</#if>
|
||||
|
||||
<#if action.isAllowedAction(bundle, "stop")>
|
||||
<a href="bundle_${bundle.symbolicName}!stop.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-stop"></span>
|
||||
Stop
|
||||
</a>
|
||||
</#if>
|
||||
|
||||
<#if action.isAllowedAction(bundle, "update")>
|
||||
<a href="bundle_${bundle.symbolicName}!update.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-refresh"></span>
|
||||
Update
|
||||
</a>
|
||||
</#if>
|
||||
</div>
|
||||
|
||||
<div style="float:right;">
|
||||
<@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
|
||||
<@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
|
||||
<a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-bullet"></span>
|
||||
Bundles
|
||||
</a>
|
||||
<a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-transferthick-e-w"></span>
|
||||
OSGi Shell
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<@s.actionerror />
|
||||
|
||||
<div id="tabs" class="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">OSGi Metadata</a></li>
|
||||
<li><a href="#tabs-2">Resgistered Services</a></li>
|
||||
<li><a href="#tabs-3">Services in Use</a></li>
|
||||
<li><a href="#tabs-4">Packages</a></li>
|
||||
<li><a href="#tabs-5">Headers</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<table class="properties">
|
||||
<tr>
|
||||
<td class="name">Id</td>
|
||||
<td>${bundle.bundleId!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name">Name</td>
|
||||
<td>${bundle.symbolicName!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name">Location</td>
|
||||
<td>${bundle.location!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name">Status</td>
|
||||
<td>${action.getBundleState(bundle)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
<#list (bundle.registeredServices)! as service>
|
||||
<table class="properties">
|
||||
<#list (service.propertyKeys)! as key >
|
||||
<tr>
|
||||
<td class="name">${key}</td>
|
||||
<td>${action.displayProperty(service.getProperty(key))}</td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
<br/>
|
||||
</#list>
|
||||
</div>
|
||||
<div id="tabs-3">
|
||||
<#list (bundle.servicesInUse)! as service>
|
||||
<table class="properties">
|
||||
<#list (service.propertyKeys)! as key >
|
||||
<tr>
|
||||
<td class="name">${key}</td>
|
||||
<td>${action.displayProperty(service.getProperty(key))!}</td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
<br/>
|
||||
</#list>
|
||||
</div>
|
||||
<div id="tabs-4">
|
||||
<#list packages! as pkg>
|
||||
<table class="properties">
|
||||
<tr>
|
||||
<td class="name">Name</td>
|
||||
<td>${pkg.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name">Actions</td>
|
||||
<td>
|
||||
<ul>
|
||||
<#list (pkg.actionConfigs.keySet())! as name >
|
||||
<li>${name}</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
</#list>
|
||||
</div>
|
||||
<div id="tabs-5">
|
||||
<table class="properties">
|
||||
<#list headerKeys as header>
|
||||
<tr>
|
||||
<td class="name">${header}</td>
|
||||
<td><div class="propertyValue">${bundle.headers.get(header)}</div> </td>
|
||||
</tr>
|
||||
</#list>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,71 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>OSGi Bundles</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/main.css" />" />
|
||||
<link rel="stylesheet" type="text/css" href="<@s.url value="/static/css/redmond/jquery-ui-1.7.1.custom.css" />" />
|
||||
|
||||
<script src="<@s.url value="/static/js/jquery-1.3.2.min.js" />"></script>
|
||||
<script src="<@s.url value="/static/js/jquery-ui-1.7.1.custom.min.js" />"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="menu">
|
||||
<div style="float:right;">
|
||||
<@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
|
||||
<@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
|
||||
<a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-bullet"></span>
|
||||
Bundles
|
||||
</a>
|
||||
<a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-transferthick-e-w"></span>
|
||||
OSGi Shell
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="properties" style="clear:both; width:700px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Struts Bundle</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<#list bundles as bundle>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="bundle_${bundle.symbolicName}!view.action">${bundle.symbolicName}</a>
|
||||
</td>
|
||||
<td>${action.getBundleState(bundle)}</td>
|
||||
<td>${action.isStrutsEnabled(bundle)?string("yes", "no")}</td>
|
||||
<td style="width:200px">
|
||||
<#if action.isAllowedAction(bundle, "start")>
|
||||
<a href="bundle_${bundle.symbolicName}!start.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-play"></span>
|
||||
Start
|
||||
</a>
|
||||
</#if>
|
||||
|
||||
<#if action.isAllowedAction(bundle, "stop")>
|
||||
<a href="bundle_${bundle.symbolicName}!stop.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-stop"></span>
|
||||
Stop
|
||||
</a>
|
||||
</#if>
|
||||
|
||||
<#if action.isAllowedAction(bundle, "update")>
|
||||
<a href="bundle_${bundle.symbolicName}!update.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
|
||||
<span class="ui-icon ui-icon-refresh"></span>
|
||||
Update
|
||||
</a>
|
||||
</#if>
|
||||
</td>
|
||||
</tr>
|
||||
</#list>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,103 +0,0 @@
|
||||
.right {
|
||||
clear: both;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.left {
|
||||
clear: both;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.bundleDetails td {
|
||||
border: 1px solid #C8C8C8;
|
||||
}
|
||||
|
||||
.rowTitle {
|
||||
width: 141px;
|
||||
font-weight: bold;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.properties {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: #3366CC;
|
||||
}
|
||||
|
||||
table.properties td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: #3366CC;
|
||||
}
|
||||
|
||||
table.properties td.name {
|
||||
background-color: #C3D9FF;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.properties th {
|
||||
background-color: #C3D9FF;
|
||||
}
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
.fg-button {
|
||||
outline: 0;
|
||||
margin: 0 4px 0 0;
|
||||
padding: .4em 1em;
|
||||
text-decoration: none !important;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.fg-button .ui-icon {
|
||||
margin-left: -3px;
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.fg-button-small {
|
||||
outline: 0;
|
||||
margin: 0 4px 0 0;
|
||||
padding: 0em 1em;
|
||||
text-decoration: none !important;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fg-button-small .ui-icon {
|
||||
margin-left: -3px;
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.fg-button-icon-left .ui-icon {
|
||||
left: 0em;
|
||||
margin-left: 0;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.menu {
|
||||
clear: both;
|
||||
padding-bottom: 10px;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.propertyValue {
|
||||
width: 600px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 180 B |
|
Before Width: | Height: | Size: 182 B |
|
Before Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
@@ -1,404 +0,0 @@
|
||||
/*
|
||||
* jQuery UI CSS Framework
|
||||
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
||||
*/
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
||||
.ui-helper-clearfix { display: inline-block; }
|
||||
/* required comment for clearfix to work in Opera \*/
|
||||
* html .ui-helper-clearfix { height:1%; }
|
||||
.ui-helper-clearfix { display:block; }
|
||||
/* end clearfix */
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
|
||||
/*
|
||||
* jQuery UI CSS Framework
|
||||
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }
|
||||
.ui-widget-content a { color: #222222; }
|
||||
.ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
|
||||
.ui-widget-header a { color: #ffffff; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; outline: none; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; outline: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; outline: none; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; outline: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; outline: none; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; outline: none; text-decoration: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); }
|
||||
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); }
|
||||
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }
|
||||
.ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); }
|
||||
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); }
|
||||
.ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); }
|
||||
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
||||
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-off { background-position: -96px -144px; }
|
||||
.ui-icon-radio-on { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; }
|
||||
.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
|
||||
.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
|
||||
.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
|
||||
.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
|
||||
.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
|
||||
.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
|
||||
.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
|
||||
.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Accordion
|
||||
----------------------------------*/
|
||||
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-li-fix { display: inline; }
|
||||
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
|
||||
.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker
|
||||
----------------------------------*/
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
display: none; /*sorry for IE5*/
|
||||
display/**/: block; /*sorry for IE5*/
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}/* Dialog
|
||||
----------------------------------*/
|
||||
.ui-dialog { position: relative; padding: .2em; width: 300px; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
/* Progressbar
|
||||
----------------------------------*/
|
||||
.ui-progressbar { height:2em; text-align: left; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
|
||||
----------------------------------*/
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
|
||||
----------------------------------*/
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
|
||||
----------------------------------*/
|
||||
.ui-tabs { padding: .2em; zoom: 1; }
|
||||
.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
|
||||
.ui-tabs .ui-tabs-hide { display: none !important; }
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* $Id: webconsole.css 590812 2007-10-31 20:32:54Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
#shell {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wc-results {
|
||||
overflow: auto;
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
font-family: courier;
|
||||
color: white;
|
||||
background-color: black;
|
||||
height: 400px;
|
||||
}
|
||||
.wc-results pre {
|
||||
display: inline;
|
||||
}
|
||||
.wc-command {
|
||||
margin: 0px;
|
||||
font-family: courier;
|
||||
color: white;
|
||||
background-color: black;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* $Id: webconsole.js 590812 2007-10-31 20:32:54Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
function printResult(result_string)
|
||||
{
|
||||
var result_div = $('#wc-result')[0];
|
||||
var result_array = result_string.split('\n');
|
||||
|
||||
var new_command = $('#wc-command').val();
|
||||
result_div.appendChild(document.createTextNode('$ ' + new_command));
|
||||
result_div.appendChild(document.createElement('br'));
|
||||
|
||||
for (var line_index in result_array) {
|
||||
var result_wrap = document.createElement('pre')
|
||||
line = document.createTextNode(result_array[line_index]);
|
||||
result_wrap.appendChild(line);
|
||||
result_div.appendChild(result_wrap);
|
||||
result_div.appendChild(document.createElement('br'));
|
||||
|
||||
}
|
||||
|
||||
result_div.scrollTop = result_div.scrollHeight;
|
||||
$('#wc-command').val('');
|
||||
}
|
||||
|
||||
function keyEvent(event, url)
|
||||
{
|
||||
switch(event.keyCode){
|
||||
case 13:
|
||||
var the_shell_command = $('#wc-command').val();
|
||||
if (the_shell_command) {
|
||||
commands_history[commands_history.length] = the_shell_command;
|
||||
history_pointer = commands_history.length;
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: $("#wc-command").serialize(),
|
||||
success: function (data, textStatus) {
|
||||
printResult(data);
|
||||
},
|
||||
error: function (request, textStatus) {
|
||||
printResult(textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 38: // this is the arrow up
|
||||
if (history_pointer > 0) {
|
||||
history_pointer--;
|
||||
$('#wc-command').val(commands_history[history_pointer]);
|
||||
}
|
||||
break;
|
||||
case 40: // this is the arrow down
|
||||
if (history_pointer < commands_history.length - 1 ) {
|
||||
history_pointer++;
|
||||
$('#wc-command').val(commands_history[history_pointer]);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var commands_history = new Array();
|
||||
var history_pointer;
|
||||
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
~ $Id$
|
||||
~
|
||||
~ Licensed to the Apache Software Foundation (ASF) under one
|
||||
~ or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. The ASF licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="bundle-admin" namespace="/osgi/admin" extends="struts-default">
|
||||
<default-action-ref name="bundles" />
|
||||
|
||||
<action name="bundle_*!*" class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="{2}">
|
||||
<param name="id">{1}</param>
|
||||
<result type="freemarker">viewBundle.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="bundles" class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="index">
|
||||
<result type="freemarker">viewBundles.ftl</result>
|
||||
</action>
|
||||
|
||||
|
||||
<action name="execCommand" class="org.apache.struts2.osgi.admin.actions.ShellAction">
|
||||
<result type="freemarker">commandResult.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="shell">
|
||||
<result type="freemarker">shell.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,78 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-demo-bundle</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>Struts 2 OSGi Demo Bundle</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<version>1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>velocity-tools</groupId>
|
||||
<artifactId>velocity-tools</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-digester</groupId>
|
||||
<artifactId>commons-digester</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-convention-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<version>2.0.0</version>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<manifestLocation>META-INF</manifestLocation>
|
||||
<Import-Package>*,com.opensymphony.xwork2</Import-Package>
|
||||
<Spring-Context>*;create-asynchronously:=false</Spring-Context>
|
||||
<Struts2-Enabled>true</Struts2-Enabled>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package actions.osgi;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.apache.struts2.osgi.interceptor.BundleContextAware;
|
||||
import org.apache.struts2.osgi.interceptor.ServiceAware;
|
||||
import org.apache.struts2.convention.annotation.ResultPath;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
/**
|
||||
* This action shows how to interact with the OSGi container, using the OSGi interceptor
|
||||
*/
|
||||
@ResultPath("/content")
|
||||
public class BundlesAction extends ActionSupport implements BundleContextAware {
|
||||
private BundleContext bundleContext;
|
||||
|
||||
public void setBundleContext(BundleContext bundleContext) {
|
||||
this.bundleContext = bundleContext;
|
||||
}
|
||||
|
||||
public Bundle[] getBundles() {
|
||||
return bundleContext.getBundles();
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package actions.osgi;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import org.apache.struts2.convention.annotation.Action;
|
||||
import org.apache.struts2.convention.annotation.ResultPath;
|
||||
import org.apache.struts2.osgi.interceptor.BundleContextAware;
|
||||
import org.apache.struts2.osgi.interceptor.ServiceAware;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ResultPath("/content")
|
||||
public class HelloWorldAction extends ActionSupport {
|
||||
private Message message;
|
||||
|
||||
@Action("hello-convention")
|
||||
public String execute() {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
public Message getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(Message message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getSimpleMessage() {
|
||||
return "Hello!!!";
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("{message:");
|
||||
sb.append(message != null ? message.getText() : "null");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package actions.osgi;
|
||||
|
||||
public class Message {
|
||||
private String text;
|
||||
|
||||
public Message(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
|
||||
|
||||
<bean class="actions.osgi.Message" id="message">
|
||||
<constructor-arg type="java.lang.String" value="Welcome to the OSGi plugin. You can checkout any time you like, but can never leave"/>
|
||||
</bean>
|
||||
|
||||
<bean class="actions.osgi.HelloWorldAction" id="helloWorldAction" scope="prototype">
|
||||
<property name="message" ref="message" />
|
||||
</bean>
|
||||
</beans>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>OSGi integration</title>
|
||||
</head>
|
||||
<body>
|
||||
This action was mapped by <b>Convention</b>, and shows how to get access to the <b>BundleContext</b>
|
||||
and registered services
|
||||
<br />
|
||||
Spring Application Contexts: ${applicationContextsCount!}
|
||||
<br>
|
||||
Bundles List:
|
||||
<ul>
|
||||
<#list bundles as bundle>
|
||||
<li>${bundle.symbolicName!}</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Action mapped by the Convention plugin</title>
|
||||
</head>
|
||||
<body>
|
||||
This is an action mapped by the Convention plugin, using a FreeMarker result.
|
||||
<br />
|
||||
Message from Action: ${simpleMessage}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Action mapped by the XML configurationn</title>
|
||||
</head>
|
||||
<body>
|
||||
This is an action mapped by XML configuration, using a <b>FreeMarker</b> result.
|
||||
<br />
|
||||
Message from Action: ${message.text}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Action mapped by the XML configurationn</title>
|
||||
</head>
|
||||
<body>
|
||||
This is an action mapped by XML configuration, using a <b>Velocity</b> result.
|
||||
<br />
|
||||
Message from Action: $message.text
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,14 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>OSGi Demo Bundle</title>
|
||||
</head>
|
||||
<body>
|
||||
This demo contains actions that will be packaged into an OSGi bundle and loaded by the Struts 2 OSGi plugin.
|
||||
<br />
|
||||
<ul>
|
||||
<li><@s.a namespace="/osgi" action="hello-convention">Action mapped by the Convention plugin, with FreeMarker result</@s.a></li>
|
||||
<li><@s.a namespace="/osgi" action="hello-freemarker">Action mapped by XML, with FreeMarker result</@s.a></li>
|
||||
<li><@s.a namespace="/osgi" action="hello-velocity">Action mapped by XML, with Velocity result</@s.a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="bundle-demo" namespace="/osgi" extends="osgi-default">
|
||||
<default-action-ref name="home" />
|
||||
<action name="hello-velocity" class="helloWorldAction">
|
||||
<result type="velocity">/content/osgi/hello.vm</result>
|
||||
</action>
|
||||
<action name="hello-freemarker" class="helloWorldAction">
|
||||
<result type="freemarker">/content/osgi/hello.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="home">
|
||||
<result type="freemarker">/content/osgi/home.ftl</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: pom.xml 765215 2009-04-15 14:32:48Z musachy $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Struts OSGi Bundles</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
<module>admin</module>
|
||||
<module>demo</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>compile</scope>
|
||||
<version>3.8.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/**</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/main/resources/*LICENSE.txt</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.5</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
@@ -34,9 +34,9 @@
|
||||
<name>Struts 2 Core</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/core</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_5/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_5/core</url>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
@@ -55,8 +55,8 @@
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<classifier>sources</classifier>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
@@ -228,8 +228,8 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<artifactId>xwork</artifactId>
|
||||
<version>2.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--<dependency>-->
|
||||
@@ -300,8 +300,8 @@
|
||||
<!-- Mocks for unit testing (by Spring) -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${struts2.springPlatformVersion}</version>
|
||||
<artifactId>spring-mock</artifactId>
|
||||
<version>2.0.8</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -408,7 +408,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
<version>${struts2.springPlatformVersion}</version>
|
||||
<version>2.0.8</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
@@ -44,9 +44,6 @@ public final class StrutsConstants {
|
||||
/** The URL extension to use to determine if the request is meant for a Struts action */
|
||||
public static final String STRUTS_ACTION_EXTENSION = "struts.action.extension";
|
||||
|
||||
/** Comma separated list of patterns (java.util.regex.Pattern) to be excluded from Struts2-processing */
|
||||
public static final String STRUTS_ACTION_EXCLUDE_PATTERN = "struts.action.excludePattern";
|
||||
|
||||
/** Whether to use the alterative syntax for the tags or not */
|
||||
public static final String STRUTS_TAG_ALTSYNTAX = "struts.tag.altSyntax";
|
||||
|
||||
@@ -115,11 +112,6 @@ public final class StrutsConstants {
|
||||
/** The directory to use for storing uploaded files */
|
||||
public static final String STRUTS_MULTIPART_SAVEDIR = "struts.multipart.saveDir";
|
||||
|
||||
/**
|
||||
* The name of the bean that will handle multipart requests
|
||||
*/
|
||||
public static final String STRUTS_MULTIPART_HANDLER = "struts.multipart.handler";
|
||||
|
||||
/**
|
||||
* The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation
|
||||
* for a multipart request (file upload)
|
||||
@@ -203,10 +195,4 @@ public final class StrutsConstants {
|
||||
|
||||
/** The {@link com.opensymphony.xwork2.UnknownHandlerManager} implementation class */
|
||||
public static final String STRUTS_UNKNOWN_HANDLER_MANAGER = "struts.unknownHandlerManager";
|
||||
|
||||
/** Throw RuntimeException when a property is not found, or the evaluation of the espression fails*/
|
||||
public static final String STRUTS_EL_THROW_EXCEPTION = "struts.el.throwExceptionOnFailure";
|
||||
|
||||
/** Logs properties that are not found (very verbose) **/
|
||||
public static final String STRUTS_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ public class ActionComponent extends ContextBean {
|
||||
protected ValueStackFactory valueStackFactory;
|
||||
protected ActionProxyFactory actionProxyFactory;
|
||||
protected ActionProxy proxy;
|
||||
protected ActionMapper actionMapper;
|
||||
protected String name;
|
||||
protected String namespace;
|
||||
protected boolean executeResult;
|
||||
|
||||
@@ -21,31 +21,22 @@
|
||||
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.Map;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p/>
|
||||
* A tag that creates a HTML <a >.This tag supports the same attributes as the "url" tag,
|
||||
* including nested parameters using the "param" tag.<p/>
|
||||
*
|
||||
* A tag that creates a HTML <a >.<p/>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
* <p/>
|
||||
*
|
||||
* <p/> <b>Examples</b>
|
||||
* <p/>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <s:a id="link1" theme="ajax" href="/DoIt.action">
|
||||
@@ -54,32 +45,22 @@ import java.util.LinkedHashMap;
|
||||
* </s:a>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@StrutsTag(
|
||||
name = "a",
|
||||
tldTagClass = "org.apache.struts2.views.jsp.ui.AnchorTag",
|
||||
description = "Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets",
|
||||
allowDynamicAttributes = true)
|
||||
name="a",
|
||||
tldTagClass="org.apache.struts2.views.jsp.ui.AnchorTag",
|
||||
description="Render a HTML href element that when clicked can optionally call a URL via remote XMLHttpRequest and updates its targets",
|
||||
allowDynamicAttributes=true)
|
||||
public class Anchor extends ClosingUIBean {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(Anchor.class);
|
||||
|
||||
public static final String OPEN_TEMPLATE = "a";
|
||||
public static final String TEMPLATE = "a-close";
|
||||
public static final String COMPONENT_NAME = Anchor.class.getName();
|
||||
|
||||
protected String href;
|
||||
protected UrlProvider urlProvider;
|
||||
protected UrlRenderer urlRenderer;
|
||||
protected boolean processingTagBody = false;
|
||||
|
||||
//these params are passed by the Param tag
|
||||
protected Map urlParameters = new LinkedHashMap();
|
||||
|
||||
public Anchor(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
urlProvider = new ComponentUrlProvider(this, this.urlParameters);
|
||||
urlProvider.setHttpServletRequest(request);
|
||||
urlProvider.setHttpServletResponse(response);
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
@@ -89,172 +70,16 @@ public class Anchor extends ClosingUIBean {
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public boolean usesBody() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void evaluateExtraParams() {
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (href != null)
|
||||
addParameter("href", ensureAttributeSafelyNotEscaped(findString(href)));
|
||||
else {
|
||||
//no href, build it from URL attributes
|
||||
StringWriter sw = new StringWriter();
|
||||
urlRenderer.beforeRenderUrl(urlProvider);
|
||||
urlRenderer.renderUrl(sw, urlProvider);
|
||||
String builtHref = sw.toString();
|
||||
if (StringUtils.isNotEmpty(builtHref))
|
||||
addParameter("href", ensureAttributeSafelyNotEscaped(builtHref));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_URL_INCLUDEPARAMS)
|
||||
public void setUrlIncludeParams(String urlIncludeParams) {
|
||||
urlProvider.setUrlIncludeParams(urlIncludeParams);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setUrlRenderer(UrlRenderer urlRenderer) {
|
||||
urlProvider.setUrlRenderer(urlRenderer);
|
||||
this.urlRenderer = urlRenderer;
|
||||
}
|
||||
|
||||
@Inject(required=false)
|
||||
public void setExtraParameterProvider(ExtraParameterProvider provider) {
|
||||
urlProvider.setExtraParameterProvider(provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean start(Writer writer) {
|
||||
boolean result = super.start(writer);
|
||||
this.processingTagBody = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides to be able to render body in a template rather than always before the template
|
||||
*/
|
||||
public boolean end(Writer writer, String body) {
|
||||
this.processingTagBody = false;
|
||||
evaluateParams();
|
||||
try {
|
||||
addParameter("body", body);
|
||||
mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
|
||||
} catch (Exception e) {
|
||||
LOG.error("error when rendering", e);
|
||||
}
|
||||
finally {
|
||||
popComponentStack();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void addParameter(String key, Object value) {
|
||||
/*
|
||||
the parameters added by this method are used in the template. this method is also
|
||||
called by Param to add params into ancestestor. This tag needs to keep both set of parameters
|
||||
separated (You gotta keep 'em separated!)
|
||||
*/
|
||||
if (processingTagBody) {
|
||||
this.urlParameters.put(key, value);
|
||||
} else
|
||||
super.addParameter(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllParameters(Map params) {
|
||||
/*
|
||||
the parameters added by this method are used in the template. this method is also
|
||||
called by Param to add params into ancestestor. This tag needs to keep both set of parameters
|
||||
separated (You gotta keep 'em separated!)
|
||||
*/
|
||||
if (processingTagBody) {
|
||||
this.urlParameters.putAll(params);
|
||||
} else
|
||||
super.addAllParameters(params);
|
||||
}
|
||||
|
||||
public UrlProvider getUrlProvider() {
|
||||
return urlProvider;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The URL.")
|
||||
@StrutsTagAttribute(description="The URL.")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The includeParams attribute may have the value 'none', 'get' or 'all'", defaultValue = "none")
|
||||
public void setIncludeParams(String includeParams) {
|
||||
urlProvider.setIncludeParams(includeParams);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Set scheme attribute")
|
||||
public void setScheme(String scheme) {
|
||||
urlProvider.setScheme(scheme);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The target value to use, if not using action")
|
||||
public void setValue(String value) {
|
||||
urlProvider.setValue(value);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The action to generate the URL for, if not using value")
|
||||
public void setAction(String action) {
|
||||
urlProvider.setAction(action);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The namespace to use")
|
||||
public void setNamespace(String namespace) {
|
||||
urlProvider.setNamespace(namespace);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The method of action to use")
|
||||
public void setMethod(String method) {
|
||||
urlProvider.setMethod(method);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Whether to encode parameters", type = "Boolean", defaultValue = "true")
|
||||
public void setEncode(boolean encode) {
|
||||
urlProvider.setEncode(encode);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Whether actual context should be included in URL", type = "Boolean", defaultValue = "true")
|
||||
public void setIncludeContext(boolean includeContext) {
|
||||
urlProvider.setIncludeContext(includeContext);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The resulting portlet mode")
|
||||
public void setPortletMode(String portletMode) {
|
||||
urlProvider.setPortletMode(portletMode);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The resulting portlet window state")
|
||||
public void setWindowState(String windowState) {
|
||||
urlProvider.setWindowState(windowState);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Specifies if this should be a portlet render or action URL. Default is \"render\". To create an action URL, use \"action\".")
|
||||
public void setPortletUrlType(String portletUrlType) {
|
||||
urlProvider.setPortletUrlType(portletUrlType);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "The anchor for this URL")
|
||||
public void setAnchor(String anchor) {
|
||||
urlProvider.setAnchor(anchor);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Specifies whether to escape ampersand (&) to (&amp;) or not", type = "Boolean", defaultValue = "true")
|
||||
public void setEscapeAmp(boolean escapeAmp) {
|
||||
urlProvider.setEscapeAmp(escapeAmp);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Specifies whether to force the addition of scheme, host and port or not", type = "Boolean", defaultValue = "false")
|
||||
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
|
||||
urlProvider.setForceAddSchemeHostAndPort(forceAddSchemeHostAndPort);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
|
||||
@StrutsTag(name="bean", tldTagClass="org.apache.struts2.views.jsp.BeanTag",
|
||||
description="Instantiate a JavaBean and place it in the context")
|
||||
public class Bean extends ContextBean {
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(Bean.class);
|
||||
protected static Logger LOG = LoggerFactory.getLogger(Bean.class);
|
||||
|
||||
protected Object bean;
|
||||
protected String name;
|
||||
|
||||
@@ -33,7 +33,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.util.FastByteArrayOutputStream;
|
||||
@@ -57,7 +56,6 @@ public class Component {
|
||||
protected ValueStack stack;
|
||||
protected Map parameters;
|
||||
protected ActionMapper actionMapper;
|
||||
protected boolean throwExceptionOnELFailure;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -86,11 +84,6 @@ public class Component {
|
||||
public void setActionMapper(ActionMapper mapper) {
|
||||
this.actionMapper = mapper;
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_EL_THROW_EXCEPTION)
|
||||
public void setThrowExceptionsOnELFailure(String throwException) {
|
||||
this.throwExceptionOnELFailure = "true".equals(throwException);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the OGNL value stack assoicated with this component.
|
||||
@@ -252,7 +245,7 @@ public class Component {
|
||||
|
||||
expr = stripExpressionIfAltSyntax(expr);
|
||||
|
||||
return getStack().findValue(expr, throwExceptionOnELFailure);
|
||||
return getStack().findValue(expr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,7 +372,7 @@ public class Component {
|
||||
} else {
|
||||
expr = stripExpressionIfAltSyntax(expr);
|
||||
|
||||
return getStack().findValue(expr, toType, throwExceptionOnELFailure);
|
||||
return getStack().findValue(expr, toType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +396,7 @@ public class Component {
|
||||
boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort,
|
||||
boolean escapeAmp) {
|
||||
String finalAction = findString(action);
|
||||
String finalMethod = method != null ? findString(method) : null;
|
||||
String finalMethod = method != null ? findString(method) : method;
|
||||
String finalNamespace = determineNamespace(namespace, getStack(), req);
|
||||
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, finalMethod, parameters);
|
||||
String uri = actionMapper.getUriFromActionMapping(mapping);
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Default implementation of UrlProvider
|
||||
*/
|
||||
public class ComponentUrlProvider implements UrlProvider {
|
||||
protected HttpServletRequest httpServletRequest;
|
||||
protected HttpServletResponse httpServletResponse;
|
||||
|
||||
protected String includeParams;
|
||||
protected String scheme;
|
||||
protected String value;
|
||||
protected String action;
|
||||
protected String namespace;
|
||||
protected String method;
|
||||
protected boolean encode = true;
|
||||
protected boolean includeContext = true;
|
||||
protected boolean escapeAmp = true;
|
||||
protected String portletMode;
|
||||
protected String windowState;
|
||||
protected String portletUrlType;
|
||||
protected String anchor;
|
||||
protected boolean forceAddSchemeHostAndPort;
|
||||
protected String urlIncludeParams;
|
||||
protected ExtraParameterProvider extraParameterProvider;
|
||||
protected UrlRenderer urlRenderer;
|
||||
|
||||
protected Component component;
|
||||
private Map parameters;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param component The component used to delagete some calls to
|
||||
* @param parameters parameters passed from <param...>
|
||||
*/
|
||||
public ComponentUrlProvider(Component component, Map parameters) {
|
||||
this.component = component;
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
||||
public String determineActionURL(String action, String namespace, String method, HttpServletRequest req, HttpServletResponse res, Map parameters, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp) {
|
||||
return component.determineActionURL(action, namespace, method, req, res, parameters, scheme, includeContext, encodeResult, forceAddSchemeHostAndPort, escapeAmp);
|
||||
}
|
||||
|
||||
public String determineNamespace(String namespace, ValueStack stack, HttpServletRequest req) {
|
||||
return component.determineNamespace(namespace, stack, req);
|
||||
}
|
||||
|
||||
public String findString(String expr) {
|
||||
return component.findString(expr);
|
||||
}
|
||||
|
||||
public Map getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public HttpServletRequest getHttpServletRequest() {
|
||||
return httpServletRequest;
|
||||
}
|
||||
|
||||
public void setHttpServletRequest(HttpServletRequest httpServletRequest) {
|
||||
this.httpServletRequest = httpServletRequest;
|
||||
}
|
||||
|
||||
public HttpServletResponse getHttpServletResponse() {
|
||||
return httpServletResponse;
|
||||
}
|
||||
|
||||
public void setHttpServletResponse(HttpServletResponse httpServletResponse) {
|
||||
this.httpServletResponse = httpServletResponse;
|
||||
}
|
||||
|
||||
public String getIncludeParams() {
|
||||
return includeParams;
|
||||
}
|
||||
|
||||
public void setIncludeParams(String includeParams) {
|
||||
this.includeParams = includeParams;
|
||||
}
|
||||
|
||||
public String getScheme() {
|
||||
return scheme;
|
||||
}
|
||||
|
||||
public void setScheme(String scheme) {
|
||||
this.scheme = scheme;
|
||||
}
|
||||
|
||||
public boolean isPutInContext() {
|
||||
return component instanceof ContextBean;
|
||||
}
|
||||
|
||||
public String getVar() {
|
||||
return isPutInContext() ? ((ContextBean)component).getVar() : null;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public String getNamespace() {
|
||||
return namespace;
|
||||
}
|
||||
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public boolean isEncode() {
|
||||
return encode;
|
||||
}
|
||||
|
||||
public void setEncode(boolean encode) {
|
||||
this.encode = encode;
|
||||
}
|
||||
|
||||
public boolean isIncludeContext() {
|
||||
return includeContext;
|
||||
}
|
||||
|
||||
public void setIncludeContext(boolean includeContext) {
|
||||
this.includeContext = includeContext;
|
||||
}
|
||||
|
||||
public boolean isEscapeAmp() {
|
||||
return escapeAmp;
|
||||
}
|
||||
|
||||
public void setEscapeAmp(boolean escapeAmp) {
|
||||
this.escapeAmp = escapeAmp;
|
||||
}
|
||||
|
||||
public String getPortletMode() {
|
||||
return portletMode;
|
||||
}
|
||||
|
||||
public void setPortletMode(String portletMode) {
|
||||
this.portletMode = portletMode;
|
||||
}
|
||||
|
||||
public String getWindowState() {
|
||||
return windowState;
|
||||
}
|
||||
|
||||
public void setWindowState(String windowState) {
|
||||
this.windowState = windowState;
|
||||
}
|
||||
|
||||
public String getPortletUrlType() {
|
||||
return portletUrlType;
|
||||
}
|
||||
|
||||
public ValueStack getStack() {
|
||||
return component.getStack();
|
||||
}
|
||||
|
||||
public void setPortletUrlType(String portletUrlType) {
|
||||
this.portletUrlType = portletUrlType;
|
||||
}
|
||||
|
||||
public String getAnchor() {
|
||||
return anchor;
|
||||
}
|
||||
|
||||
public void setAnchor(String anchor) {
|
||||
this.anchor = anchor;
|
||||
}
|
||||
|
||||
public boolean isForceAddSchemeHostAndPort() {
|
||||
return forceAddSchemeHostAndPort;
|
||||
}
|
||||
|
||||
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
|
||||
this.forceAddSchemeHostAndPort = forceAddSchemeHostAndPort;
|
||||
}
|
||||
|
||||
public void putInContext(String result) {
|
||||
if (isPutInContext()) {
|
||||
((ContextBean)component).putInContext(result);
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrlIncludeParams() {
|
||||
return urlIncludeParams;
|
||||
}
|
||||
|
||||
public void setUrlIncludeParams(String urlIncludeParams) {
|
||||
this.urlIncludeParams = urlIncludeParams;
|
||||
}
|
||||
|
||||
public ExtraParameterProvider getExtraParameterProvider() {
|
||||
return extraParameterProvider;
|
||||
}
|
||||
|
||||
public void setExtraParameterProvider(ExtraParameterProvider extraParameterProvider) {
|
||||
this.extraParameterProvider = extraParameterProvider;
|
||||
}
|
||||
|
||||
public UrlRenderer getUrlRenderer() {
|
||||
return urlRenderer;
|
||||
}
|
||||
|
||||
public void setUrlRenderer(UrlRenderer urlRenderer) {
|
||||
this.urlRenderer = urlRenderer;
|
||||
}
|
||||
}
|
||||
@@ -274,6 +274,7 @@ public class Date extends ContextBean {
|
||||
|
||||
public boolean end(Writer writer, String body) {
|
||||
String msg = null;
|
||||
ValueStack stack = getStack();
|
||||
java.util.Date date = null;
|
||||
// find the name on the valueStack
|
||||
try {
|
||||
|
||||
@@ -182,7 +182,7 @@ public abstract class DoubleListUIBean extends ListUIBean {
|
||||
// this check is needed for backwards compatibility with 2.1.x
|
||||
addParameter("doubleId", findStringIfAltSyntax(doubleId));
|
||||
} else if (form != null) {
|
||||
addParameter("doubleId", form.getParameters().get("id") + "_" +escape(doubleName !=null ? findString(doubleName) : null));
|
||||
addParameter("doubleId", form.getParameters().get("id") + "_" +escape(this.doubleName));
|
||||
} else {
|
||||
addParameter("doubleId", escape(doubleName != null ? findString(doubleName) : null));
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ package org.apache.struts2.components;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -60,12 +59,8 @@ public class DoubleSelect extends DoubleListUIBean {
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
StringBuilder onchangeParam = new StringBuilder();
|
||||
onchangeParam.append(getParameters().get("id")).append("Redirect(this.options.selectedIndex)");
|
||||
if(StringUtils.isNotEmpty(this.onchange)) {
|
||||
onchangeParam.append(";").append(this.onchange);
|
||||
}
|
||||
|
||||
// force the onchange parameter
|
||||
addParameter("onchange", onchangeParam.toString());
|
||||
addParameter("onchange", getParameters().get("id") + "Redirect(this.options.selectedIndex)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ElseIf extends Component {
|
||||
if (answer.booleanValue()) {
|
||||
stack.getContext().put(If.ANSWER, answer);
|
||||
}
|
||||
return answer.booleanValue();
|
||||
return answer != null && answer.booleanValue();
|
||||
}
|
||||
|
||||
public boolean end(Writer writer, String body) {
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ExtraParameterProvider {
|
||||
public Map getExtraParameters();
|
||||
}
|
||||
@@ -36,7 +36,6 @@ import com.opensymphony.xwork2.validator.Validator;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -154,18 +153,28 @@ public class Form extends ClosingUIBean {
|
||||
*/
|
||||
protected void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
//boolean isAjax = "ajax".equalsIgnoreCase(this.theme);
|
||||
|
||||
if (validate != null) {
|
||||
addParameter("validate", findValue(validate, Boolean.class));
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
//make the name the same as the id
|
||||
String id = (String) getParameters().get("id");
|
||||
if (StringUtils.isNotEmpty(id)) {
|
||||
addParameter("name", id);
|
||||
}
|
||||
// calculate the action and namespace
|
||||
/*String action = null;
|
||||
if (this.action != null) {
|
||||
// if it isn't specified, we'll make somethig up
|
||||
action = findString(this.action);
|
||||
}
|
||||
|
||||
if (Dispatcher.getInstance().isPortletSupportActive() && PortletActionContext.isPortletRequest()) {
|
||||
evaluateExtraParamsPortletRequest(namespace, action);
|
||||
} else {
|
||||
String namespace = determineNamespace(this.namespace, getStack(),
|
||||
request);
|
||||
evaluateExtraParamsServletRequest(action, namespace, isAjax);
|
||||
}*/
|
||||
|
||||
if (onsubmit != null) {
|
||||
addParameter("onsubmit", findString(onsubmit));
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public abstract class FormButton extends ClosingUIBean {
|
||||
protected String method;
|
||||
protected String align;
|
||||
protected String type;
|
||||
protected ActionMapper actionMapper;
|
||||
|
||||
public FormButton(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
|
||||
@@ -23,8 +23,6 @@ package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
@@ -32,8 +30,6 @@ import org.apache.struts2.util.MakeIterator;
|
||||
import org.apache.struts2.views.jsp.IteratorStatus;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -53,13 +49,6 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
* <li>id (String) - if specified the current iteration object will be place with this id in Struts stack's context
|
||||
* scope</li>
|
||||
*
|
||||
* <li>begin (Integer) - if specified the iteration will start on that index</li>
|
||||
*
|
||||
* <li>end (Integer) - if specified the iteration will end on that index(inclusive)</li>
|
||||
*
|
||||
* <li>step (Integer) - if specified the iteration index will be increased by this value on each iteration. It can be a negative
|
||||
* value, in which case 'begin' must be greater than 'end'</li>
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
* <!-- END SNIPPET: params -->
|
||||
@@ -173,14 +162,19 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
*
|
||||
* <!-- START SNIPPET: example5description -->
|
||||
*
|
||||
* </p>A loop that iterates 5 times
|
||||
* </p>To simulate a simple loop with iterator tag, the following could be done.
|
||||
* It does the loop 5 times.
|
||||
*
|
||||
* <!-- END SNIPPET: example5description -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example5code -->
|
||||
*
|
||||
* <s:iterator var="counter" begin="1" end="5" >
|
||||
* <s:iterator status="stat" value="{1,2,3,4,5}" >
|
||||
* <!-- grab the index (start with 0 ... ) -->
|
||||
* <s:property value="#stat.index" />
|
||||
*
|
||||
* <!-- grab the top of the stack which should be the -->
|
||||
* <!-- current iteration value (1, ... 5) -->
|
||||
* <s:property value="top" />
|
||||
* </s:iterator>
|
||||
@@ -207,39 +201,15 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
* <!-- END SNIPPET: example6code -->
|
||||
* </pre>
|
||||
*
|
||||
* <!-- START SNIPPET: example7description -->
|
||||
*
|
||||
* </p>A loop that iterates over a partial list
|
||||
*
|
||||
* <!-- END SNIPPET: example7description -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example7code -->
|
||||
*
|
||||
* <s:iterator value="{1,2,3,4,5}" begin="2" end="4" >
|
||||
* <!-- current iteration value (2,3,4) -->
|
||||
* <s:property value="top" />
|
||||
* </s:iterator>
|
||||
*
|
||||
* <!-- END SNIPPET: example7code -->
|
||||
* </pre>
|
||||
*/
|
||||
@StrutsTag(name="iterator", tldTagClass="org.apache.struts2.views.jsp.IteratorTag", description="Iterate over a iterable value")
|
||||
public class IteratorComponent extends ContextBean {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(IteratorComponent.class);
|
||||
|
||||
protected Iterator iterator;
|
||||
protected IteratorStatus status;
|
||||
protected Object oldStatus;
|
||||
protected IteratorStatus.StatusState statusState;
|
||||
protected String statusAttr;
|
||||
protected String value;
|
||||
protected String beginStr;
|
||||
protected Integer begin;
|
||||
protected String endStr;
|
||||
protected Integer end;
|
||||
protected String stepStr;
|
||||
protected Integer step;
|
||||
|
||||
public IteratorComponent(ValueStack stack) {
|
||||
super(stack);
|
||||
@@ -252,50 +222,12 @@ public class IteratorComponent extends ContextBean {
|
||||
status = new IteratorStatus(statusState);
|
||||
}
|
||||
|
||||
if (beginStr != null)
|
||||
begin = (Integer) findValue(beginStr, Integer.class);
|
||||
|
||||
if (endStr != null)
|
||||
end = (Integer) findValue(endStr, Integer.class);
|
||||
|
||||
if (stepStr != null)
|
||||
step = (Integer) findValue(stepStr, Integer.class);
|
||||
|
||||
ValueStack stack = getStack();
|
||||
|
||||
if (value == null && begin == null && end == null) {
|
||||
if (value == null) {
|
||||
value = "top";
|
||||
}
|
||||
Object iteratorTarget = findValue(value);
|
||||
iterator = MakeIterator.convert(iteratorTarget);
|
||||
|
||||
if (begin != null) {
|
||||
//default step to 1
|
||||
if (step == null)
|
||||
step = 1;
|
||||
|
||||
if (iterator == null) {
|
||||
//classic for loop from 'begin' to 'end'
|
||||
iterator = new CounterIterator(begin, end, step, null);
|
||||
} else if (iterator != null) {
|
||||
//only arrays and lists are supported
|
||||
if (iteratorTarget.getClass().isArray()) {
|
||||
Object[] values = (Object[]) iteratorTarget;
|
||||
if (end == null)
|
||||
end = step > 0 ? values.length - 1 : 0;
|
||||
iterator = new CounterIterator(begin, end, step, Arrays.asList(values));
|
||||
} else if (iteratorTarget instanceof List) {
|
||||
List values = (List) iteratorTarget;
|
||||
if (end == null)
|
||||
end = step > 0 ? values.size() - 1 : 0;
|
||||
iterator = new CounterIterator(begin, end, step, values);
|
||||
} else {
|
||||
//so the iterator is not based on an array or a list
|
||||
LOG.error("Incorrect use of the iterator tag. When 'begin' is set, 'value' must be" +
|
||||
" an Array or a List, or not set at all. 'begin', 'end' and 'step' will be ignored");
|
||||
}
|
||||
}
|
||||
}
|
||||
iterator = MakeIterator.convert(findValue(value));
|
||||
|
||||
// get the first
|
||||
if ((iterator != null) && iterator.hasNext()) {
|
||||
@@ -357,44 +289,6 @@ public class IteratorComponent extends ContextBean {
|
||||
}
|
||||
}
|
||||
|
||||
class CounterIterator implements Iterator<Object> {
|
||||
private int step;
|
||||
private int end;
|
||||
private int currentIndex;
|
||||
private List<Object> values;
|
||||
|
||||
CounterIterator(Integer begin, Integer end, Integer step, List<Object> values) {
|
||||
this.end = end;
|
||||
if (step != null)
|
||||
this.step = step;
|
||||
this.currentIndex = begin - this.step;
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
int next = peekNextIndex();
|
||||
return step > 0 ? next <= end : next >= end;
|
||||
}
|
||||
|
||||
public Object next() {
|
||||
if (hasNext()) {
|
||||
int nextIndex = peekNextIndex();
|
||||
currentIndex += step;
|
||||
return value != null ? values.get(nextIndex) : nextIndex;
|
||||
} else {
|
||||
throw new IndexOutOfBoundsException("Index " + ( currentIndex + step) + " must be less than or equal to " + end);
|
||||
}
|
||||
}
|
||||
|
||||
private int peekNextIndex() {
|
||||
return currentIndex + step;
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Values cannot be removed from this iterator");
|
||||
}
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="If specified, an instanceof IteratorStatus will be pushed into stack upon each iteration",
|
||||
type="Boolean", defaultValue="false")
|
||||
public void setStatus(String status) {
|
||||
@@ -406,20 +300,4 @@ public class IteratorComponent extends ContextBean {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="if specified the iteration will start on that index", type="Integer", defaultValue="0")
|
||||
public void setBegin(String begin) {
|
||||
this.beginStr = begin;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="if specified the iteration will end on that index(inclusive)", type="Integer",
|
||||
defaultValue="Size of the 'values' List or array, or 0 if 'step' is negative")
|
||||
public void setEnd(String end) {
|
||||
this.endStr = end;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="if specified the iteration index will be increased by this value on each iteration. It can be a negative " +
|
||||
"value, in which case 'begin' must be greater than 'end'", type="Integer", defaultValue="1")
|
||||
public void setStep(String step) {
|
||||
this.stepStr = step;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,12 +84,9 @@ public class Label extends UIBean {
|
||||
if (value != null) {
|
||||
addParameter("nameValue", findString(value));
|
||||
} else if (key != null) {
|
||||
Object nameValue = parameters.get("nameValue");
|
||||
if (nameValue == null || nameValue.toString().length() == 0) {
|
||||
// get the label from a TextProvider (default value is the key)
|
||||
String providedLabel = TextProviderHelper.getText(key, key, stack);
|
||||
addParameter("nameValue", providedLabel);
|
||||
}
|
||||
// get the label from a TextProvider (default value is the key)
|
||||
String providedLabel = TextProviderHelper.getText(key, key, stack);
|
||||
addParameter("nameValue", providedLabel);
|
||||
} else if (name != null) {
|
||||
String expr = completeExpressionIfAltSyntax(name);
|
||||
addParameter("nameValue", findString(expr));
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Param extends Component {
|
||||
String name = findString(this.name);
|
||||
|
||||
if (name == null) {
|
||||
throw new StrutsException("No name found for following expression: " + this.name);
|
||||
throw new StrutsException("No name found for following expression: " + name);
|
||||
}
|
||||
|
||||
Object value = findValue(this.value);
|
||||
|
||||
@@ -26,13 +26,11 @@ import java.io.Writer;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.commons.lang.xwork.StringEscapeUtils;
|
||||
|
||||
import com.opensymphony.xwork2.util.TextUtils;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -138,7 +136,7 @@ public class Property extends Component {
|
||||
// exception: don't call findString(), since we don't want the
|
||||
// expression parsed in this one case. it really
|
||||
// doesn't make sense, in fact.
|
||||
actualValue = (String) getStack().findValue(value, String.class, throwExceptionOnELFailure);
|
||||
actualValue = (String) getStack().findValue(value, String.class);
|
||||
|
||||
try {
|
||||
if (actualValue != null) {
|
||||
@@ -156,10 +154,10 @@ public class Property extends Component {
|
||||
private String prepare(String value) {
|
||||
String result = value;
|
||||
if (escape) {
|
||||
result = StringEscapeUtils.escapeHtml(result);
|
||||
result = TextUtils.htmlEncode(result);
|
||||
}
|
||||
if (escapeJavaScript) {
|
||||
result = StringEscapeUtils.escapeJavaScript(result);
|
||||
result = TextUtils.escapeJavaScript(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
@@ -61,59 +60,44 @@ public class ServletUrlRenderer implements UrlRenderer {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void renderUrl(Writer writer, UrlProvider urlComponent) {
|
||||
String scheme = urlComponent.getHttpServletRequest().getScheme();
|
||||
public void renderUrl(Writer writer, URL urlComponent) {
|
||||
String scheme = urlComponent.req.getScheme();
|
||||
|
||||
if (urlComponent.getScheme() != null) {
|
||||
scheme = urlComponent.getScheme();
|
||||
if (urlComponent.scheme != null) {
|
||||
scheme = urlComponent.scheme;
|
||||
}
|
||||
|
||||
String result;
|
||||
ActionInvocation ai = (ActionInvocation) ActionContext.getContext().get(ActionContext.ACTION_INVOCATION);
|
||||
if (urlComponent.getValue() == null && urlComponent.getAction() != null) {
|
||||
result = urlComponent.determineActionURL(urlComponent.getAction(), urlComponent.getNamespace(), urlComponent.getMethod(), urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
|
||||
} else if (urlComponent.getValue() == null && urlComponent.getAction() == null && ai != null) {
|
||||
// both are null, we will default to the current action
|
||||
|
||||
final String action = ai.getProxy().getActionName();
|
||||
final String namespace = ai.getProxy().getNamespace();
|
||||
result = urlComponent.determineActionURL(action, namespace, urlComponent.getMethod(),urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
|
||||
if (urlComponent.value == null && urlComponent.action != null) {
|
||||
result = urlComponent.determineActionURL(urlComponent.action, urlComponent.namespace, urlComponent.method, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
|
||||
} else {
|
||||
String _value = urlComponent.getValue();
|
||||
String _value = urlComponent.value;
|
||||
|
||||
// We don't include the request parameters cause they would have been
|
||||
// prioritised before this [in start(Writer) method]
|
||||
if (_value != null && _value.indexOf("?") > 0) {
|
||||
_value = _value.substring(0, _value.indexOf("?"));
|
||||
}
|
||||
result = UrlHelper.buildUrl(_value, urlComponent.getHttpServletRequest(), urlComponent.getHttpServletResponse(), urlComponent.getParameters(), scheme, urlComponent.isIncludeContext(), urlComponent.isEncode(), urlComponent.isForceAddSchemeHostAndPort(), urlComponent.isEscapeAmp());
|
||||
result = UrlHelper.buildUrl(_value, urlComponent.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
|
||||
}
|
||||
String anchor = urlComponent.getAnchor();
|
||||
if (StringUtils.isNotEmpty(anchor)) {
|
||||
result += '#' + urlComponent.findString(anchor);
|
||||
if ( urlComponent.anchor != null && urlComponent.anchor.length() > 0 ) {
|
||||
result += '#' + urlComponent.findString(urlComponent.anchor);
|
||||
}
|
||||
|
||||
if (urlComponent.isPutInContext()) {
|
||||
String var = urlComponent.getVar();
|
||||
if (StringUtils.isNotEmpty(var)) {
|
||||
urlComponent.putInContext(result);
|
||||
String var = urlComponent.getVar();
|
||||
|
||||
// add to the request and page scopes as well
|
||||
urlComponent.getHttpServletRequest().setAttribute(var, result);
|
||||
} else {
|
||||
try {
|
||||
writer.write(result);
|
||||
} catch (IOException e) {
|
||||
throw new StrutsException("IOError: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
writer.write(result);
|
||||
} catch (IOException e) {
|
||||
throw new StrutsException("IOError: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
if (var != null) {
|
||||
urlComponent.putInContext(result);
|
||||
|
||||
// add to the request and page scopes as well
|
||||
urlComponent.req.setAttribute(var, result);
|
||||
} else {
|
||||
try {
|
||||
writer.write(result);
|
||||
} catch (IOException e) {
|
||||
throw new StrutsException("IOError: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,57 +203,57 @@ public class ServletUrlRenderer implements UrlRenderer {
|
||||
}
|
||||
|
||||
|
||||
public void beforeRenderUrl(UrlProvider urlComponent) {
|
||||
if (urlComponent.getValue() != null) {
|
||||
urlComponent.setValue(urlComponent.findString(urlComponent.getValue()));
|
||||
public void beforeRenderUrl(URL urlComponent) {
|
||||
if (urlComponent.value != null) {
|
||||
urlComponent.value = urlComponent.findString(urlComponent.value);
|
||||
}
|
||||
|
||||
// no explicit url set so attach params from current url, do
|
||||
// this at start so body params can override any of these they wish.
|
||||
try {
|
||||
// ww-1266
|
||||
String includeParams = (urlComponent.getUrlIncludeParams() != null ? urlComponent.getUrlIncludeParams().toLowerCase() : UrlProvider.GET);
|
||||
String includeParams = (urlComponent.urlIncludeParams != null ? urlComponent.urlIncludeParams.toLowerCase() : URL.GET);
|
||||
|
||||
if (urlComponent.getIncludeParams() != null) {
|
||||
includeParams = urlComponent.findString(urlComponent.getIncludeParams());
|
||||
if (urlComponent.includeParams != null) {
|
||||
includeParams = urlComponent.findString(urlComponent.includeParams);
|
||||
}
|
||||
|
||||
if (UrlProvider.NONE.equalsIgnoreCase(includeParams)) {
|
||||
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), Collections.EMPTY_MAP);
|
||||
} else if (UrlProvider.ALL.equalsIgnoreCase(includeParams)) {
|
||||
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), urlComponent.getHttpServletRequest().getParameterMap());
|
||||
if (URL.NONE.equalsIgnoreCase(includeParams)) {
|
||||
mergeRequestParameters(urlComponent.value, urlComponent.parameters, Collections.EMPTY_MAP);
|
||||
} else if (URL.ALL.equalsIgnoreCase(includeParams)) {
|
||||
mergeRequestParameters(urlComponent.value, urlComponent.parameters, urlComponent.req.getParameterMap());
|
||||
|
||||
// for ALL also include GET parameters
|
||||
includeGetParameters(urlComponent);
|
||||
includeExtraParameters(urlComponent);
|
||||
} else if (UrlProvider.GET.equalsIgnoreCase(includeParams) || (includeParams == null && urlComponent.getValue() == null && urlComponent.getAction() == null)) {
|
||||
} else if (URL.GET.equalsIgnoreCase(includeParams) || (includeParams == null && urlComponent.value == null && urlComponent.action == null)) {
|
||||
includeGetParameters(urlComponent);
|
||||
includeExtraParameters(urlComponent);
|
||||
} else if (includeParams != null) {
|
||||
LOG.warn("Unknown value for includeParams parameter to URL tag: " + includeParams);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Unable to put request parameters (" + urlComponent.getHttpServletRequest().getQueryString() + ") into parameter map.", e);
|
||||
LOG.warn("Unable to put request parameters (" + urlComponent.req.getQueryString() + ") into parameter map.", e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void includeExtraParameters(UrlProvider urlComponent) {
|
||||
if (urlComponent.getExtraParameterProvider() != null) {
|
||||
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), urlComponent.getExtraParameterProvider().getExtraParameters());
|
||||
private void includeExtraParameters(URL urlComponent) {
|
||||
if (urlComponent.extraParameterProvider != null) {
|
||||
mergeRequestParameters(urlComponent.value, urlComponent.parameters, urlComponent.extraParameterProvider.getExtraParameters());
|
||||
}
|
||||
}
|
||||
private void includeGetParameters(UrlProvider urlComponent) {
|
||||
private void includeGetParameters(URL urlComponent) {
|
||||
String query = extractQueryString(urlComponent);
|
||||
mergeRequestParameters(urlComponent.getValue(), urlComponent.getParameters(), UrlHelper.parseQueryString(query));
|
||||
mergeRequestParameters(urlComponent.value, urlComponent.parameters, UrlHelper.parseQueryString(query));
|
||||
}
|
||||
|
||||
private String extractQueryString(UrlProvider urlComponent) {
|
||||
private String extractQueryString(URL urlComponent) {
|
||||
// Parse the query string to make sure that the parameters come from the query, and not some posted data
|
||||
String query = urlComponent.getHttpServletRequest().getQueryString();
|
||||
String query = urlComponent.req.getQueryString();
|
||||
if (query == null) {
|
||||
query = (String) urlComponent.getHttpServletRequest().getAttribute("javax.servlet.forward.query_string");
|
||||
query = (String) urlComponent.req.getAttribute("javax.servlet.forward.query_string");
|
||||
}
|
||||
|
||||
if (query != null) {
|
||||
@@ -308,6 +292,8 @@ public class ServletUrlRenderer implements UrlRenderer {
|
||||
// where the parameters specified in value attribute takes priority.
|
||||
|
||||
if (value != null && value.trim().length() > 0 && value.indexOf("?") > 0) {
|
||||
mergedParams = new LinkedHashMap();
|
||||
|
||||
String queryString = value.substring(value.indexOf("?")+1);
|
||||
|
||||
mergedParams = UrlHelper.parseQueryString(queryString);
|
||||
|
||||
@@ -30,8 +30,8 @@ import java.util.List;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.util.TextProviderHelper;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import com.opensymphony.xwork2.util.TextUtils;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
@@ -151,7 +151,7 @@ public class Text extends ContextBean implements Param.UnnamedParametric {
|
||||
public boolean end(Writer writer, String body) {
|
||||
actualName = findString(name, "name", "You must specify the i18n key. Example: welcome.header");
|
||||
String defaultMessage;
|
||||
if (StringUtils.isNotEmpty(body)) {
|
||||
if (TextUtils.stringSet(body)) {
|
||||
defaultMessage = body;
|
||||
} else {
|
||||
defaultMessage = actualName;
|
||||
|
||||
@@ -859,7 +859,7 @@ public abstract class UIBean extends Component {
|
||||
protected String escape(String name) {
|
||||
// escape any possible values that can make the ID painful to work with in JavaScript
|
||||
if (name != null) {
|
||||
return name.replaceAll("[\\/\\.\\[\\]]", "_");
|
||||
return name.replaceAll("[^a-zA-Z0-9_]", "_");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -29,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -113,118 +118,144 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
@StrutsTag(name="url", tldTagClass="org.apache.struts2.views.jsp.URLTag", description="This tag is used to create a URL")
|
||||
public class URL extends ContextBean {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(URL.class);
|
||||
private UrlProvider urlProvider;
|
||||
private UrlRenderer urlRenderer;
|
||||
|
||||
/**
|
||||
* The includeParams attribute may have the value 'none', 'get' or 'all'.
|
||||
* It is used when the url tag is used without a value attribute.
|
||||
* Its value is looked up on the ValueStack
|
||||
* If no includeParams is specified then 'get' is used.
|
||||
* none - include no parameters in the URL
|
||||
* get - include only GET parameters in the URL (default)
|
||||
* all - include both GET and POST parameters in the URL
|
||||
*/
|
||||
public static final String NONE = "none";
|
||||
public static final String GET = "get";
|
||||
public static final String ALL = "all";
|
||||
|
||||
protected HttpServletRequest req;
|
||||
protected HttpServletResponse res;
|
||||
|
||||
protected String includeParams;
|
||||
protected String scheme;
|
||||
protected String value;
|
||||
protected String action;
|
||||
protected String namespace;
|
||||
protected String method;
|
||||
protected boolean encode = true;
|
||||
protected boolean includeContext = true;
|
||||
protected boolean escapeAmp = true;
|
||||
protected String portletMode;
|
||||
protected String windowState;
|
||||
protected String portletUrlType;
|
||||
protected String anchor;
|
||||
protected boolean forceAddSchemeHostAndPort;
|
||||
protected String urlIncludeParams;
|
||||
protected ExtraParameterProvider extraParameterProvider;
|
||||
protected UrlRenderer urlRenderer;
|
||||
|
||||
public URL(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack);
|
||||
urlProvider = new ComponentUrlProvider(this, this.parameters);
|
||||
urlProvider.setHttpServletRequest(req);
|
||||
urlProvider.setHttpServletResponse(res);
|
||||
this.req = req;
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_URL_INCLUDEPARAMS)
|
||||
public void setUrlIncludeParams(String urlIncludeParams) {
|
||||
urlProvider.setUrlIncludeParams(urlIncludeParams);
|
||||
this.urlIncludeParams = urlIncludeParams;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setUrlRenderer(UrlRenderer urlRenderer) {
|
||||
urlProvider.setUrlRenderer(urlRenderer);
|
||||
this.urlRenderer = urlRenderer;
|
||||
this.urlRenderer = urlRenderer;
|
||||
}
|
||||
|
||||
@Inject(required=false)
|
||||
public void setExtraParameterProvider(ExtraParameterProvider provider) {
|
||||
urlProvider.setExtraParameterProvider(provider);
|
||||
this.extraParameterProvider = provider;
|
||||
}
|
||||
|
||||
public boolean start(Writer writer) {
|
||||
boolean result = super.start(writer);
|
||||
urlRenderer.beforeRenderUrl(urlProvider);
|
||||
urlRenderer.beforeRenderUrl(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean end(Writer writer, String body) {
|
||||
urlRenderer.renderUrl(writer, urlProvider);
|
||||
urlRenderer.renderUrl(writer, this);
|
||||
return super.end(writer, body);
|
||||
}
|
||||
|
||||
public String findString(String expr) {
|
||||
return super.findString(expr);
|
||||
}
|
||||
|
||||
public UrlProvider getUrlProvider() {
|
||||
return urlProvider;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The includeParams attribute may have the value 'none', 'get' or 'all'", defaultValue="none")
|
||||
public void setIncludeParams(String includeParams) {
|
||||
urlProvider.setIncludeParams(includeParams);
|
||||
this.includeParams = includeParams;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Set scheme attribute")
|
||||
public void setScheme(String scheme) {
|
||||
urlProvider.setScheme(scheme);
|
||||
this.scheme = scheme;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The target value to use, if not using action")
|
||||
public void setValue(String value) {
|
||||
urlProvider.setValue(value);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The action to generate the URL for, if not using value")
|
||||
public void setAction(String action) {
|
||||
urlProvider.setAction(action);
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The namespace to use")
|
||||
public void setNamespace(String namespace) {
|
||||
urlProvider.setNamespace(namespace);
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The method of action to use")
|
||||
public void setMethod(String method) {
|
||||
urlProvider.setMethod(method);
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Whether to encode parameters", type="Boolean", defaultValue="true")
|
||||
public void setEncode(boolean encode) {
|
||||
urlProvider.setEncode(encode);
|
||||
this.encode = encode;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Whether actual context should be included in URL", type="Boolean", defaultValue="true")
|
||||
public void setIncludeContext(boolean includeContext) {
|
||||
urlProvider.setIncludeContext(includeContext);
|
||||
this.includeContext = includeContext;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The resulting portlet mode")
|
||||
public void setPortletMode(String portletMode) {
|
||||
urlProvider.setPortletMode(portletMode);
|
||||
this.portletMode = portletMode;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The resulting portlet window state")
|
||||
public void setWindowState(String windowState) {
|
||||
urlProvider.setWindowState(windowState);
|
||||
this.windowState = windowState;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Specifies if this should be a portlet render or action URL. Default is \"render\". To create an action URL, use \"action\".")
|
||||
public void setPortletUrlType(String portletUrlType) {
|
||||
urlProvider.setPortletUrlType(portletUrlType);
|
||||
this.portletUrlType = portletUrlType;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The anchor for this URL")
|
||||
public void setAnchor(String anchor) {
|
||||
urlProvider.setAnchor(anchor);
|
||||
this.anchor = anchor;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Specifies whether to escape ampersand (&) to (&amp;) or not", type="Boolean", defaultValue="true")
|
||||
public void setEscapeAmp(boolean escapeAmp) {
|
||||
urlProvider.setEscapeAmp(escapeAmp);
|
||||
this.escapeAmp = escapeAmp;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Specifies whether to force the addition of scheme, host and port or not", type="Boolean", defaultValue="false")
|
||||
public void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort) {
|
||||
urlProvider.setForceAddSchemeHostAndPort(forceAddSchemeHostAndPort);
|
||||
this.forceAddSchemeHostAndPort = forceAddSchemeHostAndPort;
|
||||
}
|
||||
|
||||
public static interface ExtraParameterProvider {
|
||||
public Map getExtraParameters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Implemntations of this interface can be used to build a URL
|
||||
*/
|
||||
public interface UrlProvider {
|
||||
/**
|
||||
* The includeParams attribute may have the value 'none', 'get' or 'all'.
|
||||
* It is used when the url tag is used without a value attribute.
|
||||
* Its value is looked up on the ValueStack
|
||||
* If no includeParams is specified then 'get' is used.
|
||||
* none - include no parameters in the URL
|
||||
* get - include only GET parameters in the URL (default)
|
||||
* all - include both GET and POST parameters in the URL
|
||||
*/
|
||||
public static final String NONE = "none";
|
||||
public static final String GET = "get";
|
||||
public static final String ALL = "all";
|
||||
|
||||
boolean isPutInContext();
|
||||
|
||||
String getVar();
|
||||
|
||||
String getValue();
|
||||
|
||||
String findString(String value);
|
||||
|
||||
void setValue(String string);
|
||||
|
||||
String getUrlIncludeParams();
|
||||
|
||||
String getIncludeParams();
|
||||
|
||||
Map getParameters();
|
||||
|
||||
HttpServletRequest getHttpServletRequest();
|
||||
|
||||
String getAction();
|
||||
|
||||
ExtraParameterProvider getExtraParameterProvider();
|
||||
|
||||
String getScheme();
|
||||
|
||||
String getNamespace();
|
||||
|
||||
String getMethod();
|
||||
|
||||
HttpServletResponse getHttpServletResponse();
|
||||
|
||||
boolean isIncludeContext();
|
||||
|
||||
boolean isEncode();
|
||||
|
||||
boolean isForceAddSchemeHostAndPort();
|
||||
|
||||
boolean isEscapeAmp();
|
||||
|
||||
String getPortletMode();
|
||||
|
||||
String getWindowState();
|
||||
|
||||
String determineActionURL(String action, String namespace, String method, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Map parameters, String scheme, boolean includeContext, boolean encode, boolean forceAddSchemeHostAndPort, boolean escapeAmp);
|
||||
|
||||
String determineNamespace(String namespace, ValueStack stack, HttpServletRequest req);
|
||||
|
||||
String getAnchor();
|
||||
|
||||
String getPortletUrlType();
|
||||
|
||||
ValueStack getStack();
|
||||
|
||||
void setUrlIncludeParams(String urlIncludeParams);
|
||||
|
||||
void setHttpServletRequest(HttpServletRequest req);
|
||||
|
||||
void setHttpServletResponse(HttpServletResponse res);
|
||||
|
||||
void setUrlRenderer(UrlRenderer urlRenderer);
|
||||
|
||||
void setExtraParameterProvider(ExtraParameterProvider provider);
|
||||
|
||||
void setIncludeParams(String includeParams);
|
||||
|
||||
void setScheme(String scheme);
|
||||
|
||||
void setAction(String action);
|
||||
|
||||
void setPortletMode(String portletMode);
|
||||
|
||||
void setNamespace(String namespace);
|
||||
|
||||
void setMethod(String method);
|
||||
|
||||
void setEncode(boolean encode);
|
||||
|
||||
void setIncludeContext(boolean includeContext);
|
||||
|
||||
void setWindowState(String windowState);
|
||||
|
||||
void setPortletUrlType(String portletUrlType);
|
||||
|
||||
void setAnchor(String anchor);
|
||||
|
||||
void setEscapeAmp(boolean escapeAmp);
|
||||
|
||||
void setForceAddSchemeHostAndPort(boolean forceAddSchemeHostAndPort);
|
||||
|
||||
void putInContext(String result);
|
||||
}
|
||||
@@ -34,14 +34,14 @@ public interface UrlRenderer {
|
||||
* Preprocessing step
|
||||
* @param urlComponent
|
||||
*/
|
||||
void beforeRenderUrl(UrlProvider provider);
|
||||
void beforeRenderUrl(URL urlComponent);
|
||||
|
||||
/**
|
||||
* Render a URL.
|
||||
* @param writer A writer that the implementation can use to write the result to.
|
||||
* @param urlComponent The {@link UrlProvider} component that "owns" this renderer.
|
||||
* @param urlComponent The {@link URL} component that "owns" this renderer.
|
||||
*/
|
||||
void renderUrl(Writer writer, UrlProvider provider);
|
||||
void renderUrl(Writer writer, URL urlComponent);
|
||||
|
||||
/**
|
||||
* Render a Form URL.
|
||||
|
||||
@@ -228,9 +228,6 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
props.setProperty("devMode", "false");
|
||||
}
|
||||
|
||||
if (props.containsKey(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES))
|
||||
props.setProperty("logMissingProperties", props.getProperty(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES));
|
||||
|
||||
String val = props.getProperty(StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS);
|
||||
if (val != null) {
|
||||
props.setProperty("allowStaticMethodAccess", val);
|
||||
|
||||
@@ -78,7 +78,6 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
Map<String,String> dtdMappings = new HashMap<String,String>(getDtdMappings());
|
||||
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.0//EN", "struts-2.0.dtd");
|
||||
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1//EN", "struts-2.1.dtd");
|
||||
dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN", "struts-2.1.7.dtd");
|
||||
setDtdMappings(dtdMappings);
|
||||
File file = new File(filename);
|
||||
if (file.getParent() != null) {
|
||||
@@ -92,10 +91,11 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
@Override
|
||||
public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException {
|
||||
if (servletContext != null && !containerBuilder.contains(ServletContext.class)) {
|
||||
containerBuilder.factory(ServletContext.class, new Factory<ServletContext>() {
|
||||
public ServletContext create(Context context) throws Exception {
|
||||
containerBuilder.factory(ServletContext.class, new Factory() {
|
||||
public Object create(Context context) throws Exception {
|
||||
return servletContext;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
super.register(containerBuilder, props);
|
||||
@@ -148,7 +148,7 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
}
|
||||
if (file.exists()) {
|
||||
try {
|
||||
url = file.toURI().toURL();
|
||||
url = file.toURL();
|
||||
} catch (MalformedURLException e) {
|
||||
throw new IOException("Unable to convert "+file+" to a URL");
|
||||
}
|
||||
@@ -173,4 +173,6 @@ public class StrutsXmlConfigurationProvider extends XmlConfigurationProvider {
|
||||
public String toString() {
|
||||
return ("Struts XML configuration provider ("+filename+")");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -86,9 +86,6 @@ public class ApplicationMap extends AbstractMap implements Serializable {
|
||||
final Object value = context.getAttribute(key);
|
||||
entries.add(new Map.Entry() {
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Map.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Map.Entry entry = (Map.Entry) obj;
|
||||
|
||||
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
|
||||
@@ -122,9 +119,6 @@ public class ApplicationMap extends AbstractMap implements Serializable {
|
||||
final Object value = context.getInitParameter(key);
|
||||
entries.add(new Map.Entry() {
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Map.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Map.Entry entry = (Map.Entry) obj;
|
||||
|
||||
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
|
||||
|
||||
@@ -170,7 +170,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
|
||||
String pathEnding = buildPath(name, pathPrefix);
|
||||
if (resourceUrl.getFile().endsWith(pathEnding))
|
||||
is = resourceUrl.openStream();
|
||||
} catch (IOException ex) {
|
||||
} catch (Exception ex) {
|
||||
// just ignore it
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.config.BeanSelectionProvider;
|
||||
import org.apache.struts2.config.DefaultPropertiesProvider;
|
||||
import org.apache.struts2.config.LegacyPropertiesConfigurationProvider;
|
||||
@@ -134,11 +133,6 @@ public class Dispatcher {
|
||||
*/
|
||||
private String multipartSaveDir;
|
||||
|
||||
/**
|
||||
* Stores the value of StrutsConstants.STRUTS_MULTIPART_HANDLER setting
|
||||
*/
|
||||
private String multipartHandlerName;
|
||||
|
||||
/**
|
||||
* Provide list of default configuration files.
|
||||
*/
|
||||
@@ -242,11 +236,6 @@ public class Dispatcher {
|
||||
multipartSaveDir = val;
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_MULTIPART_HANDLER)
|
||||
public void setMultipartHandler(String val) {
|
||||
multipartHandlerName = val;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setValueStackFactory(ValueStackFactory valueStackFactory) {
|
||||
this.valueStackFactory = valueStackFactory;
|
||||
@@ -298,9 +287,6 @@ public class Dispatcher {
|
||||
interceptor.destroy();
|
||||
}
|
||||
|
||||
//cleanup action context
|
||||
ActionContext.setContext(null);
|
||||
|
||||
// clean up configuration
|
||||
configurationManager.destroyConfiguration();
|
||||
configurationManager = null;
|
||||
@@ -407,28 +393,22 @@ public class Dispatcher {
|
||||
configurationManager = new ConfigurationManager(BeanSelectionProvider.DEFAULT_BEAN_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
init_DefaultProperties(); // [1]
|
||||
init_TraditionalXmlConfigurations(); // [2]
|
||||
init_LegacyStrutsProperties(); // [3]
|
||||
init_CustomConfigurationProviders(); // [5]
|
||||
init_FilterInitParameters() ; // [6]
|
||||
init_AliasStandardObjects() ; // [7]
|
||||
init_DefaultProperties(); // [1]
|
||||
init_TraditionalXmlConfigurations(); // [2]
|
||||
init_LegacyStrutsProperties(); // [3]
|
||||
init_CustomConfigurationProviders(); // [5]
|
||||
init_FilterInitParameters() ; // [6]
|
||||
init_AliasStandardObjects() ; // [7]
|
||||
|
||||
Container container = init_PreloadConfiguration();
|
||||
container.inject(this);
|
||||
init_CheckConfigurationReloading(container);
|
||||
init_CheckWebLogicWorkaround(container);
|
||||
Container container = init_PreloadConfiguration();
|
||||
container.inject(this);
|
||||
init_CheckConfigurationReloading(container);
|
||||
init_CheckWebLogicWorkaround(container);
|
||||
|
||||
if (!dispatcherListeners.isEmpty()) {
|
||||
for (DispatcherListener l : dispatcherListeners) {
|
||||
l.dispatcherInitialized(this);
|
||||
}
|
||||
if (!dispatcherListeners.isEmpty()) {
|
||||
for (DispatcherListener l : dispatcherListeners) {
|
||||
l.dispatcherInitialized(this);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
if (LOG.isErrorEnabled())
|
||||
LOG.error("Dispatcher initialization failed", ex);
|
||||
throw new StrutsException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,20 +592,7 @@ public class Dispatcher {
|
||||
File multipartSaveDir = new File(saveDir);
|
||||
|
||||
if (!multipartSaveDir.exists()) {
|
||||
if (multipartSaveDir.mkdir() == false) {
|
||||
String logMessage;
|
||||
try {
|
||||
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.getCanonicalPath()+"'.";
|
||||
} catch (IOException e) {
|
||||
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.toString()+"'.";
|
||||
}
|
||||
if(devMode) {
|
||||
LOG.error(logMessage);
|
||||
}
|
||||
else {
|
||||
LOG.warn(logMessage);
|
||||
}
|
||||
}
|
||||
multipartSaveDir.mkdir();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,20 +659,8 @@ public class Dispatcher {
|
||||
|
||||
String content_type = request.getContentType();
|
||||
if (content_type != null && content_type.indexOf("multipart/form-data") != -1) {
|
||||
MultiPartRequest mpr = null;
|
||||
//check for alternate implementations of MultiPartRequest
|
||||
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
|
||||
if (multiNames != null) {
|
||||
for (String multiName : multiNames) {
|
||||
if (multiName.equals(multipartHandlerName)) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mpr == null ) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class);
|
||||
}
|
||||
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext));
|
||||
MultiPartRequest multi = getContainer().getInstance(MultiPartRequest.class);
|
||||
request = new MultiPartRequestWrapper(multi, request, getSaveDir(servletContext));
|
||||
} else {
|
||||
request = new StrutsRequestWrapper(request);
|
||||
}
|
||||
|
||||
@@ -80,9 +80,6 @@ public class RequestMap extends AbstractMap implements Serializable {
|
||||
final Object value = request.getAttribute(key);
|
||||
entries.add(new Entry() {
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Entry)) {
|
||||
return false;
|
||||
}
|
||||
Entry entry = (Entry) obj;
|
||||
|
||||
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
|
||||
|
||||
@@ -131,6 +131,9 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
|
||||
protected String actionName;
|
||||
protected String namespace;
|
||||
protected String method;
|
||||
protected boolean supressEmptyParameters = false;
|
||||
|
||||
private Map<String, String> requestParameters = new LinkedHashMap<String, String>();
|
||||
|
||||
public ServletActionRedirectResult() {
|
||||
super();
|
||||
@@ -151,6 +154,9 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
protected List<String> prohibitedResultParam = Arrays.asList(new String[] {
|
||||
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
|
||||
"prependServletContext", "supressEmptyParameters" });
|
||||
|
||||
/**
|
||||
* @see com.opensymphony.xwork2.Result#execute(com.opensymphony.xwork2.ActionInvocation)
|
||||
@@ -169,7 +175,27 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
|
||||
method = conditionalParse(method, invocation);
|
||||
}
|
||||
|
||||
String resultCode = invocation.getResultCode();
|
||||
if (resultCode != null) {
|
||||
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(
|
||||
resultCode);
|
||||
Map resultConfigParams = resultConfig.getParams();
|
||||
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext(); ) {
|
||||
Map.Entry e = (Map.Entry) i.next();
|
||||
if (! prohibitedResultParam.contains(e.getKey())) {
|
||||
requestParameters.put(e.getKey().toString(),
|
||||
e.getValue() == null ? "":
|
||||
conditionalParse(e.getValue().toString(), invocation));
|
||||
String potentialValue = e.getValue() == null ? "": conditionalParse(e.getValue().toString(), invocation);
|
||||
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
|
||||
requestParameters.put(e.getKey().toString(), potentialValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder tmpLocation = new StringBuilder(actionMapper.getUriFromActionMapping(new ActionMapping(actionName, namespace, method, null)));
|
||||
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
|
||||
|
||||
setLocation(tmpLocation.toString());
|
||||
|
||||
@@ -203,9 +229,29 @@ public class ServletActionRedirectResult extends ServletRedirectResult implement
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
protected List<String> getProhibitedResultParams() {
|
||||
return Arrays.asList(new String[]{
|
||||
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
|
||||
"prependServletContext", "supressEmptyParameters"});
|
||||
/**
|
||||
* Sets the supressEmptyParameters option
|
||||
*
|
||||
* @param suppress The new value for this option
|
||||
*/
|
||||
public void setSupressEmptyParameters(boolean supressEmptyParameters) {
|
||||
this.supressEmptyParameters = supressEmptyParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a request parameter to be added to the redirect url
|
||||
*
|
||||
* @param key The parameter name
|
||||
* @param value The parameter value
|
||||
*/
|
||||
public ServletActionRedirectResult addParameter(String key, Object value) {
|
||||
requestParameters.put(key, String.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public void handle(ReflectionException ex) {
|
||||
// Only log as debug as they are probably parameters to be appended to the url
|
||||
LOG.debug(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,25 +26,16 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import static javax.servlet.http.HttpServletResponse.*;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionException;
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
@@ -90,7 +81,7 @@ import java.util.Arrays;
|
||||
* <!-- END SNIPPET: example --></pre>
|
||||
*
|
||||
*/
|
||||
public class ServletRedirectResult extends StrutsResultSupport implements ReflectionExceptionHandler {
|
||||
public class ServletRedirectResult extends StrutsResultSupport {
|
||||
|
||||
private static final long serialVersionUID = 6316947346435301270L;
|
||||
|
||||
@@ -102,10 +93,6 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
|
||||
protected int statusCode = SC_FOUND;
|
||||
|
||||
protected boolean supressEmptyParameters = false;
|
||||
|
||||
protected Map<String, String> requestParameters = new LinkedHashMap<String, String>();
|
||||
|
||||
public ServletRedirectResult() {
|
||||
super();
|
||||
}
|
||||
@@ -166,28 +153,7 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
finalLocation = request.getContextPath() + finalLocation;
|
||||
}
|
||||
|
||||
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());
|
||||
if (resultConfig != null ) {
|
||||
Map resultConfigParams = resultConfig.getParams();
|
||||
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext();) {
|
||||
Map.Entry e = (Map.Entry) i.next();
|
||||
|
||||
if (!getProhibitedResultParams().contains(e.getKey())) {
|
||||
requestParameters.put(e.getKey().toString(),
|
||||
e.getValue() == null ? "" :
|
||||
conditionalParse(e.getValue().toString(), invocation));
|
||||
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue().toString(), invocation);
|
||||
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
|
||||
requestParameters.put(e.getKey().toString(), potentialValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder tmpLocation = new StringBuilder(finalLocation);
|
||||
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
|
||||
|
||||
finalLocation = response.encodeRedirectURL(tmpLocation.toString());
|
||||
finalLocation = response.encodeRedirectURL(finalLocation);
|
||||
}
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
@@ -197,13 +163,6 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
sendRedirect(response, finalLocation);
|
||||
}
|
||||
|
||||
protected List<String> getProhibitedResultParams() {
|
||||
return Arrays.asList(new String[]{
|
||||
DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location",
|
||||
"prependServletContext", "supressEmptyParameters"});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends the redirection. Can be overridden to customize how the redirect is handled (i.e. to use a different
|
||||
* status code)
|
||||
@@ -230,29 +189,4 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
// either before the port, or after the protocol
|
||||
return (url.indexOf(':') == -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the supressEmptyParameters option
|
||||
*
|
||||
* @param supressEmptyParameters The new value for this option
|
||||
*/
|
||||
public void setSupressEmptyParameters(boolean supressEmptyParameters) {
|
||||
this.supressEmptyParameters = supressEmptyParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a request parameter to be added to the redirect url
|
||||
*
|
||||
* @param key The parameter name
|
||||
* @param value The parameter value
|
||||
*/
|
||||
public ServletRedirectResult addParameter(String key, Object value) {
|
||||
requestParameters.put(key, String.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public void handle(ReflectionException ex) {
|
||||
// Only log as debug as they are probably parameters to be appended to the url
|
||||
LOG.debug(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,9 +117,6 @@ public class SessionMap<K, V> extends AbstractMap<K,V> implements Serializable {
|
||||
final Object value = session.getAttribute(key);
|
||||
entries.add(new Map.Entry<K,V>() {
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Map.Entry)) {
|
||||
return false;
|
||||
}
|
||||
Map.Entry<K, V> entry = (Map.Entry<K, V>) obj;
|
||||
|
||||
return ((key == null) ? (entry.getKey() == null) : key.equals(entry.getKey())) && ((value == null) ? (entry.getValue() == null) : value.equals(entry.getValue()));
|
||||
|
||||
@@ -53,7 +53,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
*
|
||||
* <li><b>contentDisposition</b> - the content disposition header value for
|
||||
* specifing the file name (default = <code>inline</code>, values are typically
|
||||
* <i>attachment;filename="document.pdf"</i>.</li>
|
||||
* <i>filename="document.pdf"</i>.</li>
|
||||
*
|
||||
* <li><b>inputName</b> - the name of the InputStream property from the chained
|
||||
* action (default = <code>inputStream</code>).</li>
|
||||
@@ -76,7 +76,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
* <result name="success" type="stream">
|
||||
* <param name="contentType">image/jpeg</param>
|
||||
* <param name="inputName">imageStream</param>
|
||||
* <param name="contentDisposition">attachment;filename="document.pdf"</param>
|
||||
* <param name="contentDisposition">filename="document.pdf"</param>
|
||||
* <param name="bufferSize">1024</param>
|
||||
* </result>
|
||||
* <!-- END SNIPPET: example --></pre>
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ActionMapping {
|
||||
private String namespace;
|
||||
private String method;
|
||||
private String extension;
|
||||
private Map<String, Object> params;
|
||||
private Map params;
|
||||
private Result result;
|
||||
|
||||
/**
|
||||
@@ -63,7 +63,7 @@ public class ActionMapping {
|
||||
* @param method The method
|
||||
* @param params The extra parameters
|
||||
*/
|
||||
public ActionMapping(String name, String namespace, String method, Map<String, Object> params) {
|
||||
public ActionMapping(String name, String namespace, String method, Map params) {
|
||||
this.name = name;
|
||||
this.namespace = namespace;
|
||||
this.method = method;
|
||||
@@ -87,7 +87,7 @@ public class ActionMapping {
|
||||
/**
|
||||
* @return The extra parameters
|
||||
*/
|
||||
public Map<String, Object> getParams() {
|
||||
public Map getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class ActionMapping {
|
||||
/**
|
||||
* @param params The extra parameters for this mapping
|
||||
*/
|
||||
public void setParams(Map<String, Object> params) {
|
||||
public void setParams(Map params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ import com.opensymphony.xwork2.inject.Container;
|
||||
*
|
||||
* <li>Redirect prefix - <i>redirect:cancel.jsp</i></li>
|
||||
*
|
||||
* <li>Redirect-action prefix - <i>redirectAction:cancel</i></li>
|
||||
* <li>Redirect-action prefix - <i>redirect-action:cancel</i></li>
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
@@ -151,7 +151,7 @@ import com.opensymphony.xwork2.inject.Container;
|
||||
* <s:form action="baz">
|
||||
* <s:textfield label="Enter your name" name="person.name"/>
|
||||
* <s:submit value="Create person"/>
|
||||
* <s:submit name="redirectAction:dashboard" value="Cancel"/>
|
||||
* <s:submit name="redirect-action:dashboard" value="Cancel"/>
|
||||
* </s:form>
|
||||
* <!-- END SNIPPET: redirect-action-example -->
|
||||
* </pre>
|
||||
@@ -165,7 +165,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
protected static final String REDIRECT_PREFIX = "redirect:";
|
||||
|
||||
protected static final String REDIRECT_ACTION_PREFIX = "redirectAction:";
|
||||
protected static final String REDIRECT_ACTION_PREFIX = "redirect-action:";
|
||||
|
||||
protected boolean allowDynamicMethodCalls = true;
|
||||
|
||||
@@ -184,10 +184,9 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
{
|
||||
put(METHOD_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
if (allowDynamicMethodCalls) {
|
||||
mapping.setMethod(key.substring(
|
||||
METHOD_PREFIX.length()));
|
||||
}
|
||||
mapping
|
||||
.setMethod(key
|
||||
.substring(METHOD_PREFIX.length()));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -357,7 +356,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
if (key.endsWith(".x") || key.endsWith(".y")) {
|
||||
key = key.substring(0, key.length() - 2);
|
||||
}
|
||||
|
||||
|
||||
// Ensure a parameter doesn't get processed twice
|
||||
if (!uniqueParameters.contains(key)) {
|
||||
ParameterAction parameterAction = (ParameterAction) prefixTrie
|
||||
|
||||
@@ -110,6 +110,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
|
||||
|
||||
if (!isSlashesInActionNames()) {
|
||||
throw new IllegalStateException("This action mapper requires the setting 'slashesInActionNames' to be set to 'true'");
|
||||
}
|
||||
@@ -121,16 +122,16 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
|
||||
String actionName = mapping.getName();
|
||||
|
||||
int lastSlashPos = actionName.lastIndexOf('/');
|
||||
String id = null;
|
||||
if (lastSlashPos > -1 && actionName != null) {
|
||||
id = actionName.substring(lastSlashPos+1);
|
||||
}
|
||||
|
||||
|
||||
// Only try something if the action name is specified
|
||||
if (actionName != null && actionName.length() > 0) {
|
||||
|
||||
int lastSlashPos = actionName.lastIndexOf('/');
|
||||
if (lastSlashPos > -1) {
|
||||
id = actionName.substring(lastSlashPos+1);
|
||||
}
|
||||
|
||||
|
||||
// If a method hasn't been explicitly named, try to guess using ReST-style patterns
|
||||
if (mapping.getMethod() == null) {
|
||||
@@ -173,7 +174,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
|
||||
if (idParameterName != null && id != null) {
|
||||
if (mapping.getParams() == null) {
|
||||
mapping.setParams(new HashMap<String, Object>());
|
||||
mapping.setParams(new HashMap());
|
||||
}
|
||||
mapping.getParams().put(idParameterName, id);
|
||||
}
|
||||
@@ -205,7 +206,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
}
|
||||
if (parameters.size() > 0) {
|
||||
if (mapping.getParams() == null) {
|
||||
mapping.setParams(new HashMap<String, Object>());
|
||||
mapping.setParams(new HashMap());
|
||||
}
|
||||
mapping.getParams().putAll(parameters);
|
||||
}
|
||||
@@ -251,4 +252,7 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
public void setIdParameterName(String idParameterName) {
|
||||
this.idParameterName = idParameterName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||