• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Processing with Struts in WSAD

 
Arthur Leo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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!

Arthur
 
Nimchi Yung
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
structure.

--Nimchi
 
Arthur Leo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks.

Arthur
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic