Click to See Complete Forum and Search --> : Understanding Code??


essex_finest
09-18-2006, 05:22 AM
Hi,

Hi,

Im fairly new to HTML and have a bit of code that i don't understand what it exactly does. I was hoping someone could help me and comment the whole document on what each are does?

I have pasted the source code below:

<html>

<%-- DECLARATIONS --%>
<%@ page import="se.ibs.ns.cf.*, se.ibs.ccf.*, se.ibs.bap.*, se.ibs.bap.util.*, se.ibs.bap.web.*, java.util.*, se.ibs.ns.icat.*, se.ibs.bap.asw.cf.*, java.lang.*" %>
<% ItemCatalogueBean bean = (ItemCatalogueBean)SessionHelper.getSessionObject("ItemCatalogueBean",session);
String resourcePath = bean.getResourcePath(null);
String title = "Product catalogue";
String languageCode = bean.getLanguageCode();
%>

<%@ include file="FuncHead.jsp" %>
<BODY class="IBSBody" onLoad="loaded = true;">
<form method="POST" action=<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueSearchServlet", response) %> name="basicForm">
<%@ include file="FuncSubmitScript.jsp" %>
<%@ include file="FuncPageBegin.jsp" %>

<div align="center">
<table border="0" width="895">
<tr>
<td align="left" width="502">
<div align="left">
<table border="0" width="500">
<tr>
<td class="IBSPageTitleText" align="left" valign="top" width="238">

<%@ include file="FuncPageTitle.jsp" %>
<%@ include file="FuncPageTitleImage.jsp" %>
<br>
On this page you can see the product catalogues. Click on one of the
links to go to the next level. Alternatively you can click the <b>Search
catalogue</b> button to find the products of interest.</td>
<td width="248" valign="bottom">
<div align="left"><%@ include file="FuncShoppingCart.jsp" %></div>
</td>
</tr>
</table>
</div></td></tr></table></div>

<input type="submit" value="Search catalogue" name="ACTION_NONE" onClick="submitButtonOnce(this); return false">
<hr>

<%-- REPEAT CATALOGUES --%>
<div align="left">
<table border="2" width="100%">
<% Vector catalogues = bean.getItemCatalogues();
int cataloguesSize = catalogues.size();
for (int i = 0; i < cataloguesSize; i++)
BAPItemCatalogue cat = (BAPItemCatalogue) catalogues.elementAt(i); %>

<%-- LINK AND MARK AS NEW --%>
<tr>
<td width="23%"><a class="IBSMenuLink" href="link" onClick="javascript:invokeLink('<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueCategoryServlet", response) %>?CODE=<%= ToolBox.encodeURLParameter(cat.getCode())%>'); return false">
<%= cat.getDescription(languageCode) %></a>
</td>
<td width="40%" align="right">
<% if (cat.isNew()) {%>
<img border=0 src="<%= resourcePath %>new.gif">
<% } %>
</td>
</tr>

<%-- CATALOGUES IMAGE AND INTERNET INFORMATION (text, multimedia objects,downloads, links...) --%>
<tr>
<td width="23%" valign="top" align="left">
<% if (bean.isAdvanced(cat) && bean.hasMultimediaImage(cat)) { %>
<a href="link" onClick="javascript:invokeLink('<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueCategoryServlet", response) %>?CODE=<%= ToolBox.encodeURLParameter(cat.getCode())%>'); return false">
<img border="0" src="<%= bean.getMultimediaImage(cat) %>"></a>
<% } else {%>
<img border="0" src="<%= resourcePath %>Catalog.gif">
<% } %>

</td>
<td class="IBSTextNormal" width="40%" valign="top">
<%= bean.getWebText(cat) %>
</td>
</tr>


<tr>
<td width="23%">
</td>
<td width="40%">
<% Vector mmLinks = bean.getMultimediaLinks(cat);
int mmLinksSize = mmLinks.size();
for (int ml=0; ml<mmLinksSize; ml++){
BAPCodeAndDescription mmLink = (BAPCodeAndDescription)mmLinks.elementAt(ml); %>
<a class="IBSLink" href="<%= mmLink.getCode() %>" target="_blank"><%= mmLink.getDescription() %></a><br>
<% } %>
<% Vector webLinks = bean.getWebLinks(cat);
int webLinksSize = webLinks.size();
for (int wl=0; wl<webLinksSize; wl++){
BAPCodeAndDescription webLink = (BAPCodeAndDescription)webLinks.elementAt(wl); %>
<a class="IBSLink" href="<%= webLink.getCode() %>" target="_blank"><%= webLink.getDescription() %></a><br>
<% } %>
</td>
</tr>
<%}%>
</table>
</div>

<%@ include file="FuncPageLinks.jsp" %>

<%@ include file="FuncPageEnd.jsp" %>
</form>
</body>
</html>

Thank you,

essex_finest

bathurst_guy
09-18-2006, 05:28 AM
Most of that code isn't HTML, but ASP or JSP. Not sure which as I don't know much about either of them.

essex_finest
09-18-2006, 05:32 AM
So would you recommend posting it on the ASP/JSP forum instead???

bathurst_guy
09-18-2006, 05:33 AM
If you want to learn any of these languages I recommend a couple of tutorials (www.w3schools.com).

pcthug
09-18-2006, 06:14 AM
The posted code appears to be JSP. Moved to Java Forum.