• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sourceforge's display tag not working

 
M M Islam Chisty
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

While I was trying to display a list of users in my jsp page using the <display> tag provided by sourceforge (http://sourceforge.net/project/showfiles.php?group_id=73068), it does not seem to work. Rather than displaying the page in a styled/formatted way, it displays the user list in very simple tabular format (the same output would be shown if I just used the html table tag).

It does not seem to use the class defined in the StyleSheet. What might be the reason? Any suggestion?



The code for my jsp page (userlist.jsp):
----------------------------------------

<%@ include file="/jsp/taglibs.jsp" %>
<html>

<head>
<title>The user list</title>
<link rel="stylesheet" href="../css/screen.css" type="text/css"/>

</head>


<h3>Showing UserList</h3>


<body>

<display:table id="a" name="users" class="simplex">
<display:column property="userid" title="User Id"/>
<display:column property="firstname" title="First Name" />
<display:column property="lastname" title="Last Name" />
<display:column property="email" title="Email" />
<display:column property="address" title="Address" />
<display:column property="groupname" title="Group Name" />
</display:table>

<html:link href="jsp/index.jsp"> Back to Main Page </html:link>
</body>
</html>


Portion of the code in my screen.css file:
------------------------------------------

table {
border: 1px solid #808000 ;
color: #800000;
padding: 0;
background-color: #FFFFBF
}


tr {
border: 1px solid #808000
}

td {
border: 1px solid #C0C0C0;
background-color: #FFFFBF
}


table.simplex thead tr {
background-color: #ffe0cc;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #555555;
}

table.simplex tr.odd {
background-color: #ffefe5;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}

table.simplex tr.even {
background-color: #ffe0cc;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}

table.simplex {
border-collapse: collapse;
border: 1px solid #FFB27F;

}


And the taglibs.jsp:
--------------------
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/displaytag-12.tld" prefix="display" %>
<%@ taglib uri="/WEB-INF/displaytag-el-12.tld" prefix="display-el" %>


Any suggestion/advice from you would be higly appreciated.

With Thanks,
... Chisty
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chisty,

We use a similar approach and everything looks fine to me. However here there are few hints for you.
First you can try this:

Second check if the screen.css is located in a folder named css at the same level with the folder storing your jsp page.
Finally you can try to �debug� your jsp, getting the html source after the page get rendered in your browser and saving it to some temporary folder. Copy the structure of your app to that folder, creating all required subfolders (like images, css, pages, etc) and simply loading the plain html from there.
Regards.
 
M M Islam Chisty
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for your suggestion. Yes, I tried all the possible ways you suggested but it was not working anyhow.

Then suddenly, during the changes I was making, it worked. I found out that it was just a silly mistake of mine. It worked if I used href="css/screen.css" rather than href="../css/screen.css" with the folder structure you suggested. So, here is a brief if it might be useful for others:

Folder Structure:
-----------------

web
|_ css (screen.css, otherstyles.css .. etc)
|_ jsp (page1.jsp, page2.jsp .. etc)


Code in JSP:
-----------

And the jsp pages should include the link tag as follows:
<link rel="stylesheet" type="text/css" href="css/screen.css">

Then, it will work fine.


But here is another query which might sound interesting! Why should this actually work?

If the directory structure is maintaned as above, then it should only work the way you sugggested i.e. as follows:
<link rel="stylesheet" type="text/css" href="../css/screen.css">

Any idea?


And, thank you again for your suggestion. You had been a great help.

Warmest Regards,
.. Chisty
[ June 06, 2005: Message edited by: M M Islam Chisty ]
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it all depends upon the way the absolute address is defined. Most commonly this is extracted from the current url, or it might be specified using the html <BASE> tag. No matter the way it�s done, it follows the usual unix/windows conventions. Hence if your absolute path follows the disk path then you are ok. For example if you get your page using an absolute address like this:

And following the directory structure you mentioned, a relative url might be defined as follows:

But if you change the base url you have to change the relative path as well:


And by the way Chisty, you�re very welcomed
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!