cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Interesse Michelangelo <M.Intere...@netsiel.it>
Subject R:R:HTML forms with dynamic values
Date Fri, 04 Feb 2000 18:55:16 GMT
> ----------
> Da:	Donald Ball[SMTP:balld@webslingerZ.com]
> Risposta a: 	cocoon-dev@xml.apache.org
> Inviato:	giovedì 3 febbraio 2000 20.35
> A:	'cocoon-dev@xml.apache.org'
> Oggetto:	Re: R:HTML forms with dynamic values
> 
> On Thu, 3 Feb 2000, Interesse Michelangelo wrote:
> 
> > I can guess how in a simple model. But when some more work is required
> in
> > order to fulfill combos ... some supporting framework is required ....
> > 
> > I've used in my JSP pages thinks like this:
> > 				    <% tab.doDistinct("AziendaS",
> > "QARisorse"); %>
> >                   <select name="AziendaS">
> > 					<%= tab.getCombo("(Tutti)") %>
> >                   </select>
> > 
> > But when I need to synch the choice in one combo with the values shown
> in
> > another one, some javascript is required ..... and the things get harder
> ...
> > for maintenability too.
> > 
> > Do you use different frameworks in order to make things easier to build
> ....
> > and to mantain ??
> 
> Look at the flow control mechanisms XSLT gives you. xsl:if, xsl:choose,
> xsl:for-each, etc., should allow you to build forms conditionally.
> http://www.w3.org/TR/xslt. Or am I missing something?
> 
> - donald
> 
About the flow control I tryed to mix JSP flow control statements with XML,
but in separate files in order to get true separation between logic and data
(and presentation, of course) .
I wrote the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">

<HTML>
<HEAD>
<TITLE>Risorse</TITLE>

<!--%@ include file="T_HEAD.jsp" %-->
<%@ page
	session="true"
	autoFlush="true"
	isThreadSafe="true"
	contentType ="text/html; charset=ISO-8859-1"
	errorPage ="error.jsp"
%>
<META HTTP-EQUIV="pragma" CONTENT="no-cache">

<%@ page import = "com.netsiel.NMWEB.TARisorse, com.netsiel.NMWEB.Table,
com.ibm.jsp.TableFormat" %>
<%@ page import = "com.ibm.jsp.JSPBase" %>
<%@ page import = "java.util.*" %>

<!--% AccountSummary account = (AccountSummary)
request.getAttribute("TestJSPTableFormat"); %-->
<%
//	JSPBase.setMode(JSPBase.JSP_MODE_NORMAL);
	JSPBase.setMode(JSPBase.JSP_MODE_PROGRAMMER);
//	TARisorse risorse = new TARisorse(session,out);
//	Table tab = new Table(session,out);

	if (true)
	{
%>

<jsp:include page="../jsp/xml/database.xml" flush="true">
	<jsp:param name="op" value="auth" />
	<jsp:param name="c" value="Interesse" />
</jsp:include>


<%
		if (false)
		{
%>

<!-- do something -->

<%
		}
	}
	else
	{
%>
<!-- do something -->

<%
	}
%>

<%@ include file="T_TRAIL.htm" %>

But astonishing I got the following exception by Cocoon:
White space is required between the public identifier and the system
identifier.
	at java.lang.Throwable.(Compiled Code)
	at java.lang.Exception.(Compiled Code)
	at org.xml.sax.SAXException.(SAXException.java:38)
	at org.xml.sax.SAXParseException.(SAXParseException.java:46)
	at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1249)
	at
org.apache.xerces.framework.XMLDTDScanner.reportFatalXMLError(XMLDTDScanner.
java:656)
	at
org.apache.xerces.framework.XMLDTDScanner.scanExternalID(XMLDTDScanner.java:
1148)
	at
org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java
:1077)
	at
org.apache.xerces.validators.dtd.DTDValidator.scanDoctypeDecl(DTDValidator.j
ava:440)
	at
org.apache.xerces.framework.XMLParser.scanDoctypeDecl(XMLParser.java:2011)
	at
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XM
LDocumentScanner.java:768)
	at org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
Code)
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1138)
	at org.apache.cocoon.parser.XercesParser.parse(XercesParser.java:82)
	at
org.apache.cocoon.producer.AbstractProducer.getDocument(AbstractProducer.jav
a)
	at org.apache.cocoon.Engine.handle(Compiled Code)
	at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
	at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled
Code)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:224)
	at
org.apache.tomcat.core.RequestDispatcherImpl.include(RequestDispatcherImpl.j
ava:249)
	at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:348)
	at
_0002fjsp_0002fdatabase_0002ejsp_0002fjsp_0002fdatabase_jsp_3._jspService(_0
002fjsp_0002fdatabase_0002ejsp_0002fjsp_0002fd
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
	at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:161)
	at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:255)
	at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
	at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled
Code)
	at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:224)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:347)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:144)
	at
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:305)
	at java.lang.Thread.run(Thread.java:466)

Now, what was wrong ?

Why is not possible to include in a JSP the result of an XML transformation
(and formatting) ??

In fact, the 'jsp:include' directive try to include in the current document
the outcome of the processing of the included one.

Is there an equivalent way to do the same with XSP ? I mean how to perform a
run-time inclusion between 2 documents , in order to keep the flow control
logic separated from the content ?

I'sorry for all these questions, but the XSP documentation (and samples) is
not very reach.

Thanks,
>  
> Michelangelo Interesse
> ----------------------------
>       Process Support Systems
>                Netsiel S.p.A.
>       * ++39-080-5092.220
> ----------------------------
> 
> 
> 

Mime
View raw message