Problem with imgans after action
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jean_Newtur
Posted On:   Thursday, September 15, 2005 10:00 AM

Hi , I´ve a problem with my struts and my jsp images when i enter in my forms everything appears ok ( imagens, css , js , flash ) When you fill the form and send it, if there is a error i send back to the page, or i sendo to success page, the problem is after send back to success ou to form again all imagens, css and other things appear broken. If i type the address of my pages in the URL everything appear ok, my problem is after my actions execution. My Structure tomcat5/webapp/store/pages/insertForm.jsp tomcat5/webapps/store/img Image link examples There is something i can do to resolv this error? Thank You Jea   More>>

Hi ,

I´ve a problem with my struts and my jsp images
when i enter in my forms everything appears ok ( imagens, css , js , flash )
When you fill the form and send it, if there is a error i send back to the page,
or i sendo to success page, the problem is after send back to success ou to form again
all imagens, css and other things appear broken. If i type the address of my pages in the
URL everything appear ok, my problem is after my actions execution.
My Structure

tomcat5/webapp/store/pages/insertForm.jsp
tomcat5/webapps/store/img

Image link examples

Login

There is something i can do to resolv this error?


Thank You

Jean

   <<Less

Re: Problem with imgans after action

Posted By:   alan_do  
Posted On:   Thursday, September 15, 2005 11:08 AM

you are using relative URL in the same template shared by multiple URLs/actions/JSPs etc. incorrectly.


the best way to refer to images, css, js files is to begin with the server root using a '/', then the name of your application context root, then the files directory, then the file name. for example, '/webapps/store/img/myimage.gif'. any reference from any virtual directory will always default to the server root URL first then go from there, independent of the server URL. for example, http://localhost/webapps/store/img/myimage.gif or http://www.mydomain.com/webapps/store/img/myimage.gif.

About | Sitemap | Contact