• Post Reply Bookmark Topic Watch Topic
  • New Topic

[struts] mapping actions in modules  RSS feed

 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i'am trying to divide a Struts-App into modules.
It works to associate the action to the corresponding module's config.xml,
but only if i use the normal <form> tag. As soon as i try to use the taglib-syntax <html:form>,
i get a exception, saying "cannot retrieve mapping for action /module2MyAction".
What's wrong?
TIA
cb
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chris

When u r using module specific struts-config ,u might have made an entry in web.xml .while using the <html:form> u should say <modulename>/actionpath.....If u dont have this modulename it will try to look up in default struts-config and wont be able to find the mapping for that
For eg in web.xml
<init-param>
<param-name>config/module1</param-name>
<param-value>/WEB-INF/struts-module1-config.xml</param-value>
</init-param>
and in ur jsp u should say
<html:form action="/module1/search.do" > and after this u will reach a jsp where now the reference is in module 1(URl will be at http://localhost:8080/applicationname/module1) .now u can directly say the action and that wont show any exception
Assume now from this module1 jsp u want to invoke some action in another module .now once agin u need to give action="/module2/search.do"

Hope u fing useful what i told u
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sreenath,
thanks for your reply, but i receive the same error
cb
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chris
Then it could be better if u can paste the code what u have written so that we can get some idea where things went wrong
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!