Hello
It has nothing to do with *.do extension, or jsessionid param. The link to CSS is an information to the user's browser. If you use a relative path to the CSS (without / at the beginning) it will use current link in its address field, and to compute the path.
Example:
css path as yours:
<link rel="stylesheet" href="../../css/test.css" />
link:
http://localhost:8080/weba
all that is after last '/' is stripped (login.jsp), and the relative path is added:
http://localhost:8080/weba
http://localhost:8080/weba
And this link happens to be fine.
For link:
http://localhost:8080/Auto
Css link will look like:
http://localhost:8080/Auto
Which of course does not work.
What you should do, is to ensure that all links to struts actions/jsps are always two directory deep (such as: http://localhost:8080/Auto
One solution is like boonleng wrote:
<link rel="stylesheet" href="<html:rewrite page='/css/test.css'/>" />
But if you use separate web server (like microsoft IIS) to server static content like CSS, the jsessionid param will probably mess things out, so you can also use:
<link rel="stylesheet" href="<%=request.getContex
Main Topics
Browse All Topics





by: boonlengPosted on 2008-02-18 at 18:35:26ID: 20925276
Use <html:rewrite> to generate the path.
Example:
<link rel="stylesheet" href="<html:rewrite page='/css/test.css'/>" />