• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error Processing with Struts in WSAD

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic