I can't see what I'm
doing wrong in the xsp file. The error logs aren't helping me see it
either.
Any suggestions? I'm
having a real hard time understanding the documentation. It probably
shows.
Matthew
From the form.xsp
file:
...
<form>
<xsp:logic>
String m_strFormAction = "home/form";
if( <xsp-request:get-parameter name="test-name"/> == null ){
<xsp-session:set-attribute name="test-name-title">Test Title</xsp-session:set-attribute>
<field id="test-name" label="Test Name" type="select">
<value value="-1"><xsp-session:get-attribute name="test-name-title"/></value>
<esql:connection>
<esql:pool>dbpool</esql:pool>
<esql:execute-query>
<esql:query>select * from tests</esql:query>
<esql:results>
<esql:row-results>
<value>
<xsp:attribute name="value"><esql:get-string column="test_id"/></xsp:attribute>
<esql:get-string column="test_name"/>
</value>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</field>
}
...
<xsp:logic>
String m_strFormAction = "home/form";
if( <xsp-request:get-parameter name="test-name"/> == null ){
<xsp-session:set-attribute name="test-name-title">Test Title</xsp-session:set-attribute>
<field id="test-name" label="Test Name" type="select">
<value value="-1"><xsp-session:get-attribute name="test-name-title"/></value>
<esql:connection>
<esql:pool>dbpool</esql:pool>
<esql:execute-query>
<esql:query>select * from tests</esql:query>
<esql:results>
<esql:row-results>
<value>
<xsp:attribute name="value"><esql:get-string column="test_id"/></xsp:attribute>
<esql:get-string column="test_name"/>
</value>
</esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</field>
}
...
<field
id="choose-results" label="Choose Results"
type="submit"/>
<action><xsp:expr>m_strFormAction</xsp:expr></action>
</xsp:logic>
</form>
...
<action><xsp:expr>m_strFormAction</xsp:expr></action>
</xsp:logic>
</form>
...
From the access.log
file:
org.apache.cocoon.ProcessingException: Language
Exception: org.apache.cocoon.components.language.LanguageException: Error
compiling form_xsp:
ERROR 1 (D:\apps\Tomcat 4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/eval/logic/home\form_xsp.java):
...
)
== "-1" ){
session.setAttribute(String.valueOf("test-name"),
ERROR 1 (D:\apps\Tomcat 4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/eval/logic/home\form_xsp.java):
...
)
== "-1" ){
session.setAttribute(String.valueOf("test-name"),
// start error
(lines 611-611) " unclosed character
literal"
"
"
// end
error
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
...
ERROR 2 (D:\apps\Tomcat 4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/eval/logic/home\form_xsp.java):
...
)
== "-1" ){
session.setAttribute(String.valueOf("test-name"),
ERROR 2 (D:\apps\Tomcat 4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/eval/logic/home\form_xsp.java):
...
)
== "-1" ){
session.setAttribute(String.valueOf("test-name"),
// start error
(lines 611-611) " illegal start of
expression"
"
"
// end
error
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
...
ERROR 3 (D:\apps\Tomcat 4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/eval/logic/home\form_xsp.java):
...
"test-name", null,
null,
null))
ERROR 3 (D:\apps\Tomcat 4.1\work\Standalone\localhost\cocoon\cocoon-files\org/apache/cocoon/www/eval/logic/home\form_xsp.java):
...
"test-name", null,
null,
null))
// start error
(lines 618-618) " unclosed character
literal"
");
");
// end
error
xspAttr.addAttribute(
"",
xspAttr.addAttribute(
"",
...
From the
form_xsp.java file:
else
{
if(
(
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
null))
)
== "-1" ){
session.setAttribute(String.valueOf("test-name"),
"
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
null))
");
xspAttr.addAttribute(
"",
"id",
"id",
"CDATA",
"test-name"
);
xspAttr.addAttribute(
"",
"label",
"label",
"CDATA",
"Test Name"
);
if(
(
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
null))
)
== "-1" ){
session.setAttribute(String.valueOf("test-name"),
"
(XSPRequestHelper.getParameter(objectModel,
"test-name", null,
null,
null))
");
xspAttr.addAttribute(
"",
"id",
"id",
"CDATA",
"test-name"
);
xspAttr.addAttribute(
"",
"label",
"label",
"CDATA",
"Test Name"
);