Javascipt is not work in spring portlet mvc
Hi,
I’m developing a Portlet with Spring 2.5.5(tried Spring 2.0), I success in registering the portlet in liferay5.1.2 with tomcat5.5. In this application, I want to launch a popup window from my portlet and manage it with a Spring MVC controller of this portlet. I have read many related paper in spring community and liferay community. I find a good reference:
forum.springframework.org/showthread.php?t=59196
the author provides a solution for us:
PortletURL popUpURL = response.createRenderURL();
popUpURL.setParameter("action", "popUpController");
popUpURL.setParameter("windowState",LiferayWindowS tate.EXCLUSIVE.toString());
unfortunately, above javascript segment can’t work well in my environment. The IE6 always says ‘line 492: ; is expected’, I debug and find line 492 is
PortletURL popUpURL = response.createRenderURL();
Further debugging, I find IE6 can’t recognize PortletURL and response. Bisides, I find IE6 can’t recognize renderRequest and renderResponse, thought I add some common required code into the jsp header.
So my question is:
1) What’s wrong with my configuration?
2) Why the javascript(liferay-portal-tomcat-6.0-5.1.2\webapps\ROOT\html\js) can’t work well? But my own javascript(such as dtree.js below) can work well.
3) Are these problems related to Spring Portlet MVC?
Two jsp pages in my application as follows:
CommonComponentView.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/include/portletDefineObjects.jsp" %>
<%@ taglib prefix="form" uri="www.springframework.org/tags/form" %>
<%@ taglib uri="java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="java.sun.com/jsp/jstl/core" prefix="c" %>
<%--<%@ taglib uri="java.sun.com/portlet" prefix="portlet" %>--%>
<%--<portlet:defineObjects/>--%>
<html>
<head>
<script src="/inp/script/jquery-1.2.6.js" type="text/javascript"></script>
<script src="/inp/script/ui.core.js" type="text/javascript"></script>
<script src="/inp/script/ui.tabs.js" type="text/javascript"></script>
<script src="/inp/script/dtree.js" type="text/javascript"></script>
<script src="/inp/script/liferay/popup.js" type="text/javascript"></script>
<script type="text/javascript">
function SetCurrentSelect(fragmentnum,navigation_type_sid,n avigation_sid){
var nodePath=eval("d"+fragmentnum).getNodePath(navigat ion_sid);
document.all.bread.innerText = nodePath;
PortletURL popUpURL = response.createRenderURL();
popUpURL.setParameter("action", "popUpController");
popUpURL.setParameter("windowState", LiferayWindowState.EXCLUSIVE.toString());
}
</script>
</head>
<body>
…...
</body>
portletDefineObjects.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="java.sun.com/portlet" prefix="portlet" %>
<%@ page import="javax.portlet.RenderRequest"%>
<%@ page import="javax.portlet.RenderResponse"%>
<%@ page import="javax.portlet.PortletConfig"%>
<%
RenderRequest renderRequest = (RenderRequest)request.getAttribute("javax.portlet .request");
RenderResponse renderResponse = (RenderResponse)request.getAttribute("javax.portle t.response");
PortletConfig portletConfig = (PortletConfig)request.getAttribute("javax.portlet .config");
%>
<portlet:defineObjects />
Thanks in advance.
Boocheen
111111111111111111111111111111111111
11111111111111111111111111111111111111111111]11111111111111111111111
]11111111111111111111111111111111111111111111111111 111:d