struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Aylward <John.Aylw...@SageNet.com>
Subject RE: problem Migrating from Struts 2.3 to 2.5
Date Thu, 22 Dec 2016 16:27:37 GMT
Ok, I got it to work with an include file on 2.5.8. In my main struts.xml I added this:

<struts>

	<!-- Max file upload size of 250 MB -->
	<constant name="struts.multipart.maxSize" value="262144000" />

	<constant name="struts.enable.DynamicMethodInvocation" value="FALSE" />
	<constant name="struts.strictMethodInvocation.methodRegex"
		value="([a-zA-Z]*)" />

	<include file="my-json-actions.xml" />
</struts>


Then in my included file I had to set this:
<struts>
	<package name="my-json" namespace="/json" extends="struts-default"
		strict-method-invocation="false">

The strict method invocation was preventing my actions from loading. Disabling it allowed
my wildcard actions to work again. I'm not sure if the regex was needed or not, but I'm leaving
it for now since it's working.



--
John J. Aylward

-----Original Message-----
From: John Aylward [mailto:John.Aylward@SageNet.com] 
Sent: Thursday, December 22, 2016 10:20 AM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: RE: problem Migrating from Struts 2.3 to 2.5

I combined all my struts.xml files into one and finally got a struts configuration error after
a bit of massaging to get rid of old elements that I didn't need anymore and messed one up.
At least I know the struts.xml file is being loaded now. I know the actions are being found
because I purposefully made an error in the action section and it was properly reported.

However, once I cleaned up my errors, my actions still appear to not be loading, or perhaps
they are loading in the wrong namespace.

When I try to access my actions in a browser directly, I get this message:
There is no Action mapped for namespace [/json] and action name [ClientData!loggedIn] associated
with context path [].

I placed all my loaded files into the /json namespace:

	<!-- Max file upload size of 250 MB -->
	<constant name="struts.multipart.maxSize" value="262144000" />

	<package name="my-json" namespace="/json" extends="struts-default"> ...

In the 2.3.x branch I would get log message when an action was configured, but in 2.5.x I
don't appear to get any such messages.


--
John


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