mirror of
https://github.com/apache/struts.git
synced 2026-08-06 15:17:00 +00:00
WW-2063
Fixed subversion properties. git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@590812 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+174
-174
@@ -1,174 +1,174 @@
|
||||
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.
|
||||
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,6 +1,6 @@
|
||||
Apache Struts
|
||||
|
||||
Copyright 2006 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/
|
||||
Apache Struts
|
||||
|
||||
Copyright 2006 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
README.txt - blank
|
||||
|
||||
This is an "empty" application that you can deploy as the basis of your own
|
||||
application.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
README.txt - blank
|
||||
|
||||
This is an "empty" application that you can deploy as the basis of your own
|
||||
application.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
@@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
set CLASSPATH=..\..\..\lib\xwork-2.0-beta-1.jar
|
||||
javac *.java -d ..\..\..\classes
|
||||
@echo off
|
||||
set CLASSPATH=..\..\..\lib\xwork-2.0-beta-1.jar
|
||||
javac *.java -d ..\..\..\classes
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?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="example" namespace="/example" extends="struts-default">
|
||||
|
||||
<action name="HelloWorld" class="example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add actions here -->
|
||||
</package>
|
||||
</struts>
|
||||
<?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="example" namespace="/example" extends="struts-default">
|
||||
|
||||
<action name="HelloWorld" class="example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add actions here -->
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
<!DOCTYPE validators PUBLIC
|
||||
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
|
||||
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="requiredstring"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
+17
-17
@@ -1,18 +1,18 @@
|
||||
README.txt - mailreader
|
||||
|
||||
The MailReader demonstrates a localized application with a master/child
|
||||
CRUD workflow.
|
||||
|
||||
This rendition also demonstrates using wildcards to "normalize" an
|
||||
application.
|
||||
|
||||
See the Sandbox for other MailReader examples using other architectures.
|
||||
|
||||
* http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/
|
||||
|
||||
For more about the MailReader applicaton genneraly, visit Struts University.
|
||||
|
||||
* http://www.StrutsUniversity.org/
|
||||
|
||||
|
||||
README.txt - mailreader
|
||||
|
||||
The MailReader demonstrates a localized application with a master/child
|
||||
CRUD workflow.
|
||||
|
||||
This rendition also demonstrates using wildcards to "normalize" an
|
||||
application.
|
||||
|
||||
See the Sandbox for other MailReader examples using other architectures.
|
||||
|
||||
* http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2/apps/
|
||||
|
||||
For more about the MailReader applicaton genneraly, visit Struts University.
|
||||
|
||||
* http://www.StrutsUniversity.org/
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
@@ -1,47 +1,47 @@
|
||||
<?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="mailreader-default" namespace="/" extends="struts-default">
|
||||
|
||||
<interceptors>
|
||||
|
||||
<interceptor name="authentication"
|
||||
class="mailreader2.AuthenticationInterceptor"/>
|
||||
|
||||
<interceptor-stack name="user" >
|
||||
<interceptor-ref name="authentication" />
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="user-submit" >
|
||||
<interceptor-ref name="tokenSession" />
|
||||
<interceptor-ref name="user"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="guest" >
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="user"/>
|
||||
|
||||
<global-results>
|
||||
<result name="error">/pages/Error.jsp</result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirectAction">Login_input</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
<exception-mapping
|
||||
result="error"
|
||||
exception="java.lang.Throwable"/>
|
||||
</global-exception-mappings>
|
||||
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
<?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="mailreader-default" namespace="/" extends="struts-default">
|
||||
|
||||
<interceptors>
|
||||
|
||||
<interceptor name="authentication"
|
||||
class="mailreader2.AuthenticationInterceptor"/>
|
||||
|
||||
<interceptor-stack name="user" >
|
||||
<interceptor-ref name="authentication" />
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="user-submit" >
|
||||
<interceptor-ref name="tokenSession" />
|
||||
<interceptor-ref name="user"/>
|
||||
</interceptor-stack>
|
||||
|
||||
<interceptor-stack name="guest" >
|
||||
<interceptor-ref name="defaultStack"/>
|
||||
</interceptor-stack>
|
||||
|
||||
</interceptors>
|
||||
|
||||
<default-interceptor-ref name="user"/>
|
||||
|
||||
<global-results>
|
||||
<result name="error">/pages/Error.jsp</result>
|
||||
<result name="invalid.token">/pages/Error.jsp</result>
|
||||
<result name="login" type="redirectAction">Login_input</result>
|
||||
</global-results>
|
||||
|
||||
<global-exception-mappings>
|
||||
<exception-mapping
|
||||
result="error"
|
||||
exception="java.lang.Throwable"/>
|
||||
</global-exception-mappings>
|
||||
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
<?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="mailreader-support" namespace="/" extends="mailreader-default">
|
||||
|
||||
<action name="Tour">
|
||||
<result>/tour.html</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Welcome" class="mailreader2.Welcome">
|
||||
<result>/Welcome.jsp</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Logout" class="mailreader2.Logout">
|
||||
<result type="redirectAction">Welcome</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="mailreader2.Login">
|
||||
<result name="input">/Login.jsp</result>
|
||||
<result name="cancel" type="redirectAction">Welcome</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
<exception-mapping
|
||||
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
|
||||
result="expired"/>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
|
||||
<result name="input">/Registration.jsp</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="subscription" namespace="/" extends="mailreader-support">
|
||||
|
||||
<global-results>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirectAction">Registration_input</result>
|
||||
</global-results>
|
||||
|
||||
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
|
||||
<interceptor-ref name="user-submit" />
|
||||
</action>
|
||||
|
||||
<action name="Subscription_*" method="{1}" class="mailreader2.Subscription" />
|
||||
|
||||
</package>
|
||||
|
||||
<package name="wildcard" namespace="/" extends="mailreader-support">
|
||||
|
||||
<action name="*" class="mailreader2.MailreaderSupport">
|
||||
<result>/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
<?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="mailreader-support" namespace="/" extends="mailreader-default">
|
||||
|
||||
<action name="Tour">
|
||||
<result>/tour.html</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Welcome" class="mailreader2.Welcome">
|
||||
<result>/Welcome.jsp</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Logout" class="mailreader2.Logout">
|
||||
<result type="redirectAction">Welcome</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="mailreader2.Login">
|
||||
<result name="input">/Login.jsp</result>
|
||||
<result name="cancel" type="redirectAction">Welcome</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<result name="expired" type="chain">ChangePassword</result>
|
||||
<exception-mapping
|
||||
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
|
||||
result="expired"/>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
|
||||
<action name="Registration_*" method="{1}" class="mailreader2.Registration">
|
||||
<result name="input">/Registration.jsp</result>
|
||||
<result type="redirectAction">MainMenu</result>
|
||||
<interceptor-ref name="guest"/>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="subscription" namespace="/" extends="mailreader-support">
|
||||
|
||||
<global-results>
|
||||
<result name="input">/Subscription.jsp</result>
|
||||
<result type="redirectAction">Registration_input</result>
|
||||
</global-results>
|
||||
|
||||
<action name="Subscription_save" method="save" class="mailreader2.Subscription">
|
||||
<interceptor-ref name="user-submit" />
|
||||
</action>
|
||||
|
||||
<action name="Subscription_*" method="{1}" class="mailreader2.Subscription" />
|
||||
|
||||
</package>
|
||||
|
||||
<package name="wildcard" namespace="/" extends="mailreader-support">
|
||||
|
||||
<action name="*" class="mailreader2.MailreaderSupport">
|
||||
<result>/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
<field name="password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
</validators>
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fullName">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fullName.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fromAddress">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fromAddress.required"/>
|
||||
</field-validator>
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.replyToAddress">
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fullName">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fullName.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.fromAddress">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.fromAddress.required"/>
|
||||
</field-validator>
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="user.replyToAddress">
|
||||
<field-validator type="email">
|
||||
<message key="errors.email"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="subscription.username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.type">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.type.invalid"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="subscription.username">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.username.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.password">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.password.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
<field name="subscription.type">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.type.invalid"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="host">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.host.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
|
||||
|
||||
<validators>
|
||||
|
||||
<field name="host">
|
||||
<field-validator type="requiredstring">
|
||||
<message key="error.host.required"/>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
</validators>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?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>
|
||||
|
||||
<constant name="struts.action.extension" value="do" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
|
||||
<include file="mailreader-default.xml"/>
|
||||
|
||||
<include file="mailreader-support.xml"/>
|
||||
|
||||
<?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>
|
||||
|
||||
<constant name="struts.action.extension" value="do" />
|
||||
<constant name="struts.devMode" value="false" />
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
|
||||
|
||||
<include file="mailreader-default.xml"/>
|
||||
|
||||
<include file="mailreader-support.xml"/>
|
||||
|
||||
</struts>
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version='1.0'?>
|
||||
<database>
|
||||
<user username="user" fromAddress="John.User@somewhere.com"
|
||||
fullName="John Q. User" password="pass">
|
||||
<subscription host="mail.hotmail.com" autoConnect="false"
|
||||
password="bar" type="pop3" username="user1234">
|
||||
</subscription>
|
||||
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
|
||||
type="imap" username="jquser">
|
||||
</subscription>
|
||||
</user>
|
||||
</database>
|
||||
<?xml version='1.0'?>
|
||||
<database>
|
||||
<user username="user" fromAddress="John.User@somewhere.com"
|
||||
fullName="John Q. User" password="pass">
|
||||
<subscription host="mail.hotmail.com" autoConnect="false"
|
||||
password="bar" type="pop3" username="user1234">
|
||||
</subscription>
|
||||
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
|
||||
type="imap" username="jquser">
|
||||
</subscription>
|
||||
</user>
|
||||
</database>
|
||||
|
||||
+16
-16
@@ -1,17 +1,17 @@
|
||||
README.txt - portlet
|
||||
|
||||
This is a simple example of using the portlet API with Struts applications.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
WARNING - Additional configuration required for deployment
|
||||
|
||||
Due to difference in portlet container implementations, the portlet
|
||||
WAR is not ready-to-run. Extract the portlet WAR, and then copy the
|
||||
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
|
||||
WAR's WEB-INF directory.
|
||||
|
||||
|
||||
README.txt - portlet
|
||||
|
||||
This is a simple example of using the portlet API with Struts applications.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
WARNING - Additional configuration required for deployment
|
||||
|
||||
Due to difference in portlet container implementations, the portlet
|
||||
WAR is not ready-to-run. Extract the portlet WAR, and then copy the
|
||||
contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
|
||||
WAR's WEB-INF directory.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
@@ -1,20 +1,20 @@
|
||||
<page>
|
||||
<defaults
|
||||
skin="orange"
|
||||
layout-decorator="tigris"
|
||||
portlet-decorator="tigris"
|
||||
/>
|
||||
<title>Struts Portlet Example Application</title>
|
||||
<metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
|
||||
|
||||
<fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
|
||||
<fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
|
||||
<property layout="TwoColumns" name="row" value="0" />
|
||||
<property layout="TwoColumns" name="column" value="0" />
|
||||
</fragment>
|
||||
</fragment>
|
||||
|
||||
<security-constraints>
|
||||
<security-constraints-ref>public-view</security-constraints-ref>
|
||||
</security-constraints>
|
||||
<page>
|
||||
<defaults
|
||||
skin="orange"
|
||||
layout-decorator="tigris"
|
||||
portlet-decorator="tigris"
|
||||
/>
|
||||
<title>Struts Portlet Example Application</title>
|
||||
<metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
|
||||
|
||||
<fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
|
||||
<fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
|
||||
<property layout="TwoColumns" name="row" value="0" />
|
||||
<property layout="TwoColumns" name="column" value="0" />
|
||||
</fragment>
|
||||
</fragment>
|
||||
|
||||
<security-constraints>
|
||||
<security-constraints-ref>public-view</security-constraints-ref>
|
||||
</security-constraints>
|
||||
</page>
|
||||
+37
-37
@@ -1,37 +1,37 @@
|
||||
/*
|
||||
* $Id: FormExample.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* 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.portlet.example;
|
||||
|
||||
import org.apache.struts2.portlet.example.model.Name;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.ModelDriven;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
|
||||
|
||||
private Name name = new Name();
|
||||
|
||||
public Name getModel() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* $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.portlet.example;
|
||||
|
||||
import org.apache.struts2.portlet.example.model.Name;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.ModelDriven;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
|
||||
|
||||
private Name name = new Name();
|
||||
|
||||
public Name getModel() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
+81
-81
@@ -1,81 +1,81 @@
|
||||
/*
|
||||
* $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.portlet.example.fileupload;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.struts2.dispatcher.DefaultActionSupport;
|
||||
|
||||
/**
|
||||
* File Upload example's action. <code>FileUploadAction</code>
|
||||
*
|
||||
*/
|
||||
public class FileUploadAction extends DefaultActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 5156288255337069381L;
|
||||
|
||||
private String contentType;
|
||||
private File upload;
|
||||
private String fileName;
|
||||
private String caption;
|
||||
|
||||
// since we are using <s:file name="upload" .../> the file name will be
|
||||
// obtained through getter/setter of <file-tag-name>FileName
|
||||
public String getUploadFileName() {
|
||||
return fileName;
|
||||
}
|
||||
public void setUploadFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the content type will be
|
||||
// obtained through getter/setter of <file-tag-name>ContentType
|
||||
public String getUploadContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setUploadContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the File itself will be
|
||||
// obtained through getter/setter of <file-tag-name>
|
||||
public File getUpload() {
|
||||
return upload;
|
||||
}
|
||||
public void setUpload(File upload) {
|
||||
this.upload = upload;
|
||||
}
|
||||
|
||||
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
public String upload() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* $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.portlet.example.fileupload;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.struts2.dispatcher.DefaultActionSupport;
|
||||
|
||||
/**
|
||||
* File Upload example's action. <code>FileUploadAction</code>
|
||||
*
|
||||
*/
|
||||
public class FileUploadAction extends DefaultActionSupport {
|
||||
|
||||
private static final long serialVersionUID = 5156288255337069381L;
|
||||
|
||||
private String contentType;
|
||||
private File upload;
|
||||
private String fileName;
|
||||
private String caption;
|
||||
|
||||
// since we are using <s:file name="upload" .../> the file name will be
|
||||
// obtained through getter/setter of <file-tag-name>FileName
|
||||
public String getUploadFileName() {
|
||||
return fileName;
|
||||
}
|
||||
public void setUploadFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the content type will be
|
||||
// obtained through getter/setter of <file-tag-name>ContentType
|
||||
public String getUploadContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setUploadContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
|
||||
// since we are using <s:file name="upload" ... /> the File itself will be
|
||||
// obtained through getter/setter of <file-tag-name>
|
||||
public File getUpload() {
|
||||
return upload;
|
||||
}
|
||||
public void setUpload(File upload) {
|
||||
this.upload = upload;
|
||||
}
|
||||
|
||||
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
public String upload() throws Exception {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package org.apache.struts2.portlet.example.model;
|
||||
|
||||
public class Name {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
}
|
||||
package org.apache.struts2.portlet.example.model;
|
||||
|
||||
public class Name {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
<?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="edit" extends="struts-portlet-default"
|
||||
namespace="/edit">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/index.jsp</result>
|
||||
</action>
|
||||
<action name="test"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/test.jsp</result>
|
||||
</action>
|
||||
<action name="formExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleForward"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/edit/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
|
||||
<action name="testAction"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
<?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="edit" extends="struts-portlet-default"
|
||||
namespace="/edit">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/index.jsp</result>
|
||||
</action>
|
||||
<action name="test"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/test.jsp</result>
|
||||
</action>
|
||||
<action name="formExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleEdit"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/edit/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExampleForward"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/edit/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="editTest" extends="edit" namespace="/edit/dummy/test">
|
||||
<action name="testAction"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,14 +1,14 @@
|
||||
<?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="help" extends="struts-portlet-default"
|
||||
namespace="/help">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
<?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="help" extends="struts-portlet-default"
|
||||
namespace="/help">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/help/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,115 +1,115 @@
|
||||
<?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="view" extends="struts-portlet-default"
|
||||
namespace="/view">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="formExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="formExampleModelDriven"
|
||||
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputModelDriven.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="validationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processValidationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
|
||||
<result name="input">
|
||||
/WEB-INF/view/fileUpload.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/fileUploadSuccess.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="tokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processTokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="invalid.token">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/tokenExample.jsp
|
||||
</result>
|
||||
<interceptor-ref name="portletDefaultStackWithToken" />
|
||||
</action>
|
||||
|
||||
<action name="springExample" class="springAction">
|
||||
<result name="success">
|
||||
/WEB-INF/view/springExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="freeMarkerExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result type="freemarker" name="input">
|
||||
/WEB-INF/view/freeMarkerExampleInput.ftl
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
<?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="view" extends="struts-portlet-default"
|
||||
namespace="/view">
|
||||
<action name="index"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="success">/WEB-INF/view/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="formExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFormExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="formExampleModelDriven"
|
||||
class="org.apache.struts2.portlet.example.FormExampleModelDriven">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputModelDriven.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="validationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processValidationExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">
|
||||
/WEB-INF/view/formExample.jsp
|
||||
</result>
|
||||
<result name="input">
|
||||
/WEB-INF/view/formExampleInputValidation.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
|
||||
<result name="input">
|
||||
/WEB-INF/view/fileUpload.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/fileUploadSuccess.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="tokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processTokenExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result name="input">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="invalid.token">
|
||||
/WEB-INF/view/tokenExampleInput.jsp
|
||||
</result>
|
||||
<result name="success">
|
||||
/WEB-INF/view/tokenExample.jsp
|
||||
</result>
|
||||
<interceptor-ref name="portletDefaultStackWithToken" />
|
||||
</action>
|
||||
|
||||
<action name="springExample" class="springAction">
|
||||
<result name="success">
|
||||
/WEB-INF/view/springExample.jsp
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="freeMarkerExample"
|
||||
class="com.opensymphony.xwork2.ActionSupport" method="input">
|
||||
<result type="freemarker" name="input">
|
||||
/WEB-INF/view/freeMarkerExampleInput.ftl
|
||||
</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerExample"
|
||||
class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
|
||||
</action>
|
||||
|
||||
<action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
|
||||
<result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
|
||||
</action>
|
||||
|
||||
<action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
|
||||
<result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<h1>Fileupload sample</h1>
|
||||
|
||||
<s:actionerror />
|
||||
<s:fielderror />
|
||||
<s:form action="fileUpload" method="POST" enctype="multipart/form-data">
|
||||
<s:file name="upload" label="File"/>
|
||||
<s:textfield name="caption" label="Caption"/>
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<h1>Fileupload sample</h1>
|
||||
|
||||
<s:actionerror />
|
||||
<s:fielderror />
|
||||
<s:form action="fileUpload" method="POST" enctype="multipart/form-data">
|
||||
<s:file name="upload" label="File"/>
|
||||
<s:textfield name="caption" label="Caption"/>
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<h1>Fileupload sample</h1>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li>ContentType: <s:property value="uploadContentType" /></li>
|
||||
<li>FileName: <s:property value="uploadFileName" /></li>
|
||||
<li>File: <s:property value="upload" /></li>
|
||||
<li>Caption:<s:property value="caption" /></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<h1>Fileupload sample</h1>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li>ContentType: <s:property value="uploadContentType" /></li>
|
||||
<li>FileName: <s:property value="uploadFileName" /></li>
|
||||
<li>File: <s:property value="upload" /></li>
|
||||
<li>Caption:<s:property value="caption" /></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<H2>Input your name</H2>
|
||||
<s:form action="formExampleModelDriven" method="POST">
|
||||
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
|
||||
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
|
||||
<s:submit value="Submit the form"/>
|
||||
</s:form>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
|
||||
<H2>Input your name</H2>
|
||||
<s:form action="formExampleModelDriven" method="POST">
|
||||
<s:textfield label="First name" name="firstName" value="%{firstName}"/>
|
||||
<s:textfield label="Last name" name="lastName" value="%{lastName}"/>
|
||||
<s:submit value="Submit the form"/>
|
||||
</s:form>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
README.txt - showcase
|
||||
|
||||
Showcase is a collection of examples with code that you might be adopt and
|
||||
adapt in your own applications.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
README.txt - showcase
|
||||
|
||||
Showcase is a collection of examples with code that you might be adopt and
|
||||
adapt in your own applications.
|
||||
|
||||
For more on getting started with Struts, see
|
||||
|
||||
* http://cwiki.apache.org/WW/home.html
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: pom.xml 559206 2007-07-24 21:01:18Z apetrelli $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
/*
|
||||
* $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.showcase.action;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
public class ExampleAction extends ActionSupport {
|
||||
public static final String CONSTANT = "Struts Rocks!";
|
||||
|
||||
public static Date getCurrentDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "John Galt";
|
||||
}
|
||||
|
||||
public String[] getBands() {
|
||||
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
|
||||
}
|
||||
|
||||
public List<String> getMovies() {
|
||||
return Arrays.asList("Lord of the Rings", "Matrix");
|
||||
}
|
||||
|
||||
public Book getBook() {
|
||||
return new Book("Iliad", "Homer");
|
||||
}
|
||||
|
||||
public Map<String, Book> getBooks() {
|
||||
Map<String, Book> books = new HashMap<String, Book>();
|
||||
books.put("Iliad", new Book("Iliad", "Homer"));
|
||||
books.put("The Republic", new Book("The Replublic", "Plato"));
|
||||
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
|
||||
"Friedrich Nietzsche"));
|
||||
return books;
|
||||
}
|
||||
}
|
||||
|
||||
class Book {
|
||||
private String title;
|
||||
private String author;
|
||||
|
||||
public Book(String title, String author) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
/*
|
||||
* $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.showcase.action;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
public class ExampleAction extends ActionSupport {
|
||||
public static final String CONSTANT = "Struts Rocks!";
|
||||
|
||||
public static Date getCurrentDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "John Galt";
|
||||
}
|
||||
|
||||
public String[] getBands() {
|
||||
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
|
||||
}
|
||||
|
||||
public List<String> getMovies() {
|
||||
return Arrays.asList("Lord of the Rings", "Matrix");
|
||||
}
|
||||
|
||||
public Book getBook() {
|
||||
return new Book("Iliad", "Homer");
|
||||
}
|
||||
|
||||
public Map<String, Book> getBooks() {
|
||||
Map<String, Book> books = new HashMap<String, Book>();
|
||||
books.put("Iliad", new Book("Iliad", "Homer"));
|
||||
books.put("The Republic", new Book("The Replublic", "Plato"));
|
||||
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
|
||||
"Friedrich Nietzsche"));
|
||||
return books;
|
||||
}
|
||||
}
|
||||
|
||||
class Book {
|
||||
private String title;
|
||||
private String author;
|
||||
|
||||
public Book(String title, String author) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
}
|
||||
@@ -1,77 +1,77 @@
|
||||
/*
|
||||
* $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.showcase.action;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.interceptor.annotations.After;
|
||||
|
||||
/**
|
||||
* Will only work on containers that unzip war files
|
||||
*
|
||||
*/
|
||||
public class JSPEvalAction extends ExampleAction {
|
||||
private String jsp;
|
||||
private final static String FILE = "/interactive/demo.jsp";
|
||||
|
||||
public String execute() throws IOException {
|
||||
if (jsp != null) {
|
||||
//write it to file
|
||||
URL url = ServletActionContext.getServletContext().getResource(FILE);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(url
|
||||
.getFile())));
|
||||
try {
|
||||
//directive
|
||||
writer.write("<%@ taglib prefix=\"s\" uri=\"/struts-tags\" %>");
|
||||
writer.write(jsp);
|
||||
} finally {
|
||||
if (writer != null)
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() throws IOException {
|
||||
URL url = ServletActionContext.getServletContext().getResource(FILE);
|
||||
FileOutputStream out = new FileOutputStream(new File(url.getFile()));
|
||||
try {
|
||||
out.getChannel().truncate(0);
|
||||
} finally {
|
||||
if (out != null)
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void setJsp(String jsp) {
|
||||
this.jsp = jsp;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* $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.showcase.action;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.interceptor.annotations.After;
|
||||
|
||||
/**
|
||||
* Will only work on containers that unzip war files
|
||||
*
|
||||
*/
|
||||
public class JSPEvalAction extends ExampleAction {
|
||||
private String jsp;
|
||||
private final static String FILE = "/interactive/demo.jsp";
|
||||
|
||||
public String execute() throws IOException {
|
||||
if (jsp != null) {
|
||||
//write it to file
|
||||
URL url = ServletActionContext.getServletContext().getResource(FILE);
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(url
|
||||
.getFile())));
|
||||
try {
|
||||
//directive
|
||||
writer.write("<%@ taglib prefix=\"s\" uri=\"/struts-tags\" %>");
|
||||
writer.write(jsp);
|
||||
} finally {
|
||||
if (writer != null)
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanUp() throws IOException {
|
||||
URL url = ServletActionContext.getServletContext().getResource(FILE);
|
||||
FileOutputStream out = new FileOutputStream(new File(url.getFile()));
|
||||
try {
|
||||
out.getChannel().truncate(0);
|
||||
} finally {
|
||||
if (out != null)
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void setJsp(String jsp) {
|
||||
this.jsp = jsp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: pom.xml 559206 2007-07-24 21:01:18Z apetrelli $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="ognl" namespace="/nodecorate" extends="struts-default">
|
||||
<action name="jspEval" class="org.apache.struts2.showcase.action.JSPEvalAction">
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="annotationWorkflow" />
|
||||
<result>/interactive/demo.jsp</result>
|
||||
</action>
|
||||
<action name="example" class="org.apache.struts2.showcase.action.ExampleAction" />
|
||||
</package>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="ognl" namespace="/nodecorate" extends="struts-default">
|
||||
<action name="jspEval" class="org.apache.struts2.showcase.action.JSPEvalAction">
|
||||
<interceptor-ref name="params"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="annotationWorkflow" />
|
||||
<result>/interactive/demo.jsp</result>
|
||||
</action>
|
||||
<action name="example" class="org.apache.struts2.showcase.action.ExampleAction" />
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,63 +1,63 @@
|
||||
[
|
||||
["Alabama","AL"],
|
||||
["Alaska","AK"],
|
||||
["American Samoa","AS"],
|
||||
["Arizona","AZ"],
|
||||
["Arkansas","AR"],
|
||||
["Armed Forces Europe","AE"],
|
||||
["Armed Forces Pacific","AP"],
|
||||
["Armed Forces the Americas","AA"],
|
||||
["California","CA"],
|
||||
["Colorado","CO"],
|
||||
["Connecticut","CT"],
|
||||
["Delaware","DE"],
|
||||
["District of Columbia","DC"],
|
||||
["Federated States of Micronesia","FM"],
|
||||
["Florida","FL"],
|
||||
["Georgia","GA"],
|
||||
["Guam","GU"],
|
||||
["Hawaii","HI"],
|
||||
["Idaho","ID"],
|
||||
["Illinois","IL"],
|
||||
["Indiana","IN"],
|
||||
["Iowa","IA"],
|
||||
["Kansas","KS"],
|
||||
["Kentucky","KY"],
|
||||
["Louisiana","LA"],
|
||||
["Maine","ME"],
|
||||
["Marshall Islands","MH"],
|
||||
["Maryland","MD"],
|
||||
["Massachusetts","MA"],
|
||||
["Michigan","MI"],
|
||||
["Minnesota","MN"],
|
||||
["Mississippi","MS"],
|
||||
["Missouri","MO"],
|
||||
["Montana","MT"],
|
||||
["Nebraska","NE"],
|
||||
["Nevada","NV"],
|
||||
["New Hampshire","NH"],
|
||||
["New Jersey","NJ"],
|
||||
["New Mexico","NM"],
|
||||
["New York","NY"],
|
||||
["North Carolina","NC"],
|
||||
["North Dakota","ND"],
|
||||
["Northern Mariana Islands","MP"],
|
||||
["Ohio","OH"],
|
||||
["Oklahoma","OK"],
|
||||
["Oregon","OR"],
|
||||
["Pennsylvania","PA"],
|
||||
["Puerto Rico","PR"],
|
||||
["Rhode Island","RI"],
|
||||
["South Carolina","SC"],
|
||||
["South Dakota","SD"],
|
||||
["Tennessee","TN"],
|
||||
["Texas","TX"],
|
||||
["Utah","UT"],
|
||||
["Vermont","VT"],
|
||||
["Virgin Islands, U.S.","VI"],
|
||||
["Virginia","VA"],
|
||||
["Washington","WA"],
|
||||
["West Virginia","WV"],
|
||||
["Wisconsin","WI"],
|
||||
["Wyoming","WY"]
|
||||
]
|
||||
[
|
||||
["Alabama","AL"],
|
||||
["Alaska","AK"],
|
||||
["American Samoa","AS"],
|
||||
["Arizona","AZ"],
|
||||
["Arkansas","AR"],
|
||||
["Armed Forces Europe","AE"],
|
||||
["Armed Forces Pacific","AP"],
|
||||
["Armed Forces the Americas","AA"],
|
||||
["California","CA"],
|
||||
["Colorado","CO"],
|
||||
["Connecticut","CT"],
|
||||
["Delaware","DE"],
|
||||
["District of Columbia","DC"],
|
||||
["Federated States of Micronesia","FM"],
|
||||
["Florida","FL"],
|
||||
["Georgia","GA"],
|
||||
["Guam","GU"],
|
||||
["Hawaii","HI"],
|
||||
["Idaho","ID"],
|
||||
["Illinois","IL"],
|
||||
["Indiana","IN"],
|
||||
["Iowa","IA"],
|
||||
["Kansas","KS"],
|
||||
["Kentucky","KY"],
|
||||
["Louisiana","LA"],
|
||||
["Maine","ME"],
|
||||
["Marshall Islands","MH"],
|
||||
["Maryland","MD"],
|
||||
["Massachusetts","MA"],
|
||||
["Michigan","MI"],
|
||||
["Minnesota","MN"],
|
||||
["Mississippi","MS"],
|
||||
["Missouri","MO"],
|
||||
["Montana","MT"],
|
||||
["Nebraska","NE"],
|
||||
["Nevada","NV"],
|
||||
["New Hampshire","NH"],
|
||||
["New Jersey","NJ"],
|
||||
["New Mexico","NM"],
|
||||
["New York","NY"],
|
||||
["North Carolina","NC"],
|
||||
["North Dakota","ND"],
|
||||
["Northern Mariana Islands","MP"],
|
||||
["Ohio","OH"],
|
||||
["Oklahoma","OK"],
|
||||
["Oregon","OR"],
|
||||
["Pennsylvania","PA"],
|
||||
["Puerto Rico","PR"],
|
||||
["Rhode Island","RI"],
|
||||
["South Carolina","SC"],
|
||||
["South Dakota","SD"],
|
||||
["Tennessee","TN"],
|
||||
["Texas","TX"],
|
||||
["Utah","UT"],
|
||||
["Vermont","VT"],
|
||||
["Virgin Islands, U.S.","VI"],
|
||||
["Virginia","VA"],
|
||||
["Washington","WA"],
|
||||
["West Virginia","WV"],
|
||||
["Wisconsin","WI"],
|
||||
["Wyoming","WY"]
|
||||
]
|
||||
|
||||
@@ -62,7 +62,7 @@ Using a JSON list returned from an action (href="/JSONList.action"), without aut
|
||||
|
||||
Reload on type (loadOnTextChange="true"), after 3 characters (loadMinimumCount="3", it is "3" by default), without the down arrow button (showDownArrow="false")
|
||||
<br/>
|
||||
<sx:autocompleter
|
||||
<sx:autocompleter
|
||||
id="auto2"
|
||||
indicator="indicator"
|
||||
href="%{jsonList}"
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
alert('inside a topic event. before request');
|
||||
//event: set event.cancel = true, to cancel request
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
alert('inside a topic event. after request');
|
||||
//data : text returned from request
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
alert('inside a topic event. before request');
|
||||
//event: set event.cancel = true, to cancel request
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
alert('inside a topic event. after request');
|
||||
//data : text returned from request
|
||||
//request: XMLHttpRequest object
|
||||
//widget: widget that published the topic
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Person.java 440597 2006-09-06 03:34:39Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: AbstractDao.java 394498 2006-04-16 15:28:06Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: AbstractDao.java 394498 2006-04-16 15:28:06Z tmjee $
|
||||
* $Id$
|
||||
*
|
||||
* Copyright 2006 The Apache Software Foundation.
|
||||
*
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - Fileupload</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<s:url var="url" action="upload" namespace="/fileupload" />
|
||||
<s:a href="%{#url}">Single File Upload</s:a>
|
||||
</li>
|
||||
<li>
|
||||
<s:url var="url" action="multipleUploadUsingList" namespace="/fileupload" />
|
||||
<s:a href="%{#url}">Multiple File Upload (List)</s:a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<s:url var="url" action="multipleUploadUsingArray" namespace="/fileupload" />
|
||||
<s:a href="%{#url}">Multiple File Upload (Array)</s:a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<s:url var="url" action="upload" namespace="/fileupload" />
|
||||
<s:a href="%{#url}">Single File Upload</s:a>
|
||||
</li>
|
||||
<li>
|
||||
<s:url var="url" action="multipleUploadUsingList" namespace="/fileupload" />
|
||||
<s:a href="%{#url}">Multiple File Upload (List)</s:a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<s:url var="url" action="multipleUploadUsingArray" namespace="/fileupload" />
|
||||
<s:a href="%{#url}">Multiple File Upload (Array)</s:a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +1,37 @@
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="upload" status="stat">
|
||||
<tr>
|
||||
<td>File <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{upload[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadFileName" status="stat">
|
||||
<tr>
|
||||
<td>File Name <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadContentType" status="stat">
|
||||
<tr>
|
||||
<td>Content Type <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="upload" status="stat">
|
||||
<tr>
|
||||
<td>File <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{upload[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadFileName" status="stat">
|
||||
<tr>
|
||||
<td>File Name <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadContentType" status="stat">
|
||||
<tr>
|
||||
<td>Content Type <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +1,20 @@
|
||||
<%@ page
|
||||
language="java"
|
||||
contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - fileupload - multiple fileupload using List</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<s:form action="doMultipleUploadUsingArray" method="POST" enctype="multipart/form-data">
|
||||
<s:file label="File (1)" name="upload" />
|
||||
<s:file label="File (2)" name="upload" />
|
||||
<s:file label="FIle (3)" name="upload" />
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
</body>
|
||||
<%@ page
|
||||
language="java"
|
||||
contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - fileupload - multiple fileupload using List</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<s:form action="doMultipleUploadUsingArray" method="POST" enctype="multipart/form-data">
|
||||
<s:file label="File (1)" name="upload" />
|
||||
<s:file label="File (2)" name="upload" />
|
||||
<s:file label="FIle (3)" name="upload" />
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +1,37 @@
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="upload" status="stat">
|
||||
<tr>
|
||||
<td>File <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{upload[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadFileName" status="stat">
|
||||
<tr>
|
||||
<td>File Name <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadContentType" status="stat">
|
||||
<tr>
|
||||
<td>Content Type <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
<%@taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="upload" status="stat">
|
||||
<tr>
|
||||
<td>File <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{upload[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadFileName" status="stat">
|
||||
<tr>
|
||||
<td>File Name <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadFileName[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
<table border="1">
|
||||
<s:iterator value="uploadContentType" status="stat">
|
||||
<tr>
|
||||
<td>Content Type <s:property value="%{#stat.index}" /></td>
|
||||
<td><s:property value="%{uploadContentType[#stat.index]}" /></td>
|
||||
</tr>
|
||||
</s:iterator>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +1,20 @@
|
||||
<%@ page
|
||||
language="java"
|
||||
contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ page
|
||||
language="java"
|
||||
contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - fileupload - multiple fileupload using List</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<s:form action="doMultipleUploadUsingList" method="POST" enctype="multipart/form-data">
|
||||
<s:file label="File (1)" name="upload" />
|
||||
<s:file label="File (2)" name="upload" />
|
||||
<s:file label="FIle (3)" name="upload" />
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
<s:form action="doMultipleUploadUsingList" method="POST" enctype="multipart/form-data">
|
||||
<s:file label="File (1)" name="upload" />
|
||||
<s:file label="File (2)" name="upload" />
|
||||
<s:file label="FIle (3)" name="upload" />
|
||||
<s:submit />
|
||||
</s:form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,76 +1,76 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<pre style="font-style: normal;">
|
||||
<span class="kw">package</span> org.apache.struts2.showcase.action;
|
||||
|
||||
<span class="kw">import</span> java.util.Arrays;
|
||||
<span class="kw">import</span> java.util.Date;
|
||||
<span class="kw">import</span> java.util.HashMap;
|
||||
<span class="kw">import</span> java.util.List;
|
||||
<span class="kw">import</span> java.util.Map;
|
||||
|
||||
<span class="kw">import</span> com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
<span class="kw">public class</span> ExampleAction <span class="kw">extends</span> ActionSupport {
|
||||
<span class="kw">public static final</span> String CONSTANT = "Struts Rocks!";
|
||||
|
||||
<span class="kw">public static</span> Date getCurrentDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String getName() {
|
||||
return "John Galt";
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String[] getBands() {
|
||||
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
|
||||
}
|
||||
|
||||
<span class="kw">public</span> List<String> getMovies() {
|
||||
return Arrays.asList("Lord of the Rings", "Matrix");
|
||||
}
|
||||
|
||||
<span class="kw">public</span> Book getBook() {
|
||||
<span class="kw">return</span> new Book("Iliad", "Homer");
|
||||
}
|
||||
|
||||
<span class="kw">public</span> Map<String, Book> getBooks() {
|
||||
Map<String, Book> books = new HashMap<String, Book>();
|
||||
books.put("Iliad", new Book("Iliad", "Homer"));
|
||||
books.put("The Republic", new Book("The Replublic", "Plato"));
|
||||
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
|
||||
"Friedrich Nietzsche"));
|
||||
return books;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">class</span> Book {
|
||||
<span class="kw">private</span> String title;
|
||||
<span class="kw">private</span> String author;
|
||||
|
||||
<span class="kw">public</span> Book(String title, String author) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String getTitle() {
|
||||
<span class="kw">return</span> title;
|
||||
}
|
||||
|
||||
<span class="kw">public void</span> setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
<span class="kw">public void</span> setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
}
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<pre style="font-style: normal;">
|
||||
<span class="kw">package</span> org.apache.struts2.showcase.action;
|
||||
|
||||
<span class="kw">import</span> java.util.Arrays;
|
||||
<span class="kw">import</span> java.util.Date;
|
||||
<span class="kw">import</span> java.util.HashMap;
|
||||
<span class="kw">import</span> java.util.List;
|
||||
<span class="kw">import</span> java.util.Map;
|
||||
|
||||
<span class="kw">import</span> com.opensymphony.xwork2.ActionSupport;
|
||||
|
||||
<span class="kw">public class</span> ExampleAction <span class="kw">extends</span> ActionSupport {
|
||||
<span class="kw">public static final</span> String CONSTANT = "Struts Rocks!";
|
||||
|
||||
<span class="kw">public static</span> Date getCurrentDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String getName() {
|
||||
return "John Galt";
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String[] getBands() {
|
||||
return new String[] { "Pink Floyd", "Metallica", "Guns & Roses" };
|
||||
}
|
||||
|
||||
<span class="kw">public</span> List<String> getMovies() {
|
||||
return Arrays.asList("Lord of the Rings", "Matrix");
|
||||
}
|
||||
|
||||
<span class="kw">public</span> Book getBook() {
|
||||
<span class="kw">return</span> new Book("Iliad", "Homer");
|
||||
}
|
||||
|
||||
<span class="kw">public</span> Map<String, Book> getBooks() {
|
||||
Map<String, Book> books = new HashMap<String, Book>();
|
||||
books.put("Iliad", new Book("Iliad", "Homer"));
|
||||
books.put("The Republic", new Book("The Replublic", "Plato"));
|
||||
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
|
||||
"Friedrich Nietzsche"));
|
||||
return books;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">class</span> Book {
|
||||
<span class="kw">private</span> String title;
|
||||
<span class="kw">private</span> String author;
|
||||
|
||||
<span class="kw">public</span> Book(String title, String author) {
|
||||
this.title = title;
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String getTitle() {
|
||||
<span class="kw">return</span> title;
|
||||
}
|
||||
|
||||
<span class="kw">public void</span> setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
<span class="kw">public</span> String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
<span class="kw">public void</span> setAuthor(String author) {
|
||||
this.author = author;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
@@ -1,247 +1,247 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>OGNL and tags demo</title>
|
||||
<s:url var="struts" value="/struts" includeParams="none"/>
|
||||
<s:url var="jspEval" action="jspEval" namespace="/nodecorate" includeParams="none"/>
|
||||
<s:url var="viewClass" value="/interactive/example-action.jsp" includeParams="none"/>
|
||||
<s:url var="ognlBase" value="/interactive/ognl_" includeParams="none"/>
|
||||
<s:url var="jspBase" value="/interactive/jsp_" includeParams="none"/>
|
||||
|
||||
<script src="${struts}/webconsole.js"></script>
|
||||
<sx:head/>
|
||||
<script>
|
||||
var index = -1;
|
||||
var runningOgnl = true;
|
||||
var ognlBase = "${ognlBase}";
|
||||
var jspBase = "${jspBase}";
|
||||
var ognlCount = 10;
|
||||
var jspCount = 5;
|
||||
|
||||
dojo.addOnLoad(function() {
|
||||
var classSrc = dojo.byId("classSrc");
|
||||
dojo.io.updateNode(classSrc, "${viewClass}");
|
||||
dojo.html.hide("previous");
|
||||
dojo.html.hide("next");
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/reloadGuide", function() {
|
||||
next();
|
||||
});
|
||||
|
||||
function startOgnl() {
|
||||
selectOGNLTab();
|
||||
index = -1;
|
||||
runningOgnl = true;
|
||||
change(1);
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
function startJSP() {
|
||||
selectJSPTab();
|
||||
index = -1;
|
||||
runningOgnl = false;
|
||||
change(1);
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
function execOgnl(id) {
|
||||
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
|
||||
dojo.byId("wc-command").value = exp;
|
||||
|
||||
keyEvent({keyCode : 13}, '${jspEval}');
|
||||
}
|
||||
|
||||
function execJSP(id) {
|
||||
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
|
||||
dojo.byId("jsp").value = unscape(exp);
|
||||
|
||||
dojo.event.topic.publish("/evalJSP")
|
||||
}
|
||||
|
||||
function unscape(str) {
|
||||
return str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, '"');
|
||||
}
|
||||
|
||||
function selectClassSrcTab() {
|
||||
dojo.widget.byId("mainTabContainer").selectTab("classTab");
|
||||
}
|
||||
|
||||
function selectJSPTab() {
|
||||
dojo.widget.byId("mainTabContainer").selectTab("jspTab");
|
||||
}
|
||||
|
||||
function selectOGNLTab() {
|
||||
dojo.widget.byId("mainTabContainer").selectTab("ognlTab");
|
||||
}
|
||||
|
||||
function change(delta) {
|
||||
index+=delta;
|
||||
|
||||
var url = (runningOgnl ? ognlBase : jspBase) + index + ".jsp";
|
||||
var bind = dojo.widget.byId("guideBind");
|
||||
bind.href = url;
|
||||
dojo.event.topic.publish("/loadContent");
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
function updateNavigation() {
|
||||
if(index <= 0) {
|
||||
dojo.html.hide("previous");
|
||||
} else {
|
||||
dojo.html.show("previous");
|
||||
}
|
||||
|
||||
var top = runningOgnl ? ognlCount : jspCount;
|
||||
|
||||
if(index == top - 1) {
|
||||
dojo.html.hide("next");
|
||||
} else {
|
||||
dojo.html.show("next");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style type="">
|
||||
.wc-results {
|
||||
overflow: auto;
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
font-family: courier;
|
||||
color: white;
|
||||
background-color: black;
|
||||
height: 200px;
|
||||
}
|
||||
.wc-results pre {
|
||||
display: inline;
|
||||
}
|
||||
.wc-command {
|
||||
margin: 1px 0 0 0;
|
||||
border-style: none;
|
||||
font-family: courier;
|
||||
color: white;
|
||||
background-color: black;
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
}
|
||||
.shell {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.jsp {
|
||||
border-style: solid;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
.jspResult {
|
||||
border-style: none;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
padding: 5px;
|
||||
}
|
||||
.jspResultHeader {
|
||||
background-color: #818EBD;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 15px;
|
||||
}
|
||||
.jspResultHeader span {
|
||||
padding: 5px;
|
||||
}
|
||||
.classSrc {
|
||||
font-family:Courier;
|
||||
font-size:11px;
|
||||
line-height:13px;
|
||||
overflow: auto;
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
.tabContainer {
|
||||
width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.guideContainer {
|
||||
width: 600px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.guide {
|
||||
padding: 5px;
|
||||
}
|
||||
pre {
|
||||
font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;
|
||||
font-style: italic;
|
||||
}
|
||||
span.kw {
|
||||
color: rgb(127, 0, 85);
|
||||
font-weight: bold;;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<sx:bind id="guideBind" targets="guide" listenTopics="/loadContent"/>
|
||||
|
||||
<body>
|
||||
<sx:tabbedpanel id="mainTabContainer" cssClass="tabContainer">
|
||||
<sx:div label="OGNL Console" id="ognlTab">
|
||||
<div id="shell" class="shell">
|
||||
<form onsubmit="return false" id="wc-form">
|
||||
<div class="wc-results" id="wc-result">
|
||||
Welcome to the OGNL console!
|
||||
<br />
|
||||
:->
|
||||
</div>
|
||||
<input type="hidden" name="debug" value="command" />
|
||||
OGNL Expression <input name="expression" onkeyup="keyEvent(event, '${jspEval}')" class="wc-command" id="wc-command" type="text" />
|
||||
</form>
|
||||
</div>
|
||||
</sx:div>
|
||||
<sx:div label="JSP Console" id="jspTab">
|
||||
<table style="width: 100%" cellpadding="1">
|
||||
<tr valign="top">
|
||||
<td width="50%">
|
||||
<form theme="simple" namespace="/nodecorate" action="jspEval" method="post">
|
||||
<s:textarea cssClass="jsp" theme="simple" name="jsp" />
|
||||
<sx:submit
|
||||
value="Eval JSP Fragment"
|
||||
href="%{#jspEval}"
|
||||
targets="jspResult"
|
||||
listenTopics="/evalJSP"/>
|
||||
</form>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<div class="jspResultHeader">
|
||||
<span>JSP Eval Result</span>
|
||||
</div>
|
||||
<div id="jspResult" class="jspResult">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</sx:div>
|
||||
<sx:div label="Class on top of the Value Stack" id="classTab">
|
||||
<div id="classSrc" class="classSrc">
|
||||
</div>
|
||||
</sx:div>
|
||||
</sx:tabbedpanel>
|
||||
<br/><br/>
|
||||
<div class="guideContainer">
|
||||
<div class="jspResultHeader">
|
||||
<span>Interactive Guide</span>
|
||||
</div>
|
||||
<sx:div id="guide" listenTopics="/reloadGuide" cssClass="guide">
|
||||
<p><a href="#" onclick="startOgnl()">Start OGNL Interactive Demo</a></p>
|
||||
<p><a href="#" onclick="startJSP()">Start JSP Interactive Demo</a></p>
|
||||
</sx:div>
|
||||
<div>
|
||||
<a href="#" id="previous" onclick="change(-1)" style="float: left"><< Previous</a>
|
||||
<a href="#" id="next" onclick="change(1)" style="float: right">Next >></a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>OGNL and tags demo</title>
|
||||
<s:url var="struts" value="/struts" includeParams="none"/>
|
||||
<s:url var="jspEval" action="jspEval" namespace="/nodecorate" includeParams="none"/>
|
||||
<s:url var="viewClass" value="/interactive/example-action.jsp" includeParams="none"/>
|
||||
<s:url var="ognlBase" value="/interactive/ognl_" includeParams="none"/>
|
||||
<s:url var="jspBase" value="/interactive/jsp_" includeParams="none"/>
|
||||
|
||||
<script src="${struts}/webconsole.js"></script>
|
||||
<sx:head/>
|
||||
<script>
|
||||
var index = -1;
|
||||
var runningOgnl = true;
|
||||
var ognlBase = "${ognlBase}";
|
||||
var jspBase = "${jspBase}";
|
||||
var ognlCount = 10;
|
||||
var jspCount = 5;
|
||||
|
||||
dojo.addOnLoad(function() {
|
||||
var classSrc = dojo.byId("classSrc");
|
||||
dojo.io.updateNode(classSrc, "${viewClass}");
|
||||
dojo.html.hide("previous");
|
||||
dojo.html.hide("next");
|
||||
});
|
||||
|
||||
dojo.event.topic.subscribe("/reloadGuide", function() {
|
||||
next();
|
||||
});
|
||||
|
||||
function startOgnl() {
|
||||
selectOGNLTab();
|
||||
index = -1;
|
||||
runningOgnl = true;
|
||||
change(1);
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
function startJSP() {
|
||||
selectJSPTab();
|
||||
index = -1;
|
||||
runningOgnl = false;
|
||||
change(1);
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
function execOgnl(id) {
|
||||
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
|
||||
dojo.byId("wc-command").value = exp;
|
||||
|
||||
keyEvent({keyCode : 13}, '${jspEval}');
|
||||
}
|
||||
|
||||
function execJSP(id) {
|
||||
var exp = dojo.string.trim(dojo.byId(id ? id : "example").innerHTML);
|
||||
dojo.byId("jsp").value = unscape(exp);
|
||||
|
||||
dojo.event.topic.publish("/evalJSP")
|
||||
}
|
||||
|
||||
function unscape(str) {
|
||||
return str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, '"');
|
||||
}
|
||||
|
||||
function selectClassSrcTab() {
|
||||
dojo.widget.byId("mainTabContainer").selectTab("classTab");
|
||||
}
|
||||
|
||||
function selectJSPTab() {
|
||||
dojo.widget.byId("mainTabContainer").selectTab("jspTab");
|
||||
}
|
||||
|
||||
function selectOGNLTab() {
|
||||
dojo.widget.byId("mainTabContainer").selectTab("ognlTab");
|
||||
}
|
||||
|
||||
function change(delta) {
|
||||
index+=delta;
|
||||
|
||||
var url = (runningOgnl ? ognlBase : jspBase) + index + ".jsp";
|
||||
var bind = dojo.widget.byId("guideBind");
|
||||
bind.href = url;
|
||||
dojo.event.topic.publish("/loadContent");
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
function updateNavigation() {
|
||||
if(index <= 0) {
|
||||
dojo.html.hide("previous");
|
||||
} else {
|
||||
dojo.html.show("previous");
|
||||
}
|
||||
|
||||
var top = runningOgnl ? ognlCount : jspCount;
|
||||
|
||||
if(index == top - 1) {
|
||||
dojo.html.hide("next");
|
||||
} else {
|
||||
dojo.html.show("next");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style type="">
|
||||
.wc-results {
|
||||
overflow: auto;
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
font-family: courier;
|
||||
color: white;
|
||||
background-color: black;
|
||||
height: 200px;
|
||||
}
|
||||
.wc-results pre {
|
||||
display: inline;
|
||||
}
|
||||
.wc-command {
|
||||
margin: 1px 0 0 0;
|
||||
border-style: none;
|
||||
font-family: courier;
|
||||
color: white;
|
||||
background-color: black;
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
}
|
||||
.shell {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.jsp {
|
||||
border-style: solid;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
.jspResult {
|
||||
border-style: none;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
padding: 5px;
|
||||
}
|
||||
.jspResultHeader {
|
||||
background-color: #818EBD;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 15px;
|
||||
}
|
||||
.jspResultHeader span {
|
||||
padding: 5px;
|
||||
}
|
||||
.classSrc {
|
||||
font-family:Courier;
|
||||
font-size:11px;
|
||||
line-height:13px;
|
||||
overflow: auto;
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
.tabContainer {
|
||||
width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.guideContainer {
|
||||
width: 600px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.guide {
|
||||
padding: 5px;
|
||||
}
|
||||
pre {
|
||||
font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;
|
||||
font-style: italic;
|
||||
}
|
||||
span.kw {
|
||||
color: rgb(127, 0, 85);
|
||||
font-weight: bold;;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<sx:bind id="guideBind" targets="guide" listenTopics="/loadContent"/>
|
||||
|
||||
<body>
|
||||
<sx:tabbedpanel id="mainTabContainer" cssClass="tabContainer">
|
||||
<sx:div label="OGNL Console" id="ognlTab">
|
||||
<div id="shell" class="shell">
|
||||
<form onsubmit="return false" id="wc-form">
|
||||
<div class="wc-results" id="wc-result">
|
||||
Welcome to the OGNL console!
|
||||
<br />
|
||||
:->
|
||||
</div>
|
||||
<input type="hidden" name="debug" value="command" />
|
||||
OGNL Expression <input name="expression" onkeyup="keyEvent(event, '${jspEval}')" class="wc-command" id="wc-command" type="text" />
|
||||
</form>
|
||||
</div>
|
||||
</sx:div>
|
||||
<sx:div label="JSP Console" id="jspTab">
|
||||
<table style="width: 100%" cellpadding="1">
|
||||
<tr valign="top">
|
||||
<td width="50%">
|
||||
<form theme="simple" namespace="/nodecorate" action="jspEval" method="post">
|
||||
<s:textarea cssClass="jsp" theme="simple" name="jsp" />
|
||||
<sx:submit
|
||||
value="Eval JSP Fragment"
|
||||
href="%{#jspEval}"
|
||||
targets="jspResult"
|
||||
listenTopics="/evalJSP"/>
|
||||
</form>
|
||||
</td>
|
||||
<td width="50%">
|
||||
<div class="jspResultHeader">
|
||||
<span>JSP Eval Result</span>
|
||||
</div>
|
||||
<div id="jspResult" class="jspResult">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</sx:div>
|
||||
<sx:div label="Class on top of the Value Stack" id="classTab">
|
||||
<div id="classSrc" class="classSrc">
|
||||
</div>
|
||||
</sx:div>
|
||||
</sx:tabbedpanel>
|
||||
<br/><br/>
|
||||
<div class="guideContainer">
|
||||
<div class="jspResultHeader">
|
||||
<span>Interactive Guide</span>
|
||||
</div>
|
||||
<sx:div id="guide" listenTopics="/reloadGuide" cssClass="guide">
|
||||
<p><a href="#" onclick="startOgnl()">Start OGNL Interactive Demo</a></p>
|
||||
<p><a href="#" onclick="startJSP()">Start JSP Interactive Demo</a></p>
|
||||
</sx:div>
|
||||
<div>
|
||||
<a href="#" id="previous" onclick="change(-1)" style="float: left"><< Previous</a>
|
||||
<a href="#" id="next" onclick="change(1)" style="float: right">Next >></a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,62 +1,62 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>String Attributes</b>
|
||||
</p>
|
||||
<p>
|
||||
Some tag attributes are expected to be Strings in which case String literals
|
||||
can be passed as the value, like the <i>href</i> attribute in the <i>a</i> tag.
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:a href="http://struts.apache.org/" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
If the value that you want to use in one of these string literal attributes is stored on the Value Stack,
|
||||
then the <i>%{#name}</i> syntax (alternative syntax) needs to be used. Assuming there is a value
|
||||
with the name "url" stored on the stack:
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:a href="%{#url}" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
will create an anchor and use the value of "url" for the <i>href</i> attribute.
|
||||
</p>
|
||||
<p>
|
||||
<b>Value Attributes</b>
|
||||
</p>
|
||||
<p>
|
||||
Other attributes expect an object as their value(not an string literal). In these attributes you can specify
|
||||
the name of a variable stored on the Value Stack, and the tag will look it up and use it. Like the
|
||||
<i>value</i> attribute in the <i>property</i> tag. Assuming there is an object stored on the Value Stack with
|
||||
the name "movie", then:
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:property value="movie" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
will print the value to the page. To pass an String literal to an attribute that expects a value use the <i>%{'string'}</i>
|
||||
notation.
|
||||
</p>
|
||||
<p>
|
||||
If you don't remember if an attribute expects an string literal or a value, you can always use the <i>%{value}</i> notation:
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:a href="%{'http://struts.apache.org/'}" />
|
||||
<br />
|
||||
<s:property value="%{#movie}" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/tag-syntax.html')">[More details]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>String Attributes</b>
|
||||
</p>
|
||||
<p>
|
||||
Some tag attributes are expected to be Strings in which case String literals
|
||||
can be passed as the value, like the <i>href</i> attribute in the <i>a</i> tag.
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:a href="http://struts.apache.org/" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
If the value that you want to use in one of these string literal attributes is stored on the Value Stack,
|
||||
then the <i>%{#name}</i> syntax (alternative syntax) needs to be used. Assuming there is a value
|
||||
with the name "url" stored on the stack:
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:a href="%{#url}" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
will create an anchor and use the value of "url" for the <i>href</i> attribute.
|
||||
</p>
|
||||
<p>
|
||||
<b>Value Attributes</b>
|
||||
</p>
|
||||
<p>
|
||||
Other attributes expect an object as their value(not an string literal). In these attributes you can specify
|
||||
the name of a variable stored on the Value Stack, and the tag will look it up and use it. Like the
|
||||
<i>value</i> attribute in the <i>property</i> tag. Assuming there is an object stored on the Value Stack with
|
||||
the name "movie", then:
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:property value="movie" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
will print the value to the page. To pass an String literal to an attribute that expects a value use the <i>%{'string'}</i>
|
||||
notation.
|
||||
</p>
|
||||
<p>
|
||||
If you don't remember if an attribute expects an string literal or a value, you can always use the <i>%{value}</i> notation:
|
||||
</p>
|
||||
<p>
|
||||
<i>
|
||||
<s:a href="%{'http://struts.apache.org/'}" />
|
||||
<br />
|
||||
<s:property value="%{#movie}" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/tag-syntax.html')">[More details]</a>
|
||||
</p>
|
||||
@@ -1,52 +1,52 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Print property value, using the <i>property tag</i></b>
|
||||
</p>
|
||||
<p>
|
||||
On the OGNL demo you learned how to access values from the Value Stack using OGNL expressions.
|
||||
The <i>property</i> tag is used to print to the page the result of an OGNL expression. The expression
|
||||
is specified in the <i>value</i> attribute.
|
||||
</p>
|
||||
<p>To print the value of the expression <i>name</i> to the page type:
|
||||
<p>
|
||||
<i id="example0">
|
||||
<s:property value="name" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
As you saw in the OGNL demo, to print a property of an object that is not on top of the stack,
|
||||
use the <i>#object.property</i> notation.
|
||||
</p>
|
||||
<p>To print the value for the key "struts.view_uri" in <i>request</i> to the page type:
|
||||
<p>
|
||||
<i id="example1">
|
||||
<s:property value="#request['struts.view_uri']" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b>Print property value, using the <i>$</i> operator</b>
|
||||
</p>
|
||||
<p>Use the <i>${name}</i> notation to print values from the Value Stack to the page.
|
||||
<p>To print the value of the expression <i>name</i> to the page type:
|
||||
<p>
|
||||
<i id="example2">
|
||||
${name}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example2')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More details]</a>
|
||||
</p>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Print property value, using the <i>property tag</i></b>
|
||||
</p>
|
||||
<p>
|
||||
On the OGNL demo you learned how to access values from the Value Stack using OGNL expressions.
|
||||
The <i>property</i> tag is used to print to the page the result of an OGNL expression. The expression
|
||||
is specified in the <i>value</i> attribute.
|
||||
</p>
|
||||
<p>To print the value of the expression <i>name</i> to the page type:
|
||||
<p>
|
||||
<i id="example0">
|
||||
<s:property value="name" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
As you saw in the OGNL demo, to print a property of an object that is not on top of the stack,
|
||||
use the <i>#object.property</i> notation.
|
||||
</p>
|
||||
<p>To print the value for the key "struts.view_uri" in <i>request</i> to the page type:
|
||||
<p>
|
||||
<i id="example1">
|
||||
<s:property value="#request['struts.view_uri']" />
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b>Print property value, using the <i>$</i> operator</b>
|
||||
</p>
|
||||
<p>Use the <i>${name}</i> notation to print values from the Value Stack to the page.
|
||||
<p>To print the value of the expression <i>name</i> to the page type:
|
||||
<p>
|
||||
<i id="example2">
|
||||
${name}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example2')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More details]</a>
|
||||
</p>
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b><i>if</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>if</i> tag allows you to optionally execute a JSP section. Multiple <i>elseif</i> tags
|
||||
and one <i>else</i> tag can be associated to an <i>if tag</i>.
|
||||
</p>
|
||||
<p>
|
||||
To say hello to John Galt type:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example0">
|
||||
<s:if test="name == 'John Galt'">
|
||||
Hi John
|
||||
</s:if>
|
||||
<s:else>
|
||||
I don't know you!
|
||||
</s:else>
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b><i>iterator</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>iterator</i> tag loops over an <i>Iterable</i> object one object at a time into
|
||||
the Value Stack (the value will be on top of the stack).
|
||||
</p>
|
||||
<p>
|
||||
To print the all the elements in the "bands" property type:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example1">
|
||||
<s:iterator value="bands">
|
||||
<s:property />
|
||||
<br />
|
||||
</s:iterator>
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More on the <i>if</i> tag]</a>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/iterator.html')">[More on the <i>iterator</i> tag]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b><i>if</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>if</i> tag allows you to optionally execute a JSP section. Multiple <i>elseif</i> tags
|
||||
and one <i>else</i> tag can be associated to an <i>if tag</i>.
|
||||
</p>
|
||||
<p>
|
||||
To say hello to John Galt type:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example0">
|
||||
<s:if test="name == 'John Galt'">
|
||||
Hi John
|
||||
</s:if>
|
||||
<s:else>
|
||||
I don't know you!
|
||||
</s:else>
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b><i>iterator</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>iterator</i> tag loops over an <i>Iterable</i> object one object at a time into
|
||||
the Value Stack (the value will be on top of the stack).
|
||||
</p>
|
||||
<p>
|
||||
To print the all the elements in the "bands" property type:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example1">
|
||||
<s:iterator value="bands">
|
||||
<s:property />
|
||||
<br />
|
||||
</s:iterator>
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
on the JSP console and hit enter. <a href="#" onclick="execJSP('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/property.html')">[More on the <i>if</i> tag]</a>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/iterator.html')">[More on the <i>iterator</i> tag]</a>
|
||||
</p>
|
||||
@@ -1,65 +1,65 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b><i>set</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>set</i> tag sets the variable with the name specified in the <i>name</i> attribute to
|
||||
the value specified in the <i>value</i> attribute in the scope
|
||||
entered in the <i>scope</i> attribute. The available scopes are:
|
||||
<ul>
|
||||
<li>application - application scope according to servlet spec</li>
|
||||
<li>session - session scope according to servlet spec</li>
|
||||
<li>request - request scope according to servlet spec</li>
|
||||
<li>page - page scope according to servlet sepc</li>
|
||||
<li>action - the value will be set in the request scope and Struts' action context</li>
|
||||
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
This example sets <i>favouriteBand</i> in the request scope to the first element of the <i>bands</i> property:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example0">
|
||||
<s:set name="favouriteBand" value="bands[0]" />
|
||||
<s:property value="#favouriteBand" />
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="execJSP('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b><i>url</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>url</i> tag is used to build urls (who would have guessed!). To build an url mapping to
|
||||
an action, set the <i>namespace</i> and <i>action</i> attributes. The url will be stored under
|
||||
the name specified in the <i>id</i> attribute. <b>url tag uses the <i>id</i> attribute while
|
||||
the <i>set</i> tag uses name</b>. To specify a value (no action lookup), just use the <i>value</i>
|
||||
attribute. <i>param</i> tags can be nested inside the <i>url</i> tag to add parameters to the url.
|
||||
</p>
|
||||
<p>
|
||||
First link creates a url that maps to an action, second one creates a url to google, passing one parameter:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example1">
|
||||
<s:url id="evalAction" namespace="/nodecorate" action="jspEval" />
|
||||
<s:a href="%{#evalAction}" >Eval</s:a>
|
||||
|
||||
<s:url id="google" value="http://www.google.com" >
|
||||
<s:param name="q" value="%{'Struts 2'}" />
|
||||
</s:url>
|
||||
<s:a href="%{#google}" >Eval</s:a>
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="execJSP('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/set.html')">[More on the <i>set</i> tag]</a>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/url.html')">[More on the <i>url</i> tag]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b><i>set</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>set</i> tag sets the variable with the name specified in the <i>name</i> attribute to
|
||||
the value specified in the <i>value</i> attribute in the scope
|
||||
entered in the <i>scope</i> attribute. The available scopes are:
|
||||
<ul>
|
||||
<li>application - application scope according to servlet spec</li>
|
||||
<li>session - session scope according to servlet spec</li>
|
||||
<li>request - request scope according to servlet spec</li>
|
||||
<li>page - page scope according to servlet sepc</li>
|
||||
<li>action - the value will be set in the request scope and Struts' action context</li>
|
||||
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
This example sets <i>favouriteBand</i> in the request scope to the first element of the <i>bands</i> property:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example0">
|
||||
<s:set name="favouriteBand" value="bands[0]" />
|
||||
<s:property value="#favouriteBand" />
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="execJSP('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b><i>url</i> tag</b>
|
||||
</p>
|
||||
<p>
|
||||
The <i>url</i> tag is used to build urls (who would have guessed!). To build an url mapping to
|
||||
an action, set the <i>namespace</i> and <i>action</i> attributes. The url will be stored under
|
||||
the name specified in the <i>id</i> attribute. <b>url tag uses the <i>id</i> attribute while
|
||||
the <i>set</i> tag uses name</b>. To specify a value (no action lookup), just use the <i>value</i>
|
||||
attribute. <i>param</i> tags can be nested inside the <i>url</i> tag to add parameters to the url.
|
||||
</p>
|
||||
<p>
|
||||
First link creates a url that maps to an action, second one creates a url to google, passing one parameter:
|
||||
</p>
|
||||
<p>
|
||||
<pre id="example1">
|
||||
<s:url id="evalAction" namespace="/nodecorate" action="jspEval" />
|
||||
<s:a href="%{#evalAction}" >Eval</s:a>
|
||||
|
||||
<s:url id="google" value="http://www.google.com" >
|
||||
<s:param name="q" value="%{'Struts 2'}" />
|
||||
</s:url>
|
||||
<s:a href="%{#google}" >Eval</s:a>
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="execJSP('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/set.html')">[More on the <i>set</i> tag]</a>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/url.html')">[More on the <i>url</i> tag]</a>
|
||||
</p>
|
||||
@@ -1,16 +1,16 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>More on JSP tags</b>
|
||||
</p>
|
||||
<p>
|
||||
Struts 2 provides many more tags which you can learn about
|
||||
<a href="#" onclick="window.open('http://cwiki.apache.org/confluence/display/WW/Tag+Reference')">here</a>
|
||||
</p>
|
||||
<br/>
|
||||
You can keep playing with the JSP console or
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>More on JSP tags</b>
|
||||
</p>
|
||||
<p>
|
||||
Struts 2 provides many more tags which you can learn about
|
||||
<a href="#" onclick="window.open('http://cwiki.apache.org/confluence/display/WW/Tag+Reference')">here</a>
|
||||
</p>
|
||||
<br/>
|
||||
You can keep playing with the JSP console or
|
||||
<a href="#" onclick="startOgnl()">Start OGNL Interactive Demo</a>
|
||||
@@ -1,30 +1,30 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties</b>
|
||||
</p>
|
||||
<p>
|
||||
The framework uses a standard naming context to evaluate OGNL expressions.
|
||||
The top level object dealing with OGNL is a Map (usually referred as a context map or context).
|
||||
OGNL has a notion of there being a root (or default) object within the context.
|
||||
In OGNL expressions, the properties of the root object can be referenced without any special "marker" notion.
|
||||
References to other objects are marked with a pound sign (#).
|
||||
|
||||
In this example (and in your JSP pages) the last action executed will be on the top of the stack.
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="selectClassSrcTab()">This action</a> is available on the third tab above.
|
||||
To access the <i>name</i> field type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
name
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties</b>
|
||||
</p>
|
||||
<p>
|
||||
The framework uses a standard naming context to evaluate OGNL expressions.
|
||||
The top level object dealing with OGNL is a Map (usually referred as a context map or context).
|
||||
OGNL has a notion of there being a root (or default) object within the context.
|
||||
In OGNL expressions, the properties of the root object can be referenced without any special "marker" notion.
|
||||
References to other objects are marked with a pound sign (#).
|
||||
|
||||
In this example (and in your JSP pages) the last action executed will be on the top of the stack.
|
||||
</p>
|
||||
<p>
|
||||
<a href="#" onclick="selectClassSrcTab()">This action</a> is available on the third tab above.
|
||||
To access the <i>name</i> field type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
name
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
@@ -1,28 +1,28 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing nested properties</b>
|
||||
</p>
|
||||
<p>
|
||||
To access nested properties, use the dot "." operator to concatenate the property names. The action
|
||||
class has a <i>book</i> field, with <i>title</i> and <i>author</i> fields.
|
||||
</p>
|
||||
<p>
|
||||
To access the name of the book type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
book.title
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/properties.html')">[More details]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing nested properties</b>
|
||||
</p>
|
||||
<p>
|
||||
To access nested properties, use the dot "." operator to concatenate the property names. The action
|
||||
class has a <i>book</i> field, with <i>title</i> and <i>author</i> fields.
|
||||
</p>
|
||||
<p>
|
||||
To access the name of the book type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
book.title
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/properties.html')">[More details]</a>
|
||||
</p>
|
||||
@@ -1,43 +1,43 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties inside Arrays</b>
|
||||
</p>
|
||||
<p>
|
||||
To access properties inside arrays, use the brackets "[]" operators with the desired index(starting from 0). The action
|
||||
class has an array of String in the field <i>bands</i>.
|
||||
</p>
|
||||
<p>
|
||||
To access the second element in the <i>bands</i> array type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
bands[1]
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b>Accessing properties inside Lists</b>
|
||||
</p>
|
||||
<p>Lists can be accessed on the same way. The action class has a List of String on the field <i>movies</i>.</p>
|
||||
<p>
|
||||
To access the first element in the <i>movies</i> list type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
movies[0]
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
|
||||
</p>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties inside Arrays</b>
|
||||
</p>
|
||||
<p>
|
||||
To access properties inside arrays, use the brackets "[]" operators with the desired index(starting from 0). The action
|
||||
class has an array of String in the field <i>bands</i>.
|
||||
</p>
|
||||
<p>
|
||||
To access the second element in the <i>bands</i> array type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
bands[1]
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
<b>Accessing properties inside Lists</b>
|
||||
</p>
|
||||
<p>Lists can be accessed on the same way. The action class has a List of String on the field <i>movies</i>.</p>
|
||||
<p>
|
||||
To access the first element in the <i>movies</i> list type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
movies[0]
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
|
||||
</p>
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties inside Maps</b>
|
||||
</p>
|
||||
<p>
|
||||
To access properties inside maps, use the brackets "[]" operators with the desired key. The action
|
||||
class has a map of Book objects in the field <i>books</i>.
|
||||
</p>
|
||||
<p>
|
||||
To access the book with key "Iliad" in the <i>books</i> map type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
books['Iliad']
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>If the key does not have spaces in it, you can access an element in the map, using the dot "." operator.</p>
|
||||
<p>
|
||||
To access the book with key "Iliad" in the <i>books</i> map type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
books.Iliad
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
Note that the object returned is of type Book. If you want to access one of its properties, you can do so using the dot
|
||||
"." operator as you did before.</p>
|
||||
<p>
|
||||
To access the <i>author</i> property of the book with key "Iliad" in the <i>books</i> map type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
books['Iliad'].author
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
|
||||
</p>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties inside Maps</b>
|
||||
</p>
|
||||
<p>
|
||||
To access properties inside maps, use the brackets "[]" operators with the desired key. The action
|
||||
class has a map of Book objects in the field <i>books</i>.
|
||||
</p>
|
||||
<p>
|
||||
To access the book with key "Iliad" in the <i>books</i> map type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
books['Iliad']
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>If the key does not have spaces in it, you can access an element in the map, using the dot "." operator.</p>
|
||||
<p>
|
||||
To access the book with key "Iliad" in the <i>books</i> map type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
books.Iliad
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
Note that the object returned is of type Book. If you want to access one of its properties, you can do so using the dot
|
||||
"." operator as you did before.</p>
|
||||
<p>
|
||||
To access the <i>author</i> property of the book with key "Iliad" in the <i>books</i> map type:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
books['Iliad'].author
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/indexing.html#N10184')">[More details]</a>
|
||||
</p>
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties on the stack</b>
|
||||
</p>
|
||||
<p>
|
||||
Object that are not on the top of the Value Stack are accessed using the "#name" notation.
|
||||
Some objects are always pushed into the stack by Struts, like:
|
||||
</p>
|
||||
<ul>
|
||||
<li>#application</li>
|
||||
<li>#session</li>
|
||||
<li>#request</li>
|
||||
<li>#parameters</li>
|
||||
</ul>
|
||||
<p>To see the value of the first parameter type:</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
#parameters['debug'][0]
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/ognl.html')">[More details]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Accessing properties on the stack</b>
|
||||
</p>
|
||||
<p>
|
||||
Object that are not on the top of the Value Stack are accessed using the "#name" notation.
|
||||
Some objects are always pushed into the stack by Struts, like:
|
||||
</p>
|
||||
<ul>
|
||||
<li>#application</li>
|
||||
<li>#session</li>
|
||||
<li>#request</li>
|
||||
<li>#parameters</li>
|
||||
</ul>
|
||||
<p>To see the value of the first parameter type:</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
#parameters['debug'][0]
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://struts.apache.org/2.x/docs/ognl.html')">[More details]</a>
|
||||
</p>
|
||||
@@ -1,37 +1,37 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Static fields</b>
|
||||
</p>
|
||||
<p>
|
||||
Static fields can easily be accessed in OGNL expressions using the notation
|
||||
<i>@some.package.ClassName@PROPERTY_NAME</i> for properties, and <i>@some.package.ClassName@METHOD_NAME()</i>
|
||||
for methods.
|
||||
</p>
|
||||
<p>To access the value of the <i>CONSTANT</i> field in the ExampleAction type:</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
@org.apache.struts2.showcase.action.ExampleAction@CONSTANT
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>To execute the static method <i>getCurrentDate</i> in the ExampleAction type:</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
@org.apache.struts2.showcase.action.ExampleAction@getCurrentDate()
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticFields.html')">[More details on static fields]</a>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticMethods.html')">[More details on static methods]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Static fields</b>
|
||||
</p>
|
||||
<p>
|
||||
Static fields can easily be accessed in OGNL expressions using the notation
|
||||
<i>@some.package.ClassName@PROPERTY_NAME</i> for properties, and <i>@some.package.ClassName@METHOD_NAME()</i>
|
||||
for methods.
|
||||
</p>
|
||||
<p>To access the value of the <i>CONSTANT</i> field in the ExampleAction type:</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
@org.apache.struts2.showcase.action.ExampleAction@CONSTANT
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>To execute the static method <i>getCurrentDate</i> in the ExampleAction type:</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
@org.apache.struts2.showcase.action.ExampleAction@getCurrentDate()
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticFields.html')">[More details on static fields]</a>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticMethods.html')">[More details on static methods]</a>
|
||||
</p>
|
||||
@@ -1,25 +1,25 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Calling methods</b>
|
||||
</p>
|
||||
<p>
|
||||
OGNL follows Java's syntax to execute a method.
|
||||
</p>
|
||||
<p>To execute the <i>getTitle()</i> method on the <i>book</i> object type:</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
book.getTitle()
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/methods.html')">[More details]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Calling methods</b>
|
||||
</p>
|
||||
<p>
|
||||
OGNL follows Java's syntax to execute a method.
|
||||
</p>
|
||||
<p>To execute the <i>getTitle()</i> method on the <i>book</i> object type:</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
book.getTitle()
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/methods.html')">[More details]</a>
|
||||
</p>
|
||||
@@ -1,43 +1,43 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Expressions</b>
|
||||
</p>
|
||||
<p>
|
||||
OGNL supports expressions using primitive values.
|
||||
</p>
|
||||
<p>Arithmetic:</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
(6 - 2)/2
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>Logical:</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
(true || false) and true
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>Equality:</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
'a' == 'a'
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
OGNL supports many more operators and expressions, see <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/apa.html#operators')">[Operators Reference]</a>
|
||||
for more details.
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Expressions</b>
|
||||
</p>
|
||||
<p>
|
||||
OGNL supports expressions using primitive values.
|
||||
</p>
|
||||
<p>Arithmetic:</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
(6 - 2)/2
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>Logical:</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
(true || false) and true
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>Equality:</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
'a' == 'a'
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
OGNL supports many more operators and expressions, see <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/apa.html#operators')">[Operators Reference]</a>
|
||||
for more details.
|
||||
</p>
|
||||
@@ -1,55 +1,55 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p><b>Creating arrays</b></p>
|
||||
<p>
|
||||
OGNL follows Java syntax to create arrys.
|
||||
</p>
|
||||
<p>
|
||||
Create an array of integers:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
new int[] {0, 1, 2}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating lists</b></p>
|
||||
<p>
|
||||
To create a list, enclose a list of comma separated expression in a pair of braces.
|
||||
</p>
|
||||
<p>
|
||||
Create a list of Strings:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
{'Is', 'there', 'any', 'body', 'out', 'there?'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating maps</b></p>
|
||||
<p>
|
||||
To create a map, use the syntax #@MAP_TYPE@{key:value}.
|
||||
</p>
|
||||
<p>
|
||||
Create a LinkedHashMap:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
#@java.util.LinkedHashMap@{'name': 'John Galt', 'job' : 'Engineer'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/collectionConstruction.html#listConstruction')">[More details]</a>
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p><b>Creating arrays</b></p>
|
||||
<p>
|
||||
OGNL follows Java syntax to create arrys.
|
||||
</p>
|
||||
<p>
|
||||
Create an array of integers:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
new int[] {0, 1, 2}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating lists</b></p>
|
||||
<p>
|
||||
To create a list, enclose a list of comma separated expression in a pair of braces.
|
||||
</p>
|
||||
<p>
|
||||
Create a list of Strings:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
{'Is', 'there', 'any', 'body', 'out', 'there?'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating maps</b></p>
|
||||
<p>
|
||||
To create a map, use the syntax #@MAP_TYPE@{key:value}.
|
||||
</p>
|
||||
<p>
|
||||
Create a LinkedHashMap:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
#@java.util.LinkedHashMap@{'name': 'John Galt', 'job' : 'Engineer'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/collectionConstruction.html#listConstruction')">[More details]</a>
|
||||
</p>
|
||||
@@ -1,18 +1,18 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>More on OGNL</b>
|
||||
</p>
|
||||
<p>
|
||||
There are a lot of OGNL features that we have not covered on this short tutorial.
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
To learn more see the <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html')">[OGNL Documentation]</a>
|
||||
</p>
|
||||
You can keep playing with the OGNL console or
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>More on OGNL</b>
|
||||
</p>
|
||||
<p>
|
||||
There are a lot of OGNL features that we have not covered on this short tutorial.
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
To learn more see the <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html')">[OGNL Documentation]</a>
|
||||
</p>
|
||||
You can keep playing with the OGNL console or
|
||||
<a href="#" onclick="startJSP()">Start JSP Interactive Demo</a>
|
||||
@@ -1,25 +1,25 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<sx:head extraLocales="en-us,nl-nl,de-de" />
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<sx:datetimepicker label="toggleType='wipe'" value="%{'2006-10-31'}" toggleType="wipe" toggleDuration="300" name="test"/>
|
||||
<sx:datetimepicker label="toggleType='explode'" value="%{'2006-07-22'}" toggleType="explode" toggleDuration="500" id="dp2"/>
|
||||
<sx:datetimepicker label="toggleType='fade'" value="%{'2006-06-30'}" toggleType="fade" toggleDuration="500"/>
|
||||
<sx:datetimepicker label="With value='today'" name="dddp1" value="%{'today'}" />
|
||||
<sx:datetimepicker label="US format, empty" name="dddp2" language="en-us" />
|
||||
<sx:datetimepicker label="US format with initial date of 2006-06-26" name="dddp3" value="%{'2006-06-26'}" language="en-us" />
|
||||
<sx:datetimepicker label="With initial date of 1969-04-25 and a custom format dd/MM/yyyy" name="dddp5" value="%{'25/04/1969'}" displayFormat="dd/MM/yyyy" />
|
||||
<sx:datetimepicker label="In German" name="dddp7" value="%{'2006-06-28'}" language="de-de" />
|
||||
<sx:datetimepicker label="In Dutch" name="dddp8" value="%{'2006-06-28'}" language="nl-nl" />
|
||||
<sx:datetimepicker label="US format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp12" value="%{'2006-06-26'}" formatLength="long" language="en-us" />
|
||||
<sx:datetimepicker label="German format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp13" value="%{'2006-06-26'}" formatLength="long" language="de" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<sx:head extraLocales="en-us,nl-nl,de-de" />
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<sx:datetimepicker label="toggleType='wipe'" value="%{'2006-10-31'}" toggleType="wipe" toggleDuration="300" name="test"/>
|
||||
<sx:datetimepicker label="toggleType='explode'" value="%{'2006-07-22'}" toggleType="explode" toggleDuration="500" id="dp2"/>
|
||||
<sx:datetimepicker label="toggleType='fade'" value="%{'2006-06-30'}" toggleType="fade" toggleDuration="500"/>
|
||||
<sx:datetimepicker label="With value='today'" name="dddp1" value="%{'today'}" />
|
||||
<sx:datetimepicker label="US format, empty" name="dddp2" language="en-us" />
|
||||
<sx:datetimepicker label="US format with initial date of 2006-06-26" name="dddp3" value="%{'2006-06-26'}" language="en-us" />
|
||||
<sx:datetimepicker label="With initial date of 1969-04-25 and a custom format dd/MM/yyyy" name="dddp5" value="%{'25/04/1969'}" displayFormat="dd/MM/yyyy" />
|
||||
<sx:datetimepicker label="In German" name="dddp7" value="%{'2006-06-28'}" language="de-de" />
|
||||
<sx:datetimepicker label="In Dutch" name="dddp8" value="%{'2006-06-28'}" language="nl-nl" />
|
||||
<sx:datetimepicker label="US format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp12" value="%{'2006-06-26'}" formatLength="long" language="en-us" />
|
||||
<sx:datetimepicker label="German format with initial date of 2006-06-26 and long formatting (parse not supported)" name="dddp13" value="%{'2006-06-26'}" formatLength="long" language="de" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="s" uri="/struts-tags" %>
|
||||
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<sx:head extraLocales="en-us,nl-nl,de-de"/>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<sx:datetimepicker label="toggleType='wipe'" type="time" value="%{'10:30'}" toggleType="wipe" toggleDuration="300"/>
|
||||
<sx:datetimepicker label="toggleType='explode'" type="time" value="%{'13:00'}" toggleType="explode" toggleDuration="500"/>
|
||||
<sx:datetimepicker label="toggleType='fade'" type="time" value="%{'13:00'}" toggleType="fade" toggleDuration="500"/>
|
||||
<sx:datetimepicker label="With value='today'" name="dddp4" type="time" value="%{'today'}" />
|
||||
<sx:datetimepicker label="US format, empty" name="dddp5" type="time" language="en-us" />
|
||||
<sx:datetimepicker label="US format, 13:00 hours" name="dddp6" type="time" value="%{'13:00'}" language="en-us" />
|
||||
<sx:datetimepicker label="In German" name="dddp7" type="time" value="%{'13:00'}" language="de" />
|
||||
<sx:datetimepicker label="In Dutch" name="dddp8" type="time" value="%{'13:00'}" language="nl" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>UI Tags Example</title>
|
||||
<sx:head extraLocales="en-us,nl-nl,de-de"/>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<sx:datetimepicker label="toggleType='wipe'" type="time" value="%{'10:30'}" toggleType="wipe" toggleDuration="300"/>
|
||||
<sx:datetimepicker label="toggleType='explode'" type="time" value="%{'13:00'}" toggleType="explode" toggleDuration="500"/>
|
||||
<sx:datetimepicker label="toggleType='fade'" type="time" value="%{'13:00'}" toggleType="fade" toggleDuration="500"/>
|
||||
<sx:datetimepicker label="With value='today'" name="dddp4" type="time" value="%{'today'}" />
|
||||
<sx:datetimepicker label="US format, empty" name="dddp5" type="time" language="en-us" />
|
||||
<sx:datetimepicker label="US format, 13:00 hours" name="dddp6" type="time" value="%{'13:00'}" language="en-us" />
|
||||
<sx:datetimepicker label="In German" name="dddp7" type="time" value="%{'13:00'}" language="de" />
|
||||
<sx:datetimepicker label="In Dutch" name="dddp8" type="time" value="%{'13:00'}" language="nl" />
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="struts2-core" default="default">
|
||||
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<!-- directories -->
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<property name="src.dir" value="src/core/src/main/java"/>
|
||||
<property name="build.dir" value="build"/>
|
||||
<property name="build.classes.dir" value="${build.dir}/classes"/>
|
||||
<property name="dist.dir" value="dist"/>
|
||||
<property name="lib.dir" value="lib"/>
|
||||
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<!-- paths -->
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${build.classes.dir}"/>
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<!-- targets -->
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<target name="default"
|
||||
depends="dist"
|
||||
description="default: build everything"
|
||||
/>
|
||||
|
||||
<target name="clean" description="remove all built files">
|
||||
<delete dir="${build.dir}" />
|
||||
<delete dir="${dist.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="dist"
|
||||
depends="compile"
|
||||
description="create distributables (jars etc)">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
<jar jarfile="${dist.dir}/struts2-core.jar">
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="compile" description="compile java">
|
||||
<mkdir dir="${build.classes.dir}" />
|
||||
<javac srcdir="${src.dir}"
|
||||
destdir="${build.classes.dir}"
|
||||
classpathref="compile.classpath"
|
||||
debug="on"
|
||||
deprecation="on"/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
<?xml version="1.0"?>
|
||||
<project name="struts2-core" default="default">
|
||||
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<!-- directories -->
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<property name="src.dir" value="src/core/src/main/java"/>
|
||||
<property name="build.dir" value="build"/>
|
||||
<property name="build.classes.dir" value="${build.dir}/classes"/>
|
||||
<property name="dist.dir" value="dist"/>
|
||||
<property name="lib.dir" value="lib"/>
|
||||
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<!-- paths -->
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<path id="compile.classpath">
|
||||
<pathelement location="${build.classes.dir}"/>
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<!-- targets -->
|
||||
<!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
|
||||
<target name="default"
|
||||
depends="dist"
|
||||
description="default: build everything"
|
||||
/>
|
||||
|
||||
<target name="clean" description="remove all built files">
|
||||
<delete dir="${build.dir}" />
|
||||
<delete dir="${dist.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="dist"
|
||||
depends="compile"
|
||||
description="create distributables (jars etc)">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
<jar jarfile="${dist.dir}/struts2-core.jar">
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="compile" description="compile java">
|
||||
<mkdir dir="${build.classes.dir}" />
|
||||
<javac srcdir="${src.dir}"
|
||||
destdir="${build.classes.dir}"
|
||||
classpathref="compile.classpath"
|
||||
debug="on"
|
||||
deprecation="on"/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
+28
-28
@@ -1,28 +1,28 @@
|
||||
|
||||
ASM: a very small and fast Java bytecode manipulation framework
|
||||
Copyright (c) 2000-2005 INRIA, France Telecom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
ASM: a very small and fast Java bytecode manipulation framework
|
||||
Copyright (c) 2000-2005 INRIA, France Telecom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
+26
-26
@@ -1,26 +1,26 @@
|
||||
Copyright (c) 2005 - 2007 Taras Puchko
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Copyright (c) 2005 - 2007 Taras Puchko
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
Retrotranslator: a Java bytecode transformer that translates Java classes
|
||||
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
|
||||
|
||||
Copyright (c) 2005, 2006 Taras Puchko
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Retrotranslator: a Java bytecode transformer that translates Java classes
|
||||
compiled with JDK 5.0 into classes that can be run on JVM 1.4.
|
||||
|
||||
Copyright (c) 2005, 2006 Taras Puchko
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
STRUTS 2 FOR JAVA 4
|
||||
|
||||
Struts 2 is targeted for Java 5, but a "backported" version to Java 4 is being made available,
|
||||
using the RetroTranslator tool.
|
||||
|
||||
To use Struts 2 with Java 4 (preferably Java 1.4.2), place the enclosed Struts, XWork,
|
||||
RetroTranslator, and backport-util-concurrent JARs on your classpath. For complete details on
|
||||
using RetroTranslator JARs, see the RetroTranslator site.
|
||||
|
||||
* http://retrotranslator.sourceforge.net/
|
||||
|
||||
NOTE: The Struts 2 and XWork 2 JARs are complete replacements for the corresponding standard
|
||||
Java 5 JARs. Do not use both sets of JARs in the same environment!
|
||||
|
||||
If you discover any issues using the Struts 2 for Java 4 JAR, please report them to the Struts
|
||||
Dev list or JIRA ticket ww-1391.
|
||||
|
||||
* http://struts.apache.org/mail.html
|
||||
|
||||
* https://issues.apache.org/struts/browse/WW-1391
|
||||
|
||||
Cheers!
|
||||
STRUTS 2 FOR JAVA 4
|
||||
|
||||
Struts 2 is targeted for Java 5, but a "backported" version to Java 4 is being made available,
|
||||
using the RetroTranslator tool.
|
||||
|
||||
To use Struts 2 with Java 4 (preferably Java 1.4.2), place the enclosed Struts, XWork,
|
||||
RetroTranslator, and backport-util-concurrent JARs on your classpath. For complete details on
|
||||
using RetroTranslator JARs, see the RetroTranslator site.
|
||||
|
||||
* http://retrotranslator.sourceforge.net/
|
||||
|
||||
NOTE: The Struts 2 and XWork 2 JARs are complete replacements for the corresponding standard
|
||||
Java 5 JARs. Do not use both sets of JARs in the same environment!
|
||||
|
||||
If you discover any issues using the Struts 2 for Java 4 JAR, please report them to the Struts
|
||||
Dev list or JIRA ticket ww-1391.
|
||||
|
||||
* http://struts.apache.org/mail.html
|
||||
|
||||
* https://issues.apache.org/struts/browse/WW-1391
|
||||
|
||||
Cheers!
|
||||
|
||||
+174
-174
@@ -1,174 +1,174 @@
|
||||
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.
|
||||
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.
|
||||
|
||||
+49
-49
@@ -1,50 +1,50 @@
|
||||
/* ====================================================================
|
||||
* The OpenSymphony Software License, Version 1.1
|
||||
*
|
||||
* (this license is derived and fully compatible with the Apache Software
|
||||
* License - see http://www.apache.org/LICENSE.txt)
|
||||
*
|
||||
* Copyright (c) 2001-2004 The OpenSymphony Group. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* OpenSymphony Group (http://www.opensymphony.com/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "OpenSymphony" and "The OpenSymphony Group"
|
||||
* must not be used to endorse or promote products derived from this
|
||||
* software without prior written permission. For written
|
||||
* permission, please contact license@opensymphony.com .
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSymphony"
|
||||
* or "XWork", nor may "OpenSymphony" or "XWork" appear in their
|
||||
* name, without prior written permission of the OpenSymphony Group.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
/* ====================================================================
|
||||
* The OpenSymphony Software License, Version 1.1
|
||||
*
|
||||
* (this license is derived and fully compatible with the Apache Software
|
||||
* License - see http://www.apache.org/LICENSE.txt)
|
||||
*
|
||||
* Copyright (c) 2001-2004 The OpenSymphony Group. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* OpenSymphony Group (http://www.opensymphony.com/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "OpenSymphony" and "The OpenSymphony Group"
|
||||
* must not be used to endorse or promote products derived from this
|
||||
* software without prior written permission. For written
|
||||
* permission, please contact license@opensymphony.com .
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSymphony"
|
||||
* or "XWork", nor may "OpenSymphony" or "XWork" appear in their
|
||||
* name, without prior written permission of the OpenSymphony Group.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*/
|
||||
@@ -1,3 +1,3 @@
|
||||
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-core-2.1.1-SNAPSHOT.jar -destjar struts2-core-backport-2.1.1-SNAPSHOT.jar
|
||||
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-api-2.1.1-SNAPSHOT.jar -destjar struts2-api-backport-2.1.1-SNAPSHOT.jar
|
||||
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/xwork-2.1.1-SNAPSHOT.jar -destjar xwork-backport-2.1.1-SNAPSHOT.jar
|
||||
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-core-2.1.1-SNAPSHOT.jar -destjar struts2-core-backport-2.1.1-SNAPSHOT.jar
|
||||
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/struts2-api-2.1.1-SNAPSHOT.jar -destjar struts2-api-backport-2.1.1-SNAPSHOT.jar
|
||||
java -jar retrotranslator-transformer-1.2.3.jar -advanced -srcjar ../lib/xwork-2.1.1-SNAPSHOT.jar -destjar xwork-backport-2.1.1-SNAPSHOT.jar
|
||||
|
||||
@@ -1,62 +1,62 @@
|
||||
/*
|
||||
* $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 org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* Base class for control and data tags
|
||||
*/
|
||||
public abstract class ContextBean extends Component {
|
||||
protected String var;
|
||||
|
||||
public ContextBean(ValueStack stack) {
|
||||
super(stack);
|
||||
}
|
||||
|
||||
protected void putInContext(Object value) {
|
||||
if (var != null && var.length() > 0) {
|
||||
stack.getContext().put(var, value);
|
||||
}
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Name used to reference the value pushed into the Value Stack")
|
||||
public void setVar(String var) {
|
||||
if (var != null) {
|
||||
this.var = findString(var);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To keep backward compatibility
|
||||
* TODO remove after 2.1
|
||||
*/
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
|
||||
public void setId(String id) {
|
||||
setVar(id);
|
||||
}
|
||||
|
||||
protected String getVar() {
|
||||
return this.var;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* $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 org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* Base class for control and data tags
|
||||
*/
|
||||
public abstract class ContextBean extends Component {
|
||||
protected String var;
|
||||
|
||||
public ContextBean(ValueStack stack) {
|
||||
super(stack);
|
||||
}
|
||||
|
||||
protected void putInContext(Object value) {
|
||||
if (var != null && var.length() > 0) {
|
||||
stack.getContext().put(var, value);
|
||||
}
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Name used to reference the value pushed into the Value Stack")
|
||||
public void setVar(String var) {
|
||||
if (var != null) {
|
||||
this.var = findString(var);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To keep backward compatibility
|
||||
* TODO remove after 2.1
|
||||
*/
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'var' instead")
|
||||
public void setId(String id) {
|
||||
setVar(id);
|
||||
}
|
||||
|
||||
protected String getVar() {
|
||||
return this.var;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,200 +1,200 @@
|
||||
/*
|
||||
* $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.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Implementation of the {@link UrlRenderer} interface that creates URLs suitable in a servlet environment.
|
||||
*
|
||||
*/
|
||||
public class ServletUrlRenderer implements UrlRenderer {
|
||||
/**
|
||||
* Provide a logging instance.
|
||||
*/
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ServletUrlRenderer.class);
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void renderUrl(Writer writer, URL urlComponent) {
|
||||
String scheme = urlComponent.req.getScheme();
|
||||
|
||||
if (urlComponent.scheme != null) {
|
||||
scheme = urlComponent.scheme;
|
||||
}
|
||||
|
||||
String result;
|
||||
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.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.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
|
||||
}
|
||||
if ( urlComponent.anchor != null && urlComponent.anchor.length() > 0 ) {
|
||||
result += '#' + urlComponent.anchor;
|
||||
}
|
||||
|
||||
String var = urlComponent.getVar();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void renderFormUrl(Form formComponent) {
|
||||
String namespace = formComponent.determineNamespace(formComponent.namespace, formComponent.getStack(),
|
||||
formComponent.request);
|
||||
String action;
|
||||
|
||||
if(formComponent.action != null) {
|
||||
action = formComponent.findString(formComponent.action);
|
||||
} else {
|
||||
// no action supplied? ok, then default to the current request
|
||||
// (action or general URL)
|
||||
ActionInvocation ai = (ActionInvocation) formComponent.getStack().getContext().get(
|
||||
ActionContext.ACTION_INVOCATION);
|
||||
if (ai != null) {
|
||||
action = ai.getProxy().getActionName();
|
||||
namespace = ai.getProxy().getNamespace();
|
||||
} else {
|
||||
// hmm, ok, we need to just assume the current URL cut down
|
||||
String uri = formComponent.request.getRequestURI();
|
||||
action = uri.substring(uri.lastIndexOf('/'));
|
||||
}
|
||||
}
|
||||
|
||||
String actionMethod = "";
|
||||
// FIXME: our implementation is flawed - the only concept of ! should be
|
||||
// in DefaultActionMapper
|
||||
// handle "name!method" convention.
|
||||
if (formComponent.enableDynamicMethodInvocation) {
|
||||
if (action.indexOf("!") != -1) {
|
||||
int endIdx = action.lastIndexOf("!");
|
||||
actionMethod = action.substring(endIdx + 1, action.length());
|
||||
action = action.substring(0, endIdx);
|
||||
}
|
||||
}
|
||||
|
||||
final ActionConfig actionConfig = formComponent.configuration.getRuntimeConfiguration().getActionConfig(
|
||||
namespace, action);
|
||||
String actionName = action;
|
||||
if (actionConfig != null) {
|
||||
|
||||
ActionMapping mapping = new ActionMapping(action, namespace, actionMethod, formComponent.parameters);
|
||||
String result = UrlHelper.buildUrl(formComponent.actionMapper.getUriFromActionMapping(mapping),
|
||||
formComponent.request, formComponent.response, null);
|
||||
formComponent.addParameter("action", result);
|
||||
|
||||
// let's try to get the actual action class and name
|
||||
// this can be used for getting the list of validators
|
||||
formComponent.addParameter("actionName", actionName);
|
||||
try {
|
||||
Class clazz = formComponent.objectFactory.getClassInstance(actionConfig.getClassName());
|
||||
formComponent.addParameter("actionClass", clazz);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// this is OK, we'll just move on
|
||||
}
|
||||
|
||||
formComponent.addParameter("namespace", namespace);
|
||||
|
||||
// if the name isn't specified, use the action name
|
||||
if (formComponent.name == null) {
|
||||
formComponent.addParameter("name", action);
|
||||
}
|
||||
|
||||
// if the id isn't specified, use the action name
|
||||
if (formComponent.getId() == null && action!=null ) {
|
||||
formComponent.addParameter("id", formComponent.escape(action));
|
||||
}
|
||||
} else if (action != null) {
|
||||
// Since we can't find an action alias in the configuration, we just
|
||||
// assume the action attribute supplied is the path to be used as
|
||||
// the URI this form is submitting to.
|
||||
|
||||
// Warn user that the specified namespace/action combo
|
||||
// was not found in the configuration.
|
||||
if (namespace != null) {
|
||||
LOG.warn("No configuration found for the specified action: '" + action + "' in namespace: '" + namespace + "'. Form action defaulting to 'action' attribute's literal value.");
|
||||
}
|
||||
|
||||
String result = UrlHelper.buildUrl(action, formComponent.request, formComponent.response, null);
|
||||
formComponent.addParameter("action", result);
|
||||
|
||||
// namespace: cut out anything between the start and the last /
|
||||
int slash = result.lastIndexOf('/');
|
||||
if (slash != -1) {
|
||||
formComponent.addParameter("namespace", result.substring(0, slash));
|
||||
} else {
|
||||
formComponent.addParameter("namespace", "");
|
||||
}
|
||||
|
||||
// name/id: cut out anything between / and . should be the id and
|
||||
// name
|
||||
String id = formComponent.getId();
|
||||
if (id == null) {
|
||||
slash = result.lastIndexOf('/');
|
||||
int dot = result.indexOf('.', slash);
|
||||
if (dot != -1) {
|
||||
id = result.substring(slash + 1, dot);
|
||||
} else {
|
||||
id = result.substring(slash + 1);
|
||||
}
|
||||
formComponent.addParameter("id", formComponent.escape(id));
|
||||
}
|
||||
}
|
||||
|
||||
// WW-1284
|
||||
// evaluate if client-side js is to be enabled. (if validation
|
||||
// interceptor does allow validation eg. method is not filtered out)
|
||||
formComponent.evaluateClientSideJsEnablement(actionName, namespace, actionMethod);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* $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.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Implementation of the {@link UrlRenderer} interface that creates URLs suitable in a servlet environment.
|
||||
*
|
||||
*/
|
||||
public class ServletUrlRenderer implements UrlRenderer {
|
||||
/**
|
||||
* Provide a logging instance.
|
||||
*/
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ServletUrlRenderer.class);
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void renderUrl(Writer writer, URL urlComponent) {
|
||||
String scheme = urlComponent.req.getScheme();
|
||||
|
||||
if (urlComponent.scheme != null) {
|
||||
scheme = urlComponent.scheme;
|
||||
}
|
||||
|
||||
String result;
|
||||
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.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.req, urlComponent.res, urlComponent.parameters, scheme, urlComponent.includeContext, urlComponent.encode, urlComponent.forceAddSchemeHostAndPort, urlComponent.escapeAmp);
|
||||
}
|
||||
if ( urlComponent.anchor != null && urlComponent.anchor.length() > 0 ) {
|
||||
result += '#' + urlComponent.anchor;
|
||||
}
|
||||
|
||||
String var = urlComponent.getVar();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void renderFormUrl(Form formComponent) {
|
||||
String namespace = formComponent.determineNamespace(formComponent.namespace, formComponent.getStack(),
|
||||
formComponent.request);
|
||||
String action;
|
||||
|
||||
if(formComponent.action != null) {
|
||||
action = formComponent.findString(formComponent.action);
|
||||
} else {
|
||||
// no action supplied? ok, then default to the current request
|
||||
// (action or general URL)
|
||||
ActionInvocation ai = (ActionInvocation) formComponent.getStack().getContext().get(
|
||||
ActionContext.ACTION_INVOCATION);
|
||||
if (ai != null) {
|
||||
action = ai.getProxy().getActionName();
|
||||
namespace = ai.getProxy().getNamespace();
|
||||
} else {
|
||||
// hmm, ok, we need to just assume the current URL cut down
|
||||
String uri = formComponent.request.getRequestURI();
|
||||
action = uri.substring(uri.lastIndexOf('/'));
|
||||
}
|
||||
}
|
||||
|
||||
String actionMethod = "";
|
||||
// FIXME: our implementation is flawed - the only concept of ! should be
|
||||
// in DefaultActionMapper
|
||||
// handle "name!method" convention.
|
||||
if (formComponent.enableDynamicMethodInvocation) {
|
||||
if (action.indexOf("!") != -1) {
|
||||
int endIdx = action.lastIndexOf("!");
|
||||
actionMethod = action.substring(endIdx + 1, action.length());
|
||||
action = action.substring(0, endIdx);
|
||||
}
|
||||
}
|
||||
|
||||
final ActionConfig actionConfig = formComponent.configuration.getRuntimeConfiguration().getActionConfig(
|
||||
namespace, action);
|
||||
String actionName = action;
|
||||
if (actionConfig != null) {
|
||||
|
||||
ActionMapping mapping = new ActionMapping(action, namespace, actionMethod, formComponent.parameters);
|
||||
String result = UrlHelper.buildUrl(formComponent.actionMapper.getUriFromActionMapping(mapping),
|
||||
formComponent.request, formComponent.response, null);
|
||||
formComponent.addParameter("action", result);
|
||||
|
||||
// let's try to get the actual action class and name
|
||||
// this can be used for getting the list of validators
|
||||
formComponent.addParameter("actionName", actionName);
|
||||
try {
|
||||
Class clazz = formComponent.objectFactory.getClassInstance(actionConfig.getClassName());
|
||||
formComponent.addParameter("actionClass", clazz);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// this is OK, we'll just move on
|
||||
}
|
||||
|
||||
formComponent.addParameter("namespace", namespace);
|
||||
|
||||
// if the name isn't specified, use the action name
|
||||
if (formComponent.name == null) {
|
||||
formComponent.addParameter("name", action);
|
||||
}
|
||||
|
||||
// if the id isn't specified, use the action name
|
||||
if (formComponent.getId() == null && action!=null ) {
|
||||
formComponent.addParameter("id", formComponent.escape(action));
|
||||
}
|
||||
} else if (action != null) {
|
||||
// Since we can't find an action alias in the configuration, we just
|
||||
// assume the action attribute supplied is the path to be used as
|
||||
// the URI this form is submitting to.
|
||||
|
||||
// Warn user that the specified namespace/action combo
|
||||
// was not found in the configuration.
|
||||
if (namespace != null) {
|
||||
LOG.warn("No configuration found for the specified action: '" + action + "' in namespace: '" + namespace + "'. Form action defaulting to 'action' attribute's literal value.");
|
||||
}
|
||||
|
||||
String result = UrlHelper.buildUrl(action, formComponent.request, formComponent.response, null);
|
||||
formComponent.addParameter("action", result);
|
||||
|
||||
// namespace: cut out anything between the start and the last /
|
||||
int slash = result.lastIndexOf('/');
|
||||
if (slash != -1) {
|
||||
formComponent.addParameter("namespace", result.substring(0, slash));
|
||||
} else {
|
||||
formComponent.addParameter("namespace", "");
|
||||
}
|
||||
|
||||
// name/id: cut out anything between / and . should be the id and
|
||||
// name
|
||||
String id = formComponent.getId();
|
||||
if (id == null) {
|
||||
slash = result.lastIndexOf('/');
|
||||
int dot = result.indexOf('.', slash);
|
||||
if (dot != -1) {
|
||||
id = result.substring(slash + 1, dot);
|
||||
} else {
|
||||
id = result.substring(slash + 1);
|
||||
}
|
||||
formComponent.addParameter("id", formComponent.escape(id));
|
||||
}
|
||||
}
|
||||
|
||||
// WW-1284
|
||||
// evaluate if client-side js is to be enabled. (if validation
|
||||
// interceptor does allow validation eg. method is not filtered out)
|
||||
formComponent.evaluateClientSideJsEnablement(actionName, namespace, actionMethod);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
/*
|
||||
* $Id: AttributeMap.java 471756 2006-11-06 15:01:43Z husted $
|
||||
*
|
||||
* 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.io.Writer;
|
||||
|
||||
/**
|
||||
* Implementations of this interface are responsible for rendering/creating URLs for a specific
|
||||
* environment (e.g. Servlet, Portlet).
|
||||
*
|
||||
*/
|
||||
public interface UrlRenderer {
|
||||
/**
|
||||
* Render a URL.
|
||||
* @param writer A writer that the implementation can use to write the result to.
|
||||
* @param urlComponent The {@link URL} component that "owns" this renderer.
|
||||
*/
|
||||
void renderUrl(Writer writer, URL urlComponent);
|
||||
|
||||
/**
|
||||
* Render a Form URL.
|
||||
* @param formComponent The {@link Form} component that "owns" this renderer.
|
||||
*/
|
||||
void renderFormUrl(Form formComponent);
|
||||
}
|
||||
/*
|
||||
* $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.io.Writer;
|
||||
|
||||
/**
|
||||
* Implementations of this interface are responsible for rendering/creating URLs for a specific
|
||||
* environment (e.g. Servlet, Portlet).
|
||||
*
|
||||
*/
|
||||
public interface UrlRenderer {
|
||||
/**
|
||||
* Render a URL.
|
||||
* @param writer A writer that the implementation can use to write the result to.
|
||||
* @param urlComponent The {@link URL} component that "owns" this renderer.
|
||||
*/
|
||||
void renderUrl(Writer writer, URL urlComponent);
|
||||
|
||||
/**
|
||||
* Render a Form URL.
|
||||
* @param formComponent The {@link Form} component that "owns" this renderer.
|
||||
*/
|
||||
void renderFormUrl(Form formComponent);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
+174
-174
@@ -1,174 +1,174 @@
|
||||
/*
|
||||
* $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.interceptor.debugging;
|
||||
|
||||
import java.beans.IntrospectionException;
|
||||
import java.io.Writer;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionException;
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
|
||||
|
||||
/**
|
||||
* Writes an object as a table, where each field can be expanded if it is an Object/Collection/Array
|
||||
*
|
||||
*/
|
||||
class ObjectToHTMLWriter {
|
||||
private PrettyPrintWriter prettyWriter;
|
||||
|
||||
ObjectToHTMLWriter(Writer writer) {
|
||||
this.prettyWriter = new PrettyPrintWriter(writer);
|
||||
this.prettyWriter.setEscape(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void write(ReflectionProvider reflectionProvider, Object root, String expr) throws IntrospectionException,
|
||||
ReflectionException {
|
||||
prettyWriter.startNode("table");
|
||||
prettyWriter.addAttribute("class", "debugTable");
|
||||
|
||||
if (root instanceof Map) {
|
||||
for (Iterator iterator = ((Map) root).entrySet().iterator(); iterator
|
||||
.hasNext();) {
|
||||
Map.Entry property = (Map.Entry) iterator.next();
|
||||
String key = property.getKey().toString();
|
||||
Object value = property.getValue();
|
||||
writeProperty(key, value, expr);
|
||||
}
|
||||
} else if (root instanceof List) {
|
||||
List list = (List) root;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object element = list.get(i);
|
||||
writeProperty(String.valueOf(i), element, expr);
|
||||
}
|
||||
} else if (root instanceof Set) {
|
||||
Set set = (Set) root;
|
||||
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
|
||||
writeProperty("", iterator.next(), expr);
|
||||
}
|
||||
} else if (root.getClass().isArray()) {
|
||||
Object[] objects = (Object[]) root;
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
writeProperty(String.valueOf(i), objects[i], expr);
|
||||
}
|
||||
} else {
|
||||
//print properties
|
||||
Map<String, Object> properties = reflectionProvider.getBeanMap(root);
|
||||
for (Map.Entry<String, Object> property : properties.entrySet()) {
|
||||
String name = property.getKey();
|
||||
Object value = property.getValue();
|
||||
|
||||
if ("class".equals(name))
|
||||
continue;
|
||||
|
||||
writeProperty(name, value, expr);
|
||||
}
|
||||
}
|
||||
|
||||
prettyWriter.endNode();
|
||||
}
|
||||
|
||||
private void writeProperty(String name, Object value, String expr) {
|
||||
prettyWriter.startNode("tr");
|
||||
|
||||
//name cell
|
||||
prettyWriter.startNode("td");
|
||||
prettyWriter.addAttribute("class", "nameColumn");
|
||||
prettyWriter.setValue(name);
|
||||
prettyWriter.endNode();
|
||||
|
||||
//value cell
|
||||
prettyWriter.startNode("td");
|
||||
if (value != null) {
|
||||
//if is is an empty collection or array, don't write a link
|
||||
if (value != null &&
|
||||
(isEmptyCollection(value) || isEmptyMap(value) || (value.getClass()
|
||||
.isArray() && ((Object[]) value).length == 0))) {
|
||||
prettyWriter.addAttribute("class", "emptyCollection");
|
||||
prettyWriter.setValue("empty");
|
||||
} else {
|
||||
prettyWriter.addAttribute("class", "valueColumn");
|
||||
writeValue(name, value, expr);
|
||||
}
|
||||
} else {
|
||||
prettyWriter.addAttribute("class", "nullValue");
|
||||
prettyWriter.setValue("null");
|
||||
}
|
||||
prettyWriter.endNode();
|
||||
|
||||
//type cell
|
||||
prettyWriter.startNode("td");
|
||||
if (value != null) {
|
||||
prettyWriter.addAttribute("class", "typeColumn");
|
||||
Class clazz = value.getClass();
|
||||
prettyWriter.setValue(clazz.getName());
|
||||
} else {
|
||||
prettyWriter.addAttribute("class", "nullValue");
|
||||
prettyWriter.setValue("unknown");
|
||||
}
|
||||
prettyWriter.endNode();
|
||||
|
||||
//close tr
|
||||
prettyWriter.endNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Some maps, like AttributeMap will throw an exception when isEmpty() is called
|
||||
*/
|
||||
private boolean isEmptyMap(Object value) {
|
||||
try {
|
||||
return value instanceof Map && ((Map) value).isEmpty();
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Some collections might throw an exception when isEmpty() is called
|
||||
*/
|
||||
private boolean isEmptyCollection(Object value) {
|
||||
try {
|
||||
return value instanceof Collection && ((Collection) value).isEmpty();
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeValue(String name, Object value, String expr) {
|
||||
Class clazz = value.getClass();
|
||||
if (clazz.isPrimitive() || Number.class.isAssignableFrom(clazz) ||
|
||||
clazz.equals(String.class) || Boolean.class.equals(clazz)) {
|
||||
prettyWriter.setValue(String.valueOf(value));
|
||||
} else {
|
||||
prettyWriter.startNode("a");
|
||||
String path = expr.replaceAll("#", "%23") + "[\"" +
|
||||
name.replaceAll("#", "%23") + "\"]";
|
||||
prettyWriter.addAttribute("onclick", "expand(this, '" + path + "')");
|
||||
prettyWriter.addAttribute("href", "javascript://nop/");
|
||||
prettyWriter.setValue("Expand");
|
||||
prettyWriter.endNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* $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.interceptor.debugging;
|
||||
|
||||
import java.beans.IntrospectionException;
|
||||
import java.io.Writer;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionException;
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
|
||||
|
||||
/**
|
||||
* Writes an object as a table, where each field can be expanded if it is an Object/Collection/Array
|
||||
*
|
||||
*/
|
||||
class ObjectToHTMLWriter {
|
||||
private PrettyPrintWriter prettyWriter;
|
||||
|
||||
ObjectToHTMLWriter(Writer writer) {
|
||||
this.prettyWriter = new PrettyPrintWriter(writer);
|
||||
this.prettyWriter.setEscape(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void write(ReflectionProvider reflectionProvider, Object root, String expr) throws IntrospectionException,
|
||||
ReflectionException {
|
||||
prettyWriter.startNode("table");
|
||||
prettyWriter.addAttribute("class", "debugTable");
|
||||
|
||||
if (root instanceof Map) {
|
||||
for (Iterator iterator = ((Map) root).entrySet().iterator(); iterator
|
||||
.hasNext();) {
|
||||
Map.Entry property = (Map.Entry) iterator.next();
|
||||
String key = property.getKey().toString();
|
||||
Object value = property.getValue();
|
||||
writeProperty(key, value, expr);
|
||||
}
|
||||
} else if (root instanceof List) {
|
||||
List list = (List) root;
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object element = list.get(i);
|
||||
writeProperty(String.valueOf(i), element, expr);
|
||||
}
|
||||
} else if (root instanceof Set) {
|
||||
Set set = (Set) root;
|
||||
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
|
||||
writeProperty("", iterator.next(), expr);
|
||||
}
|
||||
} else if (root.getClass().isArray()) {
|
||||
Object[] objects = (Object[]) root;
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
writeProperty(String.valueOf(i), objects[i], expr);
|
||||
}
|
||||
} else {
|
||||
//print properties
|
||||
Map<String, Object> properties = reflectionProvider.getBeanMap(root);
|
||||
for (Map.Entry<String, Object> property : properties.entrySet()) {
|
||||
String name = property.getKey();
|
||||
Object value = property.getValue();
|
||||
|
||||
if ("class".equals(name))
|
||||
continue;
|
||||
|
||||
writeProperty(name, value, expr);
|
||||
}
|
||||
}
|
||||
|
||||
prettyWriter.endNode();
|
||||
}
|
||||
|
||||
private void writeProperty(String name, Object value, String expr) {
|
||||
prettyWriter.startNode("tr");
|
||||
|
||||
//name cell
|
||||
prettyWriter.startNode("td");
|
||||
prettyWriter.addAttribute("class", "nameColumn");
|
||||
prettyWriter.setValue(name);
|
||||
prettyWriter.endNode();
|
||||
|
||||
//value cell
|
||||
prettyWriter.startNode("td");
|
||||
if (value != null) {
|
||||
//if is is an empty collection or array, don't write a link
|
||||
if (value != null &&
|
||||
(isEmptyCollection(value) || isEmptyMap(value) || (value.getClass()
|
||||
.isArray() && ((Object[]) value).length == 0))) {
|
||||
prettyWriter.addAttribute("class", "emptyCollection");
|
||||
prettyWriter.setValue("empty");
|
||||
} else {
|
||||
prettyWriter.addAttribute("class", "valueColumn");
|
||||
writeValue(name, value, expr);
|
||||
}
|
||||
} else {
|
||||
prettyWriter.addAttribute("class", "nullValue");
|
||||
prettyWriter.setValue("null");
|
||||
}
|
||||
prettyWriter.endNode();
|
||||
|
||||
//type cell
|
||||
prettyWriter.startNode("td");
|
||||
if (value != null) {
|
||||
prettyWriter.addAttribute("class", "typeColumn");
|
||||
Class clazz = value.getClass();
|
||||
prettyWriter.setValue(clazz.getName());
|
||||
} else {
|
||||
prettyWriter.addAttribute("class", "nullValue");
|
||||
prettyWriter.setValue("unknown");
|
||||
}
|
||||
prettyWriter.endNode();
|
||||
|
||||
//close tr
|
||||
prettyWriter.endNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Some maps, like AttributeMap will throw an exception when isEmpty() is called
|
||||
*/
|
||||
private boolean isEmptyMap(Object value) {
|
||||
try {
|
||||
return value instanceof Map && ((Map) value).isEmpty();
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Some collections might throw an exception when isEmpty() is called
|
||||
*/
|
||||
private boolean isEmptyCollection(Object value) {
|
||||
try {
|
||||
return value instanceof Collection && ((Collection) value).isEmpty();
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void writeValue(String name, Object value, String expr) {
|
||||
Class clazz = value.getClass();
|
||||
if (clazz.isPrimitive() || Number.class.isAssignableFrom(clazz) ||
|
||||
clazz.equals(String.class) || Boolean.class.equals(clazz)) {
|
||||
prettyWriter.setValue(String.valueOf(value));
|
||||
} else {
|
||||
prettyWriter.startNode("a");
|
||||
String path = expr.replaceAll("#", "%23") + "[\"" +
|
||||
name.replaceAll("#", "%23") + "\"]";
|
||||
prettyWriter.addAttribute("onclick", "expand(this, '" + path + "')");
|
||||
prettyWriter.addAttribute("href", "javascript://nop/");
|
||||
prettyWriter.setValue("Expand");
|
||||
prettyWriter.endNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: StrutsTag.java 502294 2007-02-01 17:28:00Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
/*
|
||||
* $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.views.jsp;
|
||||
|
||||
import org.apache.struts2.components.ContextBean;
|
||||
|
||||
|
||||
public abstract class ContextBeanTag extends ComponentTagSupport {
|
||||
private String var;
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
ContextBean bean = (ContextBean) component;
|
||||
bean.setVar(var);
|
||||
}
|
||||
|
||||
public void setVar(String var) {
|
||||
this.var = var;
|
||||
}
|
||||
|
||||
/**
|
||||
* To keep backward compatibility
|
||||
* TODO remove after 2.1
|
||||
*/
|
||||
public void setId(String id) {
|
||||
setVar(id);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* $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.views.jsp;
|
||||
|
||||
import org.apache.struts2.components.ContextBean;
|
||||
|
||||
|
||||
public abstract class ContextBeanTag extends ComponentTagSupport {
|
||||
private String var;
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
ContextBean bean = (ContextBean) component;
|
||||
bean.setVar(var);
|
||||
}
|
||||
|
||||
public void setVar(String var) {
|
||||
this.var = var;
|
||||
}
|
||||
|
||||
/**
|
||||
* To keep backward compatibility
|
||||
* TODO remove after 2.1
|
||||
*/
|
||||
public void setId(String id) {
|
||||
setVar(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
# $Id$
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<#--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
<#--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
*
|
||||
* 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>
|
||||
<style>
|
||||
.debugTable {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.debugTable td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.nameColumn {
|
||||
background-color:#CCDDFF;
|
||||
}
|
||||
|
||||
.valueColumn {
|
||||
background-color: #CCFFCC;
|
||||
}
|
||||
|
||||
.nullValue {
|
||||
background-color: #FF0000;
|
||||
}
|
||||
|
||||
.typeColumn {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.emptyCollection {
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
</style>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
// Dojo configuration
|
||||
djConfig = {
|
||||
isDebug: false,
|
||||
bindEncoding: "UTF-8"
|
||||
,baseRelativePath: "${base}/struts/dojo/"
|
||||
,baseScriptUri: "${base}/struts/dojo/"
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="${base}/struts/dojo/dojo.js"></script>
|
||||
<script>
|
||||
dojo.require("dojo.io.*");
|
||||
|
||||
function expand(src, path) {
|
||||
var baseUrl = location.href;
|
||||
var i = baseUrl.indexOf("&object=");
|
||||
baseUrl = (i > 0 ? baseUrl.substring(0, i) : baseUrl) + "&object=" + path;
|
||||
if (baseUrl.indexOf("decorate") < 0) {
|
||||
baseUrl += "&decorate=false";
|
||||
}
|
||||
dojo.io.bind({
|
||||
url: baseUrl,
|
||||
load : function(type, data, evt) {
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = data;
|
||||
src.parentNode.appendChild(div);
|
||||
|
||||
src.innerHTML = "Collapse";
|
||||
var oldonclick = src.onclick;
|
||||
src.onclick = function() {
|
||||
src.innerHTML = "Expand";
|
||||
src.parentNode.removeChild(div);
|
||||
src.onclick = oldonclick;
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
${debugHtml}
|
||||
</body>
|
||||
<#--
|
||||
/*
|
||||
* $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.
|
||||
*/
|
||||
-->
|
||||
<html>
|
||||
<style>
|
||||
.debugTable {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.debugTable td {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.nameColumn {
|
||||
background-color:#CCDDFF;
|
||||
}
|
||||
|
||||
.valueColumn {
|
||||
background-color: #CCFFCC;
|
||||
}
|
||||
|
||||
.nullValue {
|
||||
background-color: #FF0000;
|
||||
}
|
||||
|
||||
.typeColumn {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.emptyCollection {
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
</style>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
// Dojo configuration
|
||||
djConfig = {
|
||||
isDebug: false,
|
||||
bindEncoding: "UTF-8"
|
||||
,baseRelativePath: "${base}/struts/dojo/"
|
||||
,baseScriptUri: "${base}/struts/dojo/"
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="${base}/struts/dojo/dojo.js"></script>
|
||||
<script>
|
||||
dojo.require("dojo.io.*");
|
||||
|
||||
function expand(src, path) {
|
||||
var baseUrl = location.href;
|
||||
var i = baseUrl.indexOf("&object=");
|
||||
baseUrl = (i > 0 ? baseUrl.substring(0, i) : baseUrl) + "&object=" + path;
|
||||
if (baseUrl.indexOf("decorate") < 0) {
|
||||
baseUrl += "&decorate=false";
|
||||
}
|
||||
dojo.io.bind({
|
||||
url: baseUrl,
|
||||
load : function(type, data, evt) {
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = data;
|
||||
src.parentNode.appendChild(div);
|
||||
|
||||
src.innerHTML = "Collapse";
|
||||
var oldonclick = src.onclick;
|
||||
src.onclick = function() {
|
||||
src.innerHTML = "Expand";
|
||||
src.parentNode.removeChild(div);
|
||||
src.onclick = oldonclick;
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
${debugHtml}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<#--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
@@ -19,22 +19,22 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
.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%;
|
||||
}
|
||||
.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,6 +1,6 @@
|
||||
<!--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<#--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
# $Id$
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
# $Id$
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
# $Id$
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
|
||||
# $Id$
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user