Hi Marco / Deb
I have a bit of a conceptual block understanding the chain that Liferay MVC marries a liferay service builder definition to a form. I am reading Rich Sezof's Liferay in action and have copied his code for PRRegistration as far as I can.
What is the missing magic?
How do the names all tie up from Service Builder to Action class and view.jsp?
a) In serviceBuilder.xml I have
1 <entity name="ISGSicCode" local-service="true"
2 remote-service="true">
3
b) Then I have an action
1
2package com.shorai.isg.action
3public class Sic extends MVCPortlet {
4 public void addSic(ActionRequest request, ActionResponse response) throws Exception {
c) In portlet.xml
1
2 <portlet>
3 <portlet-name>sic</portlet-name>
4 <display-name>Sic</display-name>
5 <portlet-class>com.shorai.isg.action.Sic</portlet-class>
6 <init-param>
7 <name>view-jsp</name>
8 <value>/html/sic/view.jsp</value>
9 </init-param>
10 <init-param>
11 <name>action.package.prefix</name>
12 <value>com.shorai.isg.action</value>
13 </init-param>
d) In jsp
1
2<%@ page import="com.shorai.isg.action.Sic" %>
3<%@ page import="com.shorai.isg.action.SicUtil" %>
4......
5<portlet:actionURL name="addSic" var="addSicURL">
6 <aui:form action="<%= addSicURL.toString() %>" method="post">
Tomcat responds
1
2Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP:
3
4An error occurred at line: 80 in the jsp file: /html/sic/view.jsp
5addSicURL cannot be resolved
677:
778:
879: <portlet:actionURL name="addSic" var="addSicURL">
980: <aui:form action="<%= addSicURL.toString() %>" method="post">
1081: <aui:fieldset label="Add Sic Code">
1182: <aui:input name="code" />
1283: <aui:input name="parent" />
13Stacktrace:
14 at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
15 at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
when I look in view.java I find the following, but dont have a way to enumerate _jspx_page_context.
I tried enumerating the application, page, session and request attributes but cant find the missing addSicURL
1
2java.lang.String addSicURL = null;<br/>
3addSicURL = (java.lang.String) _jspx_page_context.findAttribute("addSicURL");
thanks in advance, I've pulled nearlty all my remaining hair out on this one.
Chris
Bitte melden Sie sich an, um diesen Inhalt als unangebracht zu kennzeichnen.