wood burning stoves
The moose likes Struts and the fly likes Error Processing with Struts in WSAD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error Processing with Struts in WSAD" Watch "Error Processing with Struts in WSAD" New topic

Error Processing with Struts in WSAD

Arthur Leo

Joined: Mar 29, 2003
Posts: 7

I ran into a confusing problem using Struts in WSAD. I hope someone can point me in the right direction.

I had a page Customer.jsp with a DynaValidatorForm. If the user input was valid, the user would be forwarded to Confirm.jsp and see the data display. If the input was invalid, the user would be pushed back to Customer.jsp where I display validation error in <html:errors/>. Everything was fine there.

Later on I needed to move the 2 jsp pages to subdirectory Sub. I used the WSAD "move" feature to move Customer.jsp to /Sub/Customer.jsp, and Confirm.jsp to /Sub/Confirm.jsp. The WSAD "move" feature missed some settings so I had to manually update action-mappings tag in struts-config.xml. Now the problem is: when the user input is invalid, text display comes out fine but images are broken. It looks like the error display page is coming out from the root directory instead of the Sub subdirectory. And the URL shows up as "mysite/Customer.do", which should be "mysite/Sub/Customer.jsp" When the user input is valid, the result display is still good.

Am I missing some settings? Or do I need to look into some configuration Xml files for a clue?

Thanks in advance!

Nimchi Yung
Ranch Hand

Joined: Jan 27, 2004
Posts: 71
There are two things to check:

(1) Did you use <html:base /> with your jsp page?

(2) Make sure the action element's input attribute in your
struts-config file is changed based on your directory

Arthur Leo

Joined: Mar 29, 2003
Posts: 7
Thank you, Nimchi.

I had manually updated the <action input> attribute, and included the <html:base /> tag. However, I am still getting broken images. I think there is something else that needs to be updated.


I agree. Here's the link: http://aspose.com/file-tools
subject: Error Processing with Struts in WSAD
It's not a secret anymore!