Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Exception:Cannot make a static reference to the non-static method
4620263, modifié il y a 16 années.
Regular Member
Publications: 126
Date d'inscription: 17/02/10
Publications récentes
hey
any one has seen this exception :
Cannot make a static reference to the non-static method setParameter(String, String) from the type PortletURL
I guess this is the line that declached this exception:
<%PortletURL portletURL=renderResponse.createRenderURL();
PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");%>
I will give you the code of my view.jsp:
thanks
any one has seen this exception :
Cannot make a static reference to the non-static method setParameter(String, String) from the type PortletURL
I guess this is the line that declached this exception:
<%PortletURL portletURL=renderResponse.createRenderURL();
PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");%>
I will give you the code of my view.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="ISO-8859-1"%>
<%@ include file="/html/portlet/ext/library/init.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
hiiiiiiiiiiiiiiiiiiii
<br>
Add a book entry to the Library:
<br><br>
<form action="<portlet:actionURL windowState=" <%="WindowState.MAXIMIZED.toString()" %>"><portlet:param name="struts_action" value="/ext/library/add_book" />" method="post" name="<portlet:namespace />fm">
Book Title:
<input name="<portlet:namespace />book_title" size="20" type="text" value=""><br><br>
<input type="button" value="Submit" onClick="submitForm(document.<portlet:namespace />fm);">
</form>
<%PortletURL portletURL=renderResponse.createRenderURL();
PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");%>
thanks
380705, modifié il y a 16 années.
Regular Member
Publications: 138
Date d'inscription: 09/01/08
Publications récentes
Hi,
Java basics is very week!.you are trying to use this code
instead of
Before posting issues, please make sure you at least a basic review.
Regards,
Faisal.K
Java basics is very week!.you are trying to use this code
PortletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");
instead of
portletURL.setParameter("struts_action","/html/portlet/ext/library/view.jsp");
Before posting issues, please make sure you at least a basic review.
Regards,
Faisal.K
4620263, modifié il y a 16 années.
Regular Member
Publications: 126
Date d'inscription: 17/02/10
Publications récentes
yes you are absolutly right
I didnot notice the P
stupid mistake
thx
I didnot notice the P
stupid mistake
thx
380705, modifié il y a 16 années.
Regular Member
Publications: 138
Date d'inscription: 09/01/08
Publications récentes
Hey Mistakes always happens, but be pro active!. some time we spend lot of time for such Typo errors.
Enjoy!
Enjoy!
Community
Company
Feedback