Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

ActionForm

Hi,

I have one localhost/test/main.jsp that called LoginForm and LoginAction subsequently. Then, in my LoginForm, if the errors are obtained, the application will be sent back to main.jsp automatically with the <html:errors /> displayed, right? However, my ActionLogin URL is similar like localhost/test/login/login.do. So when I get back, all the images URL are wrong. My question is how to solve that problem?

The images URL would be like localhost/test/login/pic12.gif instead of localhost/test/pic12.gif

Regards
Dave
0
suprapto45
Asked:
suprapto45
  • 2
  • 2
2 Solutions
 
aozarovCommented:
Have the full path for your images in the jsp page.
e.g. (<img src="/test/login/pic12.gif" />). [assuming test is your context name]
0
 
aozarovCommented:
It is generaly bad idea to have your images relative to your pages as if you change the page location all your images from it will be broken.
You could still solve the problem without applying the above suggestion by using forwared redirect to /test/main.jsp but I prefer the above way.
0
 
bloodredsunCommented:
Or use the html:base tag, see here http://struts.apache.org/userGuide/struts-html.html#base.

Else I agree with Arie and would say use the context relative solution.
0
 
suprapto45Author Commented:
Hi thanks,

Sorry for the delay. I have no time to test. I hope I can test it late today. sorrry :)

Regards
Dave
0
 
bloodredsunCommented:
Cheers Dave
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now