About Me

Cap'n Intrepid is wacky (when he's not serious), and highly intelligent (when he's not dumb) and has an astounding talent of pointing out the painfully obvious.

View my complete profile

Navigate!

Previously, on Intrepidity

Archives

Blogity Blogs

Feed Me

Legal Mumbo Jumbo

Creative Commons License
This blog is licensed under a Creative Commons License.

Terms of Service

Privacy

Miscellaneous

eXTReMe Tracker

Technorati
Technorati Profile

Photobucket.com image hosting and photo sharing

Zooomr
Search

Looking for something? Browse the archives above or try a Google search:

Web Intrepidity

 
Wednesday, July 05, 2006
 
Struts, Tiles and Unretrievable Mappings
If:

a) You are using Apache Struts and Tiles

b) You have multiple Struts configuration scripts like so:
...
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/conf/struts-default.xml</param-value>
</init-param>
<init-param>
<param-name>config/module1</param-name>
<param-value>/WEB-INF/conf/struts-module1.xml</param-value>
</init-param>
<init-param>
<param-name>config/module2</param-name>
<param-value>/WEB-INF/conf/struts-module2.xml</param-value>
</init-param>
...

3) You use
<html:form action="/someAction">
...
</html:form>

4) And you get a "javax.servlet.ServletException: Cannot retrieve mapping for action '/someAction' at [insert a massive stack trace] " error

Then:

5a) Check your web.xml file to see if the configuration resources in (2) are declared properly

5b) Check your struts-config-xx.xml file to see if you've mapped "/someAction" correctly

5c) Check your tiles-def-xx.xml to see if you've defined the tiles and the put values correctly

5d) Replace:
<html:form>

with the basic:
<form action="/module1/someAction.do">

to confirm that the action is working

6) As a last resort, remove the moduled implementation of the configuration scripts like so:

...
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/conf/struts-default.xml</param-value>,
<param-value>/WEB-INF/conf/struts-module1.xml</param-value>,
<param-value>/WEB-INF/conf/struts-module2.xml</param-value>
</init-param>
...


7) Check to see if this solves the error in (4). If it does, remove all context references (module1, module2 etc) from your actions.

This took me the better part of two working days to figure out, so maybe this will help some frustrated soul out there. If you know a better solution, bully for you. I shall stick to my comma-delimited lists, thank you very much.

Posted by The Facetious Cap'n Intrepid at 8:57 PM |

2 Comments

i have no idea what any of that means. i just wanted to say hi. hi!
:)

Blogger MercerMachine | 7/05/2006 10:38:00 PM | Permalink |  

meaningless code nobody cares much about. my job in 6 words :)

hi back!

Blogger The Facetious Cap'n Intrepid | 7/08/2006 09:24:00 PM | Permalink |  

Post a Comment

<< Home

Copyright © Zhang Wenjie
Design adapted from Blogfrocks