struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve <it_soluti...@hotmail.com>
Subject RE: Struts 2 Annotation Tutorial (additional info)
Date Fri, 30 Sep 2011 04:02:44 GMT
Hello,

Yes, I'm basing it off of the Struts_Annotations_Ant_2_2_1.zip.  I removed the struts.xml
like you instructed but still no luck.

I added the "struts.devMode" param to my web.xml file.  So my web.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
 xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 <display-name>Struts2_Annotations_Ant</display-name>
 <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  <init-param>
   <param-name>struts.devMode</param-name>
   <param-value>true</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
</web-app>



I decided that I'd switch from the jar files located inside the " Struts_Annotations_Ant_2_2_1.zip"
to the ones from "struts-2.2.3-all " so I can attach the source code.  So the jars in my WEB-INF\lib
folder are now:
asm-3.1.jar
asm-commons-3.1.jar
asm-tree-3.1.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.16.jar
javassist-3.11.0.GA.jar
log4j-1.2.16.jar
ognl-3.0.1.jar
struts2-config-browser-plugin-2.2.3.jar
struts2-convention-plugin-2.2.3.jar
struts2-core-2.2.3.jar
xwork-core-2.2.3.jar


Of course that'd didn't make a difference.  I still get:
There is no Action mapped for namespace / and action name hello. - [unknown location]
    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
    org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)



However now I know that in the DefaultActionProxy.prepare method, the statement:
config = configuration.getRuntimeConfiguration().getActionConfig(namespace, actionName);

results in a null for config.  Namespace is: "/" and actionName is: "hello"

If it helps you any, the Struts Configuration Browser shows nothing under the "default" namespace.
 Under "constants" I have the following settings:
logMissingProperties 	false
struts.multipart.saveDir 	
struts.convention.actionNameBuilder 	convention
struts.convention.result.path 	/WEB-INF/content/
struts.objectFactory.spring.useClassCache 	true
struts.url.includeParams 	none
struts.velocity.configfile 	velocity.properties
struts.convention.classes.reload 	false
struts.convention.action.mapAllMatches 	false
struts.convention.relative.result.types 	dispatcher,velocity,freemarker
struts.dispatcher.parametersWorkaround 	false
struts.serve.static 	true
enableOGNLExpressionCache 	true
struts.convention.action.name.lowercase 	true
struts.convention.package.locators.disable 	false
struts.ognl.enableExpressionCache 	true
struts.ui.templateSuffix 	ftl
struts.convention.package.locators 	action,actions,struts,struts2
struts.multipart.parser 	jakarta
struts.velocity.toolboxlocation 	
struts.i18n.reload 	true
struts.freemarker.beanwrapperCache 	false
struts.objectFactory.spring.autoWire 	name
struts.ui.templateDir 	template
struts.url.http.port 	80
struts.ognl.allowStaticMethodAccess 	false
struts.convention.action.checkImplementsAction 	true
struts.enable.DynamicMethodInvocation 	true
struts.ognl.logMissingProperties 	false
struts.convention.action.fileProtocols 	jar
struts.convention.action.disableScanning 	false
devMode 	true
struts.action.extension 	action,,
struts.convention.exclude.parentClassLoader 	true
struts.enable.SlashesInActionNames 	false
struts.convention.default.parent.package 	convention-default
struts.multipart.handler 	jakarta
struts.convention.exclude.packages 	org.apache.struts.*,org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*
struts.i18n.encoding 	UTF-8
struts.convention.conventionsService 	convention
struts.convention.package.locators.basePackage 	
struts.multipart.maxSize 	2097152
struts.convention.action.name.separator 	-
struts.tag.altSyntax 	true
struts.convention.redirect.to.slash 	true
struts.freemarker.mru.max.strong.size 	100
struts.convention.action.alwaysMapExecute 	true
struts.convention.interceptorMapBuilder 	convention
struts.freemarker.templatesCache 	false
struts.convention.action.suffix 	Action
struts.mapper.alwaysSelectFullNamespace 	true
struts.convention.result.flatLayout 	true
struts.devMode 	true
allowStaticMethodAccess 	false
struts.freemarker.templatesCache.updateDelay 	0
struts.url.https.port 	443
struts.ui.theme 	xhtml
struts.velocity.contexts 	
struts.xslt.nocache 	false
struts.objectFactory.spring.autoWire.alwaysRespect 	false
struts.configuration.xml.reload 	true
struts.el.throwExceptionOnFailure 	false
struts.serve.static.browserCache 	true
struts.freemarker.wrapper.altMap 	true
struts.convention.actionConfigBuilder 	convention
struts.convention.resultMapBuilder 	convention



Remember, my app server is JBoss.

Thank you,
Steve

-----Original Message-----
From: Lukasz Lenart [mailto:lukasz.lenart@googlemail.com] 
Sent: Thursday, September 29, 2011 12:10 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 Annotation Tutorial (additional info)

Did you base on [1] ? If so, please remove struts.xml

[1] http://code.google.com/p/struts2-examples/downloads/detail?name=Struts_Annotations_Ant_2_2_1.zip&can=2&q=


Regards
-- 
Lukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message