grails-portlets 0.7 및 grails-portlets-liferay 0.2 플러그인과 함께 Grails 1.2.1을 사용하여 Liferay 5.2.2 용 간단한 포틀릿을 생성하려고합니다.Grails Liferay 포틀릿이 동작하지 않음
재고 포틀릿 (제목, 설명 등을 업데이트 한 것)을 작성하여 배치했습니다. 올바르게 배치되고보기가 올바르게 렌더링됩니다. 그러나 view.gsp
에있는 기본 양식을 제출하면 actionView
기능을 사용하지 않습니다. I 포틀릿을 볼 때마다
SearchPortlet.groovy
class SearchPortlet {
def title = 'Search'
def description = '''
A simple search portlet.
'''
def displayName = 'Search'
def supports = ['text/html':['view', 'edit', 'help']]
// Liferay server specific configurations
def liferay_display_category = 'Category'
def actionView = {
println "In action view"
}
def renderView = {
println "In render view"
//TODO Define render phase. Return the map of the variables bound to the view
['mykey':'myvalue']
}
...
}
view.gsp
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<div>
<h1>View Page</h1>
The map returned by renderView is passed in. Value of mykey: ${mykey}
<form action="${portletResponse.createActionURL()}">
<input type="submit" value="Submit"/>
</form>
</div>
톰캣 단말 인쇄 In render view
을 :
여기에 관련된 코드 비트이다 그리고 나서 나는 을 제출하십시오. 단추. In action view
문을 인쇄하지 않습니다.
아이디어가 있으십니까?
업데이트
나는 로깅 설정이 내가이 포틀릿에 제출 버튼을 클릭 할 때마다 볼 것입니다 : 해당 로그 스 니펫 (snippet)의 네 번째 줄은 바운드 을 말한다
[localhost].[/gportlet] - servletPath=/Search, pathInfo=/invoke, queryString=null, name=null
[localhost].[/gportlet] - Path Based Include
portlets.GrailsDispatcherPortlet - DispatcherPortlet with name 'Search' received render request
portlets.GrailsDispatcherPortlet - Bound render request context to thread: [email protected]
portlets.GrailsDispatcherPortlet - Testing handler map [[email protected]] in DispatcherPortlet with name 'Search'
portlets.GrailsDispatcherPortlet - Testing handler adapter [[email protected]]
portlets.GrailsPortletHandlerAdapter - portlet.handleMinimised not set, proceeding with normal render
portlet.SearchPortlet - In render view
portlets.GrailsPortletHandlerAdapter - Couldn't resolve action view /search/null.gsp
portlets.GrailsPortletHandlerAdapter - Trying to render mode view /search/view.gsp
portlets.GrailsDispatcherPortlet - Setting portlet response content type to view-determined type [text/html;charset=ISO-8859-1]
[localhost].[/gportlet] - servletPath=/WEB-INF/servlet/view, pathInfo=null, queryString=null, name=null
[localhost].[/gportlet] - Path Based Include
portlets.GrailsDispatcherPortlet - Cleared thread-bound render request context: [email protected]
portlets.GrailsDispatcherPortlet - Successfully completed request
렌더링 요청 ..., 포틀릿에있는 양식의 작업이 작업 URL에 있기 때문에 이해할 수 없습니다. 나는 그것이 행동 요청이어야한다고 생각했을 것이다.
환상적인 발견, 감사처럼 일! –