Archive for the ‘Appfuse’ Category

Appfuse: error when doing mvn install eclipse:eclipse

Wednesday, March 3rd, 2010

When creating a new appfuse project following the quick start guide you might see this error:

[INFO] Request to merge when ‘filtering’ is not identical. Original=resource src/main/resources: output=target/classes, include=[], exclude=[ApplicationResources_de.properties|ApplicationResources_fr.properties|ApplicationResources_ko.properties|ApplicationResources_nl.properties|ApplicationResources_no.properties|ApplicationResources_pt*.properties|ApplicationResources_tr.properties|ApplicationResources_zh*.properties|applicationContext-resources.xml|struts.xml|**/*.java], test=false, filtering=true, merging with=resource src/main/resources: output=target/classes, include=[applicationContext-resources.xml|struts.xml], exclude=[**/*.java], test=false, filtering=false

after the command:
mvn install eclipse:eclipse
This is due to an incompatibility with the eclipse maven plugin, you can solve this by running the command like:
mvn org.apache.maven.plugins:maven-eclipse-plugin:2.5.1:eclipse
I saw this solution here:
http://www.mail-archive.com/users@appfuse.dev.java.net/msg17295.html

Appfuse - The Struts dispatcher cannot be found.

Wednesday, December 2nd, 2009

I was getting the following error in my appfuse project, the reason was the security.xml filtered out the page that I was requesting

The Struts dispatcher cannot be found.  This is usually caused by using
Struts tags without the associated filter. Struts tags are only usable when
the request has passed through its servlet filter, which initializes the
Struts dispatcher needed for this tag. - [unknown location]
        at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
        at
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
        at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)

Appfuse don’t create database every time

Monday, April 27th, 2009

Every time appfuse is started with

mvn jetty:run-war

the database is re-created. If you want to preserve the previous database turn of tests

mvn jetty:run-war -Dmaven.test.skip=true

Appfuse create a custom page to edit users

Tuesday, January 27th, 2009

I am working on a site based on Appfuse + Struts 2 and I needed to create a custom page allowing the logged in user to change add information to his profile.

I decided to base my extension on the already existent User model object in Appfuse, copy pasted the default editProfile.jsp under a new name. Then I added few new fields there and also to the standard user object.

However I noticed a problem that my new jsp page was not getting the logged in user from the UserAction.edit method which I specified in the struts.xml, as it was also for the editProfile.jsp page. Instead I always got a new empty User object.

Looking into the code for the UserAction.edit method I saw that there is a boolean variable at the top of the method that checks wheter the query string included the editProfile string.

Thus there are two solutions to this problem. Let the name of the new .jsp include the string editProfile or simply copy the method into a new action method and hardcode the boolean value to true there. Also the new copied method can ofcourse been simplified.

The easiest way ofcourse is to have the page include the string editProfile.