Results 1 to 5 of 5

Thread: Javascipt is not work in spring portlet mvc

Threaded View

  1. #1
    Join Date
    Feb 2009
    Posts
    3

    Default 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
    Last edited by boocheen; Feb 23rd, 2009 at 01:33 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •