Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Original Web Page Cannot Be Found After Validation is Turned True

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have action mapping in the struts-config.xml like this:

The .frame.Content is defined in the tiles-def.xml to display a drop-down menu based on the data obtained from the action servlet SelectPage.java.

This drop-down menu is included in the 'editTitleForm'. The Submit button of the form has the following action mapping:

If there is no validation errors, successful execution of the UpdateTitle.java will lead to a web page ( with a statement saying that the title of the page has been updated), which is the ".title.Confirmation" in the tiles-def.xml. If there are validation errors, I want to go back to the
first action mapping (note that in the second action mapping, I have input="/ContentMgmt").

I intentionally made validation mistakes for testing purpose and click on the Submit button of the form. I got Internet Explorer HTTP 404 - file not found:

The page you are looking for might have been removed,
had its name changed, or is temporarily unavailable.

Please try the following:

If you typed the page address in the Address bar, make
sure that it is spelled correctly.

Open the localhost:8080 home page, and then look for
links to the information you want.
Click the Back button to try another link.
Click Search to look for information on the Internet.


What should I do to fix the problem?
 
Matthew Marquand
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We normally return to the same JSP we were coming from rather than going back through an action with the input= tag. However, when we do go back through an action we use the full url syntax input="/yourAction.do"
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason that validation errors return the control to the original action input="/ContentMgmt" instead a .jsp is because a Collection of JavaBeans are retrieved from the database to generate a drop-down menu (the first action mapping).

If the second action mapping returns the control to a .jsp, it leads to "bean (the Collection object) not found" error.

I have tried input="/ContentMgmt.do". I got the same HTTP 404 file not found error.
 
Matthew Marquand
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed your action that accepts the posted data has "content/" specified in it. Are you using Struts modules? If so you'll need go through a Switch action to change modules. If you are using modules see org.apache.struts.actions.SwitchAction.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I am not using modules. No module involved.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try "../ContentMgmt.do" as your input.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for helping me. Things worked after I had changed the input attribute in the second action mapping to /do/ContentMgmt. It was because in my web.xml file, I had:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic