I can't see the problem. Maybe, writing this mail you used some 
character that was encoded by my e-mail viewer (i.e. ampersand-
something-semicolon)
If so type spaces between the ampersand and the rest.

> Ok, I've just implemented your suggest. One more problem (the last ?)
> the result.jsp file comes from result.xml, something like :
> 
> <?xml version="1.0" encoding="ISO8859-1"?>
> <doc title="No title">
> <description>
>       Hello world
> </description>
> <scriptlet><%=0%></scriptlet>
> </doc>
> 
> After the XSLT process, the result.jsp is :
> 
>       Hello world
> <%=0%>
> 
> How can I keep unchanged all JSP tags <% and %> ? Is it an encoding 
problem
> ?
> 
> Thanks a lot for your help !
> 
> fv
> 
> -----Message d'origine-----
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Envoy� : jeudi 13 d�cembre 2001 17:26
> � : [EMAIL PROTECTED]
> Objet : RE: Servlet / JSP / XML - to a MVC implementation ?
> 
> 
> Don't use a java.io.Writer to build a StreamResult, while use a File, 
> so after the servlet has invoked Transformer.transform() you are able 
> to forword to such a File.
> i.e.:
> don't do
> StreamResult result = new StreamResult(out); // out : to the client 
web
> but
> StreamResult result = new File("result.jsp"); // out : to the client 
web
> So after transform() return:
> response.sendRedirect( "result.jsp")
> or
> getServletContext().getRequestDispatcher("/result.jsp").forward
> (request, response)
> 
> 
> 
> > That's exactly what I want to do ! You understood precisly my 
goal : t
> o have
> > an action on the data depending on the client request. Thank you 
for y
> our
> > help. 
> > 
> > But I found 2 new problems :
> > - all tags like <% have to be rewritten in < - that's make the code
> > difficult to read but that's not the worth
> > - XSL transforms the XML file into a JSP output but how can I tell 
the
> > server to process this output instead of flushing it to the client ?
> > 
> > fv
> > 
> > 
> > 
> > -----Message d'origine-----
> > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Envoy� : jeudi 13 d�cembre 2001 13:21
> > � : [EMAIL PROTECTED]
> > Objet : Re: Servlet / JSP / XML - to a MVC implementation ?
> > 
> > 
> > Don't make a JSP that build the XML, while treat your JSP as a 
simple 
> > XML file, then delegate to the XSL file making the JSP.
> > To be clearer:
> > Make a JSP that receives the request
> > then call from it the servlet (or jsp) that invokes 
> > Transformer.transform() whose source is just such an XML file:
> > 
> > <doc title="foo">
> > <description>
> >         I'm a JSP. I'm processing the request.
> > <description>
> > <%
> >         while(request.getParameterNames().hasMoreElements())
> >         {
> > %>
> > <item><scriptlet><%=(String)request.getParameterNames().nextElement
()%
> > ></scriptlet></item>
> > <%
> >         }
> > %>
> > </doc>
> > 
> > Your data.xsl will have to be changed to include
> > at the head:
> > 
> >              <%@ page contentType="text/xml" %>
> > 
> > and somewhere else:
> > 
> > <xsl:template match="scriptlet">
> >      <xsl:apply-templates/>
> > </xsl:template>
> > 
> > > Today, i'm using JSP to perform the view. I also use JSP as 
controll
> er
> > .
> > > Although view and controller are separated, I'm looking for a 
best w
> ay
> >  to do
> > > this via XML/XSLT.
> > > 
> > > My approach is :
> > > 
> > > A request is sent to the web server :
> > > - Controller (JSP) handles the request
> > > - Controller (JSP) asks data to the model
> > > - Model furnishes Datas (XML) to the controller
> > > - The controller modifies data to perform request actions
> > > - The controller forwards data modified to the view using XSL / 
XSLT
> > > 
> > > 
> > > Here is an example, exactly what I want to do, a JSP handles the 
req
> ue
> > st,
> > > performs some actions and sends data rendered by XSL :
> > > 
> > > <%@ page contentType="text/xml" %>
> > > <?xml:stylesheet type="text/xsl" href="myxsl.xsl" version="1.0"
> > > encoding="ISO-8859-1"?>
> > > 
> > > <doc title="foo">
> > > <description>
> > >         I'm a JSP. I'm processing the request.
> > > <description>
> > > <%
> > >         while(request.getParameterNames().hasMoreElements())
> > >         {
> > > %>
> > > <item><%=(String)request.getParameterNames().nextElement()%
></item>
> > > <%
> > >         }
> > > %>
> > > </doc>
> > > 
> > > But I want to perform the XSL Transformation on the server side 
to h
> av
> > e the
> > > full control using something like :
> > > 
> > >     StreamSource source = new StreamSource
> > ( THE XML response performed by
> > > the JSP controller );
> > >     StreamSource stylesheet = new StreamSource
> > ("D:\\Dev\\web\\data.xsl");
> > >     // Use a Transformer for output
> > >    TransformerFactory tFactory = TransformerFactory.newInstance();
> > >    Transformer transformer = tFactory.newTransformer(stylesheet);
> > >    StreamResult result = new StreamResult
> > (out); // out : to the client web
> > > borwser
> > >    transformer.transform(source, result);
> > > 
> > > I don't know how to forward the XML response of my JSP to the 
servle
> t 
> > doing
> > > the XSL Transformation. Have an idea ?
> > > I have never seen example using JSP / XML / XSLT that way. Am I 
goin
> g 
> > in a
> > > wrong way ?
> > > It sounds like to me because the view is completly separated from 
th
> e 
> > rest
> > > of the application.
> > > 
> > > fv
> > > 
> > > 
> > > 
> > > 
> > > 
> > > -------------------------------------------------------------
> > > This Message and any attachments are confidential and intended
> > > solely for the addressees. And unauthorised use or dissemination
> > > are prohibited. Emails are suceptible to alteration. Therefore
> > > neither SWAPCOM nor any of its subsidiaries or affiliates shall
> > > be liable for the message if altered, changed or falsified.
> > > 
> > > 
____________________________________________________________________
> __
> > _____
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include 
in t
> he
> >  body
> > > of the message "signoff SERVLET-INTEREST".
> > > 
> > > Archives: http://archives.java.sun.com/archives/servlet-
> interest.html
> > > Resources: http://java.sun.com/products/servlet/external-
> > resources.html
> > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> > > 
> > >
> > N<����r�>zǧu�sS[h-+-��ڲ�ܢf�v)�-�^S{ay��?�...�z�� z� z?
> �HDU,D�51$���
> > b��!�����?+޲6&hibar;j˧r?�j�!S���ǫ�W�S{^��-?٥E�(���m���j���w
> (>�k&iexl;�oe���z��z�
> > ��׫��kz�.�Ǭ?٥,""HDU�i?�i��0�[(~�(>�sz楳��z����
> > 
> > 
> > -------------------------------------------------------------
> > This Message and any attachments are confidential and intended
> > solely for the addressees. And unauthorised use or dissemination 
> > are prohibited. Emails are suceptible to alteration. Therefore 
> > neither SWAPCOM nor any of its subsidiaries or affiliates shall 
> > be liable for the message if altered, changed or falsified.  
> > 
> > 
> > 
> 
> 
> -------------------------------------------------------------
> This Message and any attachments are confidential and intended
> solely for the addressees. And unauthorised use or dissemination 
> are prohibited. Emails are suceptible to alteration. Therefore 
> neither SWAPCOM nor any of its subsidiaries or affiliates shall 
> be liable for the message if altered, changed or falsified.  
> 
> 
> ��칻�&ޱ��zf���%��lz��j���w(��݊w%�ע��^n�r��azg����('���K2
>LDDI0+r�z�m���j�!�����ڲ�ܢoڭ�b��?����b�׫z�a�iQz�.�Ǭ��i��ڽ�.��&���v�-����^������jZ޲��q�!�iK!$�GzZa���
>0����&�f���l�����z�m�


Reply via email to