This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Learn Java with Math: Using Fun Projects and Games and have Ron Dai on-line!
See this thread for details.
Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Error Processing with Struts in WSAD

 
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
 
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
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!