[opencms-dev] error finding resource <cms:link>

bub habub japorami at yahoo.com
Fri Jul 22 08:14:33 CEST 2005


ok here is my code. maybe the link tag doesn't work.
no clue

search-from.jsp:

<%@ page session="false" %>
<%
// If a param q is found, it is placed in the text
box.
String qval = request.getParameter("q");
if(qval == null) qval = "";
%>
<form method="GET" name="searchform"
action="<cms:link>searchresults.jsp</cms:link>"> 
Search:<input type="text" name="q" value="<%= qval
%>"/>
<input type="submit" value="Go"/>
</form>


searchresults.jsp that is in the same folder:
<%@ page session="false" %>
<%@ taglib prefix="cms"
uri="http://www.opencms.org/taglib/cms" %>
<div style="display:table; padding: 5px;">
<cms:include
file="/system/modules/org.opencms.frontend.templateone/pages/search.html"/>
</div>


and the search.html looks like this. thought this is
the file i have to refer if i want to do a search.
understood it this way, here the search is defined.
maybe i'm wrong.

<%@ page session="false" buffer="none"
import="java.util.*,org.opencms.search.*,org.opencms.frontend.templateone.*"
%><%--

This is the search code page.

--%><%

// initialise the template bean
CmsTemplateSearch cms = new
CmsTemplateSearch(pageContext, request, response);

// include the template head
cms.includeWithPageUri("head");

%><%--
--%><jsp:useBean id="search" scope="request"
class="org.opencms.search.CmsSearch"><%--
--%><jsp:setProperty name="search" property="*"/><% 
    	search.init(cms.getCmsObject());
    	search.setMatchesPerPage(10);
    	search.setQueryLength(3);
    	search.setDisplayPages(11); %><%--
--%></jsp:useBean><%--

--%><div class="element">
<h2><%= cms.buildSearchHeadline() %></h2>
<p style="vertical-align: middle;">
<form style="margin: 0;" name="searchform"
method="post" action="<%=
cms.link("/system/modules/org.opencms.frontend.templateone/pages/search.html")
%>" onsubmit="return
parseSearchQuery(document.forms['searchform'], '<%=
cms.key("search.error.wordlength") %>');">
<input type="hidden" name="action" value="search" />
<input type="hidden" name="query" value="" />
<input type="hidden" name="index" value="<%=
cms.getSearchIndexName() %>" />
<input type="hidden" name="page" value="1" />
<input type="hidden" name="<%=
CmsTemplateBean.PARAM_URI %>" value="<%=
cms.getRequestContext().getUri() %>" />
<input type="hidden" name="__locale" value="<%=
cms.getRequestContext().getLocale() %>" />

<span style="vertical-align: middle; padding-left:
4px;"><input type="text" name="query2" class="search"
style="width: 350px" value="<%= search.getQuery() %>"
/></span>
<span style="vertical-align: middle;"><input
type="submit" value="<%= cms.key("link.search") %>"
class="formbutton" /></span><br />     
<span style="line-height: 3px; font-size:
1px;"> </span><%

if (cms.isSearchAllDisplayed()) {

%><br />
<span style="vertical-align: middle;"><input
type="checkbox" name="<%=
CmsTemplateSearch.PARAM_SEARCHALL %>" value="true"<%=
cms.getSearchAllChecked() %>></span>
<span style="vertical-align: middle;"><%=
cms.key("search.text.all") %></span><%

}

%><br /> 
</form>
</p>
<%

// get the search results for the page
List result = cms.getSearchResults(search);

out.print(cms.buildSearchErrorMessages(search,
result));

if (result != null && result.size() > 0) {
	
	// show the result list
	out.print(cms.buildSearchResultList(result));
	
	// show the links to other result pages
	out.print(cms.buildSearchLinks(search));	
	
}

%>
</div>
<%
// include the template head
cms.includeWithPageUri("foot");
%>







> >
> >have a problem. get an error when using <cmc:link>
> >
> >it throws an error resouce not found even though
> the
> >resources is there.
> >tried it in different ways, with full path and
> >without. didn't work.
> >any suggestions
> >
> could you post some lines of your opencms-code?
> 
> Greetings
> Anatol
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev
> mailing list
> To change your list options, or to unsubscribe from
> the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the opencms-dev mailing list