<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Exception:Cannot make a static reference to the non-static method</title>
  <link rel="self" href="https://liferay.dev/fi/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=4678173" />
  <subtitle>Exception:Cannot make a static reference to the non-static method</subtitle>
  <id>https://liferay.dev/fi/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=4678173</id>
  <updated>2026-06-26T17:03:00Z</updated>
  <dc:date>2026-06-26T17:03:00Z</dc:date>
  <entry>
    <title>RE: Exception:Cannot make a static reference to the non-static method</title>
    <link rel="alternate" href="https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678789" />
    <author>
      <name>Faisal K</name>
    </author>
    <id>https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678789</id>
    <updated>2010-03-04T09:30:20Z</updated>
    <published>2010-03-04T09:30:20Z</published>
    <summary type="html">Hey Mistakes always happens, but be pro active!. some time we spend lot of time for such Typo errors.&lt;br /&gt;&lt;br /&gt;Enjoy!</summary>
    <dc:creator>Faisal K</dc:creator>
    <dc:date>2010-03-04T09:30:20Z</dc:date>
  </entry>
  <entry>
    <title>RE: Exception:Cannot make a static reference to the non-static method</title>
    <link rel="alternate" href="https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678681" />
    <author>
      <name>asile elisa</name>
    </author>
    <id>https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678681</id>
    <updated>2010-03-04T09:22:51Z</updated>
    <published>2010-03-04T09:22:51Z</published>
    <summary type="html">yes you are absolutly right &lt;br /&gt;I didnot notice the P &lt;br /&gt;stupid mistake &lt;br /&gt;thx</summary>
    <dc:creator>asile elisa</dc:creator>
    <dc:date>2010-03-04T09:22:51Z</dc:date>
  </entry>
  <entry>
    <title>RE: Exception:Cannot make a static reference to the non-static method</title>
    <link rel="alternate" href="https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678381" />
    <author>
      <name>Faisal K</name>
    </author>
    <id>https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678381</id>
    <updated>2010-03-04T08:52:55Z</updated>
    <published>2010-03-04T08:52:55Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi,&lt;br&gt;&lt;br&gt;Java basics is very week!.you are trying to use this code &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;instead of&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
portletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Before posting issues, please make sure you at least a basic review.&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Faisal.K&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Faisal K</dc:creator>
    <dc:date>2010-03-04T08:52:55Z</dc:date>
  </entry>
  <entry>
    <title>Exception:Cannot make a static reference to the non-static method</title>
    <link rel="alternate" href="https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678172" />
    <author>
      <name>asile elisa</name>
    </author>
    <id>https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4678172</id>
    <updated>2010-03-04T08:34:07Z</updated>
    <published>2010-03-04T08:34:07Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;hey&lt;br&gt;&lt;br&gt;any one has seen this exception :&lt;br&gt;&lt;br&gt;Cannot make a static reference to the non-static method setParameter(String, String) from the type PortletURL&lt;br&gt;&lt;br&gt;I guess this is the line that declached this exception:&lt;br&gt;&lt;br&gt;&amp;lt;%PortletURL portletURL=renderResponse.createRenderURL();&lt;br&gt;PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");%&amp;gt;&lt;br&gt;&lt;br&gt;I will give you the code of my view.jsp:&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%&amp;amp;gt;

&amp;amp;lt;%@ include file="/html/portlet/ext/library/init.jsp" %&amp;amp;gt;


&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&amp;gt;
&amp;lt;title&amp;gt;Insert title here&amp;lt;/title&amp;gt;


hiiiiiiiiiiiiiiiiiiii

&amp;lt;br&amp;gt;
Add a book entry to the Library:
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;form action="&amp;lt;portlet:actionURL windowState=" &amp;lt;%="WindowState.MAXIMIZED.toString()" %&amp;gt;"&amp;amp;gt;&amp;lt;portlet:param name="struts_action" value="/ext/library/add_book" /&amp;gt;" method="post" name="&amp;lt;portlet:namespace /&amp;gt;fm"&amp;amp;gt;
Book Title:
&amp;lt;input name="&amp;lt;portlet:namespace /&amp;gt;book_title" size="20" type="text" value=""&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;input type="button" value="Submit" onClick="submitForm(document.&amp;lt;portlet:namespace /&amp;gt;fm);"&amp;gt;
&amp;lt;/form&amp;gt;

&amp;amp;lt;%PortletURL portletURL=renderResponse.createRenderURL();
PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");%&amp;amp;gt;
&lt;/code&gt;&lt;form action="&lt;%= portletURL.toString() %&gt;" method="post" name="&lt;portlet:namespace /&gt;fm" onSubmit="submitForm(this); return false;"&gt;&lt;code&gt;


&amp;amp;lt;%
		BookSearch searchContainer = new BookSearch(renderRequest, portletURL);//renderRequest???????????????????????????????????

		List headerNames = searchContainer.getHeaderNames();

		%&amp;amp;gt;

&amp;lt;liferay-ui:search-form page="/html/portlet/ext/library/serach.jsp" searchContainer="&amp;lt;%= searchContainer %&amp;gt;" /&amp;gt;
		
	&amp;amp;lt;%
			BookSearchTerms searchTerms = (BookSearchTerms)searchContainer.getSearchTerms();
	int total = BookLocalServiceUtil.searchCount(searchTerms.getId(),searchTerms.getTitle());


			searchContainer.setTotal(total);
			
			List results = BookLocalServiceUtil.search( searchTerms.getId(), searchTerms.getTitle());
			
						searchContainer.setResults(results);
						
						
						List resultRows = searchContainer.getResultRows();
						
						for (int i = 0; i &amp;amp;lt; results.size(); i++) {
							
							Book book = (Book)results.get(i);
							
							ResultRow row = new ResultRow(book, book.getPrimaryKey().toString(), i);

							PortletURL rowURL = renderResponse.createRenderURL();
							
							
							row.addText(book.getBookId(), rowURL);
							row.addText(book.getTitle(),rowURL);


							resultRows.add(row);
							
							
						}
						
						
						%&amp;amp;gt;

	&amp;lt;liferay-ui:search-iterator searchContainer="&amp;lt;%= searchContainer %&amp;gt;" /&amp;gt;

&amp;lt;liferay-ui:search-paginator searchContainer="&amp;lt;%= searchContainer %&amp;gt;" /&amp;gt;



&amp;lt;br&amp;gt;


&lt;/code&gt;&lt;/form&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;thanks&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>asile elisa</dc:creator>
    <dc:date>2010-03-04T08:34:07Z</dc:date>
  </entry>
</feed>
