• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Struts modules and html:form

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to configure my application to use modules, but the html:form tag is failing for some reason. Here's the message I get when I try to go to
http://localhost:9080/contact/noActionInputModifyContact.do

[ServletException in:/contact/tiles/bodyContent/inputModifyContact.jsp] Cannot retrieve mapping for action /inputModifyContact'

Here is my web.xml


Here is my struts-config-contact.xml file excerpt:


Here is my tiles-defs-contact.xml file excerpt:


Here is inputModifyContact.jsp


Can anybody PLEASE help me? I looked all over the net and I can't figure this out!
[ November 23, 2004: Message edited by: Anthony Watson ]
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Missing a "/" ?
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nathaniel, I've tried it with and without the / but it prints the same error message.

Somehow, it is looking in the struts-config-public.xml file for the inputModifyContact action mapping even though I am forwarding to inputModifyContact from the noActionInputModifyContact action mapping that is within the struts-config-contact.xml file. I don't know if the public file has somehow been set as a default or what. I currently have nothing at all in the default struts-config.xml file.

Can anyone tell me why Struts is trying to find inputModifyContact in the public config file instead of the contact config file? Thanks.
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Watson,

I have two points to highlight

First
=====

<action path="/noActionInputModifyContact" type="us.az.common.action.ClearStatusAction">

<forward name="success" path=".inputModifyContact" />

</action>


Instead of .inputModifyContact it should be /inputModifContact
It applies to all the paths in your struts-config.xml


Second
======
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

This entry is missing in your web.xml

Regards
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestions, Sujatha, but my original problem remains. As far as your comments go 1) I use the . instead of a / to indicate that it is a tile instead of an action mapping. 2) I actually have this servlet mapping in my web.xml, I just didn't paste it in my post.

Can anyone help me? Thanks.
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I have created my tiles-defs-contact.xml file incorrectly. I'm not sure if it is okay to reference pages from multiple modules in a single tiles-defs file. Here is the definition that my .inputModifyContact definition inherits from:



See how all the tiles in the base definition refer to a the public module except for the home.jsp page, which is in the contact module?

What's happening is that my first action (/noActionInputModifyContact) is using the contact module. It forwards to a jsp page that uses the html:form tag. The form tag is looking in the public module to find the action (/inputModifyContact) that it will submit to and it should be looking in the contact module. I think that I made a mistake in my tiles-defs-contact.xml file.

Any suggestions would be GREATLY appreciated. Thanks.
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out. When I referenced /public/renderMenu.do in the .base definition, Struts changed the moduleConfig it was using from contact to public. I just had to insert the renderMenu action in my struts-config-contact.xml file and point the tiles-defs-contact.xml file's .base definition to /contact/renderMenu.do and everything worked perfectly.
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic