Changing the code paths

git-svn-id: https://svn.apache.org/repos/asf/incubator/webwork2@388388 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Donald J. Brown
2006-03-24 05:50:22 +00:00
parent c770c6f38a
commit e17efacc62
18 changed files with 37 additions and 37 deletions
+8 -8
View File
@@ -105,8 +105,8 @@
mergedir="src/etc"
-->
<fileset dir="${src.java}">
<include name="com/opensymphony/webwork/views/**/*.java"/>
<include name="com/opensymphony/webwork/components/**/*.java"/>
<include name="org/apache/struts/action2/views/**/*.java"/>
<include name="org/apache/struts/action2/components/**/*.java"/>
</fileset>
<configParam name="Jspversion" value="1.2"/>
<configParam name="Taglibversion" value="${version}"/>
@@ -129,8 +129,8 @@
force="true"
>
<fileset dir="${src.java}">
<include name="com/opensymphony/webwork/views/**/*.java"/>
<include name="com/opensymphony/webwork/components/**/*.java"/>
<include name="org/apache/struts/action2/views/**/*.java"/>
<include name="org/apache/struts/action2/components/**/*.java"/>
</fileset>
<xmlTemplate templateFile="${src.xdt}/tagdoc.xdt" destinationfile="{0}.html"/>
</xdoclet>
@@ -140,8 +140,8 @@
force="true"
>
<fileset dir="${src.java}">
<include name="com/opensymphony/webwork/views/**/*.java"/>
<include name="com/opensymphony/webwork/components/**/*.java"/>
<include name="org/apache/struts/action2/views/**/*.java"/>
<include name="org/apache/struts/action2/components/**/*.java"/>
</fileset>
<configParam name="Taglibversion" value="${version}"/>
<template templateFile="${src.xdt}/tagdoc-toc.xdt" destinationfile="index.html"/>
@@ -182,7 +182,7 @@
</jar>
<jar jarfile="${build}/${name}-nostatic-${version}.jar">
<fileset dir="${build.java}">
<exclude name="com/opensymphony/webwork/static/**/*" />
<exclude name="org/apache/struts/action2/static/**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="org.apache.struts.action2.Main"/>
@@ -191,7 +191,7 @@
</manifest>
</jar>
<zip destfile="${build}/${name}-static-${version}.zip">
<zipfileset dir="${build.java}/com/opensymphony/webwork/static" prefix="webwork" />
<zipfileset dir="${build.java}/org/apache/struts/action2/static" prefix="webwork" />
</zip>
</target>
@@ -36,7 +36,7 @@ Each of your action class instance variables (for which you&#039;ve written a ge
<div class="code"><div class="codeContent">
<pre><span class="java&#45;keyword">public</span> class ProcessEditTableRowAction <span class="java&#45;keyword">extends</span> ActionSupport &#123;&#10; <span class="java&#45;keyword">private</span>&#160;<span class="java&#45;object">String</span> fooString;</pre>
</div></div></p>And you have a getter method for that string (in that same ActionClass):<br/>
<div class="code"><div class="codeContent">
<pre><span class="java&#45;keyword">public</span>&#160;<span class="java&#45;object">String</span> getFooString() &#123; <span class="java&#45;keyword">return</span> fooString; &#125;</pre>
</div></div><p class="paragraph">Then in your Velocity template you can retrieve the value of that String by simply refering to:
@@ -50,16 +50,16 @@ The current HttpServletResponse created and managed by your Servlet environment
<b class="strong">$stack</b><br/>
The OGNL value stack. (<a href="http://www.opensymphony.com/xwork/api/com/opensymphony/xwork/util/OgnlValueStack.html" title="Visit page outside Confluence">API Docs</a>)</p><em class="emphasis">TODO:</em> Talk about what&#039;s actually <b class="strong">on</b> the stack. Doesn&#039;t do a whole lot of good to know it&#039;s there without knowing what&#039;s on it.<p class="paragraph"><br clear="all" />
<b class="strong">$ognl</b><br/>
A reference to an OGNL tool. (<a href="http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/views/jsp/ui/OgnlTool.html" title="Visit page outside Confluence">API Docs</a>)<br/>
A reference to an OGNL tool. (<a href="http://www.opensymphony.com/webwork/api/org/apache/struts/action2/views/jsp/ui/OgnlTool.html" title="Visit page outside Confluence">API Docs</a>)<br/>
(<a href="http://wiki.opensymphony.com/display/XW/Ognl" title="Visit page outside Confluence">See OGNL Basics</a>)</p>At the time of this writing, there are no docs for that object, so if you really want to know how it works, be a <a href="http://en.wikipedia.org/wiki/Jedi" title="Visit page outside Confluence">Jedi</a> and &quot;use the source&quot;. (The CVS repository is browsable here: <a href="https://webwork.dev.java.net/source/browse/webwork/src/java" title="Visit page outside Confluence">&#104;ttps://webwork.dev.java.net/source/browse/webwork/src/java</a>)<p class="paragraph"><br clear="all" />
<em class="emphasis">Tip:</em><br/>
Jason/Patrick note that one nifty thing you can do with this tool is to call static class methods. That&#039;s rather handy since Velocity doesn&#039;t offer access to class variables or methods, but only to instantiate objects that have been placed in the Velocity Context. So you can&#039;t normally do things like Math.random().</p>To call a class method, from within Velocity template, using the OGNL tool, you do this:<br/>
<div class="code"><div class="codeContent">
<pre>$ognl.findValue(<span class="java&#45;quote">&quot;&#64;com.acme.FooClass&#64;FOO&quot;</span>)</pre>
</div></div><p class="paragraph"><em class="emphasis">TODO:</em> the original email detailing the above example used $value to refer to the OGNL tool, not $ognl. But the source indicates it&#039;s &quot;$ognl&quot; that&#039;s shared with the context. Which is right?</p><br clear="all" />
<b class="strong">$webwork</b><br/>
A reference to the VelocityWebWorkUtil class. (<a href="http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/util/WebWorkUtil.html" title="Visit page outside Confluence">API Docs</a>)<p class="paragraph">At the time of this writing, the API docs for this object are effectively blank, so if you really want to know how it works, be a <a href="http://en.wikipedia.org/wiki/Jedi" title="Visit page outside Confluence">Jedi</a> and &quot;use the source&quot;. (The CVS repository is browsable here: <a href="https://webwork.dev.java.net/source/browse/webwork/src/java" title="Visit page outside Confluence">&#104;ttps://webwork.dev.java.net/source/browse/webwork/src/java</a>)</p><br clear="all" />
A reference to the VelocityWebWorkUtil class. (<a href="http://www.opensymphony.com/webwork/api/org/apache/struts/action2/util/WebWorkUtil.html" title="Visit page outside Confluence">API Docs</a>)<p class="paragraph">At the time of this writing, the API docs for this object are effectively blank, so if you really want to know how it works, be a <a href="http://en.wikipedia.org/wiki/Jedi" title="Visit page outside Confluence">Jedi</a> and &quot;use the source&quot;. (The CVS repository is browsable here: <a href="https://webwork.dev.java.net/source/browse/webwork/src/java" title="Visit page outside Confluence">&#104;ttps://webwork.dev.java.net/source/browse/webwork/src/java</a>)</p><br clear="all" />
<em class="emphasis">Tip:</em><br/>
Mathew notes that the VelocityWebWorkUtil class can instantiate other objects for you. This, too, is very handy since Velocity is normally constrained to only the objects that have been explicitely shared with it&#039;s context (and not something you have control over when using Velocity templates kicked off by WebWork).<p class="paragraph">To instantiate an object from a Velocity page (that&#039;s been kicked off by WebWork, of course) do this:</p><div class="code"><div class="codeContent">
<pre>#set($object = $webwork.bean(<span class="java&#45;quote">&quot;com.foo.ClassName&quot;</span>))</pre>
@@ -75,10 +75,10 @@ provides a way to uses the &lt;ww:text name=&quot;title.edit&quot; /&gt; tag fro
<div class="code"><div class="codeContent">
<pre>$action.getText(&#039;title.edit&#039;)</pre>
</div></div> would perform the same thing.</p>see <a href="UI tags.html#UITags-WW%2FUI%2BTags" title="WW/UI+Tags on UI Tags">UI tags#WW/UI+Tags</a> for more information about webworks tags. Many provide equivalent velocity examples. Usage with other tags could be infered based on examples given. <br/>
BIN
View File
Binary file not shown.
@@ -48,7 +48,7 @@ BUILD SUCCESSFUL
ww-sample/
src/
java/
com/opensymphony/webwork/example/HomeAction.java -- A simple action example implementation
org/apache/struts/action2/example/HomeAction.java -- A simple action example implementation
webapp/
index.jsp -- redirects to home.action
WEB-INF/
+1 -1
View File
@@ -29,7 +29,7 @@
<p>or</p>
<p>{snippet:id=sitegraph-usage|lang=none|url=webwork/src/java/com/opensymphony/webwork/sitegraph/sitegraph-usage.txt}</p>
<p>{snippet:id=sitegraph-usage|lang=none|url=webwork/src/java/org/apache/struts/action2/sitegraph/sitegraph-usage.txt}</p>
<p>or</p>
Binary file not shown.
+1 -1
View File
@@ -31,7 +31,7 @@
<h3><a name="WebWork-GettingStarted"></a>Getting Started</h3>
<ul class="alternate" type="square">
<li><a href="http://www.opensymphony.com/webwork/download.action" title="Visit page outside Confluence">Downloads</a> (<a href="http://ivyrep.opensymphony.com/opensymphony/webwork/" title="Visit page outside Confluence">continous builds</a>, <a href="Previous Releases.html" title="Previous releases">previous versions</a>)</li>
<li><a href="http://www.opensymphony.com/webwork/download.action" title="Visit page outside Confluence">Downloads</a> (<a href="http://ivyrep.opensymphony.org/apache/struts/action2/" title="Visit page outside Confluence">continous builds</a>, <a href="Previous Releases.html" title="Previous releases">previous versions</a>)</li>
<li>Installation</li>
<li>Requirements (<a href="dependencies.html" title="Dependencies">dependencies</a>, <a href="App Servers.html" title="App Servers">appservers</a>)</li>
<li><a href="Quickstart.html" title="QuickStart">Quickstart</a></li>
+1 -1
View File
@@ -44,7 +44,7 @@
<property name="dist" location="dist"/>
<property name="docs" location="docs"/>
<property name="docs.packages" value="com.opensymphony.*"/>
<property name="docs.packages" value="org.apache.struts.action2.*"/>
<property name="jar.manifest" value="${common.dir}/EMPTY.MF"/>
<property name="jar.excludes" value=""/>
@@ -34,7 +34,7 @@ public class DefaultRichtexteditorConnector extends AbstractRichtexteditorConnec
private static final long serialVersionUID = -3792445192115623052L;
protected String _actualServerPath = "/com/opensymphony/webwork/static/richtexteditor/data/";
protected String _actualServerPath = "/org/apache/struts/action2/static/richtexteditor/data/";
public String getActualServerPath() { return _actualServerPath; }
@@ -45,9 +45,9 @@ public class DefaultConfiguration extends Configuration {
}
try {
list.add(new PropertiesConfiguration("com/opensymphony/webwork/default"));
list.add(new PropertiesConfiguration("org/apache/struts/action2/default"));
} catch (Exception e) {
log.error("Could not find com/opensymphony/webwork/default.properties", e);
log.error("Could not find org/apache/struts/action2/default.properties", e);
}
Configuration[] configList = new Configuration[list.size()];
@@ -75,7 +75,7 @@ public class DefaultConfiguration extends Configuration {
// Add addtional list of i18n global resource bundles
try {
LocalizedTextUtil.addDefaultResourceBundle("com/opensymphony/webwork/webwork-messages");
LocalizedTextUtil.addDefaultResourceBundle("org/apache/struts/action2/webwork-messages");
StringTokenizer bundleFiles = new StringTokenizer((String) config.getImpl(WebWorkConstants.WEBWORK_CUSTOM_I18N_RESOURCES), ", ");
while (bundleFiles.hasMoreTokens()) {
@@ -189,7 +189,7 @@ public class ExecuteAndWaitInterceptor implements Interceptor {
"'! This requires FreeMarker support and won't work if you don't have it installed");
// no wait result? hmm -- let's try to do dynamically put it in for you!
ResultConfig rc = new ResultConfig(WAIT, "org.apache.struts.action2.views.freemarker.FreemarkerResult",
Collections.singletonMap("location", "com/opensymphony/webwork/interceptor/wait.ftl"));
Collections.singletonMap("location", "org/apache/struts/action2/interceptor/wait.ftl"));
results.put(WAIT, rc);
}
@@ -183,7 +183,7 @@ public class Jsr168Dispatcher extends GenericPortlet implements WebWorkStatics,
portletNamespace = "";
}
LocalizedTextUtil
.addDefaultResourceBundle("com/opensymphony/webwork/webwork-messages");
.addDefaultResourceBundle("org/apache/struts/action2/webwork-messages");
//check for configuration reloading
if ("true".equalsIgnoreCase(Configuration
@@ -23,7 +23,7 @@ public class ConfigurationTest extends WebWorkTestCase {
assertEquals("12345", Configuration.getString(WebWorkConstants.WEBWORK_MULTIPART_MAXSIZE));
assertEquals("\temp", Configuration.getString(WebWorkConstants.WEBWORK_MULTIPART_SAVEDIR));
assertEquals("test,com/opensymphony/webwork/othertest", Configuration.getString( WebWorkConstants.WEBWORK_CUSTOM_PROPERTIES));
assertEquals("test,org/apache/struts/action2/othertest", Configuration.getString( WebWorkConstants.WEBWORK_CUSTOM_PROPERTIES));
assertEquals("testvalue", Configuration.getString("testkey"));
assertEquals("othertestvalue", Configuration.getString("othertestkey"));
@@ -44,7 +44,7 @@ public class ConfigurationTest extends WebWorkTestCase {
Locale.setDefault(Locale.US); // force to US locale as we also have _de and _da properties
LocalizedTextUtil.clearDefaultResourceBundles();
LocalizedTextUtil.addDefaultResourceBundle("com/opensymphony/webwork/webwork-messages");
LocalizedTextUtil.addDefaultResourceBundle("org/apache/struts/action2/webwork-messages");
assertEquals("The form has already been processed or no token was supplied, please try again.", LocalizedTextUtil.findDefaultText("webwork.messages.invalid.token", Locale.getDefault()));
Configuration.reset();
@@ -44,7 +44,7 @@ public class PlainTextResultTest extends TestCase {
response.setExpectedHeader("Content-Disposition", "inline");
InputStream jspResourceInputStream =
ClassLoaderUtil.getResourceAsStream(
"com/opensymphony/webwork/dispatcher/someJspFile.jsp",
"org/apache/struts/action2/dispatcher/someJspFile.jsp",
PlainTextResultTest.class);
@@ -54,7 +54,7 @@ public class PlainTextResultTest extends TestCase {
String r = AbstractUITagTest.normalize(stringWriter.getBuffer().toString(), true);
String e = AbstractUITagTest.normalize(
readAsString("com/opensymphony/webwork/dispatcher/someJspFile.jsp"), true);
readAsString("org/apache/struts/action2/dispatcher/someJspFile.jsp"), true);
assertEquals(r, e);
}
finally {
@@ -71,7 +71,7 @@ public class PlainTextResultTest extends TestCase {
response.setExpectedHeader("Content-Disposition", "inline");
InputStream jspResourceInputStream =
ClassLoaderUtil.getResourceAsStream(
"com/opensymphony/webwork/dispatcher/someJspFile.jsp",
"org/apache/struts/action2/dispatcher/someJspFile.jsp",
PlainTextResultTest.class);
@@ -81,7 +81,7 @@ public class PlainTextResultTest extends TestCase {
String r = AbstractUITagTest.normalize(stringWriter.getBuffer().toString(), true);
String e = AbstractUITagTest.normalize(
readAsString("com/opensymphony/webwork/dispatcher/someJspFile.jsp"), true);
readAsString("org/apache/struts/action2/dispatcher/someJspFile.jsp"), true);
assertEquals(r, e);
}
finally {
@@ -17,7 +17,7 @@ import java.util.Map;
*/
public class ServletDispatcherTest extends AbstractServletDispatcherTestCase {
public String getConfigFilename() {
return "com/opensymphony/webwork/dispatcher/ServletDispatcherTest-xwork.xml";
return "org/apache/struts/action2/dispatcher/ServletDispatcherTest-xwork.xml";
}
public ServletDispatcher getServletDispatcher() {
@@ -13,13 +13,13 @@ import java.io.StringWriter;
*/
public class SiteGraphTest extends WebWorkTestCase {
public void testWebFlow() {
String dir = "src/test/com/opensymphony/webwork/sitegraph";
String dir = "src/test/org/apache/struts/action2/sitegraph";
SiteGraph siteGraph = new SiteGraph(dir, dir, dir, "");
StringWriter writer = new StringWriter();
siteGraph.setWriter(writer);
siteGraph.prepare();
String out = "src/test/com/opensymphony/webwork/sitegraph/out.txt";
String out = "src/test/org/apache/struts/action2/sitegraph/out.txt";
assertEquals(FileUtils.readFile(new File(out)), writer.toString());
}
}
@@ -42,7 +42,7 @@ public class WebWorkSpringObjectFactoryTest extends TestCase {
ServletContext msc = (ServletContext) new MockServletContext();
msc.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ac);
ac.setServletContext(msc);
ac.setConfigLocations(new String[] {"/com/opensymphony/webwork/spring/WebWorkSpringObjectFactoryTest-applicationContext.xml"});
ac.setConfigLocations(new String[] {"/org/apache/struts/action2/spring/WebWorkSpringObjectFactoryTest-applicationContext.xml"});
ac.refresh();
fac.init(msc);
+1 -1
View File
@@ -4,7 +4,7 @@ webwork.multipart.saveDir=\temp
webwork.multipart.maxSize=12345
### Load custom property files (does not override webwork.properties!)
webwork.custom.properties=test,com/opensymphony/webwork/othertest
webwork.custom.properties=test,org/apache/struts/action2/othertest
# added the MockTag to the path of Tags that the TagDirective will search through
webwork.velocity.tag.path = org.apache.struts.action2.views.velocity.ui, org.displaytag.tags