On 12/5/06, Tim Azzopardi <[EMAIL PROTECTED]> wrote:


I have been using appfuse 1.9.4 with webwork (and ibatis) and I have just
migrated to struts2 (mostly) sucessfully.
(File-upload and, i think, dojo are still not working. More details at the
end of the post)

Below, I've updated Matt's webwork to struts2 migration instructions from
this thread

http://www.nabble.com/-ANN--AppFuse-1.9.4-Released%21-tf2495476s2369.html#a6957455

My additions are marked in bold


Matt Raible-3 wrote:
>
>
> the good news is its pretty easy to upgrade from WebWork to Struts
2.  In
> my experience, the upgrade is pretty painless, but I have found some
> widgets don't work.  For example, the datepicker changed from using
> jscalendar to dojo's calendar b/c of licensing issues with jscalendar.
>  There's some sort of conflict b/w dojo's calendar and
> script.aculo.us, so you have to remove scriptaculous in order to get
> the datepicker to work.  In Equinox's Struts 2 option, I manually
> added jscalendar instead of using the built-in datepicker.
>
> 1. Replace the WebWork dependencies with lib/struts-2.0.1
> (http://people.apache.org/builds/struts/2.0.1 - seems to be down ATM).
>
> 2. Modify properties.xml, build.xml, yourapp.iml and .classpath: find
> webwork-2.2.4 and replace with struts 2.0.1.
>
> 3. Rename web/WEB-INF/classes/xwork.xml to
> web/WEB-INF/classes/struts.xml. Change
> web/WEB-INF/classes/webwork.properties to
> web/WEB-INF/classes/struts.properties.
> Finally, edit struts.properties and struts.xml and replace "webwork"
with
> "struts".
>
> 4. Find and replace the following package names (make sure and include
> XML files):
>
>     com.opensymphony.webwork -> org.apache.struts2
>     com.opensymphony.xwork -> com.opensymphony.xwork2
>
> 5. In taglibs.jsp and error.jsp, change the WebWork taglib to:
>
> <%@ taglib uri="/struts-tags" prefix="s" %>
>
> 6. Find and replace the following in your JSP files:
>
>     <ww: -> <s:
>     </ww: -> </s:
>
> 7. In signup.jsp and userForm.jsp, change show="true" to
> showPassword="true".
>
> 8. Modify AppGen templates so <ww: is replaced with <s: and imports are
> renamed.
>
>
> 9. Download struts2 and create a directory lib\struts-2.0.1 containing
> just
>       antlr-2.7.2.jar         (*if* using hibernate, antlr-2.7.6.jar is
already in
> lib/hibernate/lib)
>       freemarker-2.3.4.jar
>       ognl-2.6.7.jar
>       struts2-all-2.0.1.jar
>       struts-core-1.3.5.jar
>       xwork-2.0-beta-1.jar
>    Also put the following struts2 jar dependency in lib\jakarta-commons
>         commons-chain-1.1.jar
>
>    [Note: I don't know if all these jars are strictly necessary]
>
> 10. In lib.properties change
>       #
>       # WebWork - http://www.opensymphony.com/webwork
>       #
>       webwork.version=2.2.4
>       webwork.dir=${lib.dir}/webwork-${webwork.version}
>     to
>       #
>       # Struts2
>       #
>       struts.version=2.0.1
>       struts.dir=${lib.dir}/struts-${struts.version}
>
>     And add the following lines in the "Commons" section
>       # new for struts2
>       commons-chain.jar=${commons.dir}/commons-chain-1.1.jar
>
>
> 11. In build.xml, change
>       <lib dir="${webwork.dir}" includes="*.jar"/>
>     to
>       <lib dir="${struts.dir}" includes="*.jar"/>
>
> 12. In properties.xml, change TWO occcurences of
>         <fileset dir="${webwork.dir}" includes="*.jar"/>
>     to
>         <fileset dir="${struts.dir}" includes="*.jar"/>
>
>     In the web.compile.classpath add the following line
>         <pathelement location="${commons-chain.jar}"/> <!-- New for
> struts2  -->
>
>
>
> AppFuse 2.0 (in the trunk) has Struts 2 integrated, so you could look
> at the files there if things don't work properly.
>
> Hope this helps,
>
> Matt
>


What doesn't work yet
=====================

Dojo
----

I am trying to do a trivial bit of dojo, that works outside appfuse, but
when
I try to use it in a jsp, I get the same old ".html is not a valid action
error" that has been seen previously:
See http://issues.appfuse.org/browse/APF-431 and

http://www.nabble.com/Changing-default-extension-from-*.html-to-*.---tf2307780s2369.html#a6415699


There are two possible ways to work around this (at least I think so - I
have done no 2 for SpringMVC, but have not yet tried struts):

1) Use the packages init parameter on the FilterDispatcher and include dojo
as a package. More details in the FilterDispatcher javadoc:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/FilterDispatcher.html

2) Build a filter that forwards all requests not for dojo to the dispatcher
and set the dispatcher to only operate on forwarded requests. I have coded
an include/exclude filter that allows me to do this. Let me know if you are
interested in the code and I will post it up here. This method has the
advantage that you can code filters to only operate on active content,
thereby shortening the filter chain for static content.

Mike.

[myapp] ERROR [http-80-Processor24] Dispatcher.serviceAction(338) | Could
not find action or result
There is no Action mapped for action name
lib/dojo/src/widget/templates/HtmlButtonTemplate. - [unknown location]
       at
com.opensymphony.xwork2.DefaultActionProxy.<init>(DefaultActionProxy.java
:75)
       at
org.apache.struts2.impl.StrutsActionProxy.<init>(StrutsActionProxy.java
:18)

I should add that I am using my own copy of dojo 0.4 and not the one that
is
integrated with struts2.

File-Upload
-----------

"ant test-all" works all the way up to the File-Upload cannoo web test

When I access the File-Upload page manually I get
java.lang.IllegalArgumentException: The default() is not defined in action
class com.myapp.webapp.action.FileUploadAction
       at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(
DefaultActionInvocation.java:363)

Anybody got any suggestions for either problem?


--
View this message in context:
http://www.nabble.com/appfuse-1.9.4-webwork-migration-to-struts2-tf2761053s2369.html#a7697800
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to