This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes The Original Web Page Cannot Be Found After Validation is Turned True Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The Original Web Page Cannot Be Found After Validation is Turned True" Watch "The Original Web Page Cannot Be Found After Validation is Turned True" New topic
Author

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

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
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

Joined: Dec 19, 2002
Posts: 32
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

Joined: Nov 19, 2000
Posts: 1309
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

Joined: Dec 19, 2002
Posts: 32
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

Joined: Nov 19, 2000
Posts: 1309
No, I am not using modules. No module involved.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Try "../ContentMgmt.do" as your input.


A good workman is known by his tools.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
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:
 
 
subject: The Original Web Page Cannot Be Found After Validation is Turned True
 
Similar Threads
Path for Tile Does Not Start With a "/" Character
Cannot retrieve mapping for action /content/AddLinks
What Are the Causes for Validation Not Doing Anything?
Tile, Link, and Path Problem
Cannot Find Bean in Scope Request