Thanks
i think you miss my point so
i habe Appletclass like this one:
package wohland.de.ameli.jsp.Testers;
import java.applet.Applet;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import org.apache.log4j.Logger;
import com.oreilly.servlet.HttpMessage;
......
public class TestApplet03 extends Applet {
public void start() {
C_AmeliProperties cAmeliProperties = new
C_AmeliProperties()
.getInstance();
cAmeliProperties.z_init(sConfDB_Prot, sConfDB_Host,
sConfDB_Port,
sConfDB_Name,
sConfDB_User, sConfDB_Pw, sConfDB_MaxConn,
sLogDB_Prot, sLogDB_Host, sLogDB_Port,
sLogDB_Name,
sLogDB_User, sLogDB_Pw, sLogDB_MaxConn, sLocale,
sLog4jConfiguration);
String field_DescriptionsDoc = null;
wohland.de.ameli.jsp.Documents.C_Document cdocument = new
wohland.de.ameli.jsp.Documents.C_Document();
try {
field_DescriptionsDoc = cdocument.ObjectionHTMLString(
sID_Transaction, sID_Entity, sID_Field,
sSpras,//Language
sID_Idea, sDatum, sTimeStamp, uriPath,
realPath
);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
StringBuffer uri = new StringBuffer(
"http://localhost:8080/cocoon/ameli/index.html");
URL url = null;
try {
url = new URL(uri.toString());
java.net.HttpURLConnection con =
(java.net.HttpURLConnection) url
.openConnection();
con.setRequestMethod("POST");
con.setDoInput(true);
con.setDoOutput(true);
con.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
con.connect();
con.getOutputStream().write(field_DescriptionsDoc.getBytes());
// System.out.println(field_DescriptionsDoc.length()=3890);
con.getOutputStream().close();
gotoCocoon(url);
System.out.println("con.getResponseCode()" +
con.getResponseCode());
} catch (ConnectException ce) {
System.out
.println("Connection Refused.\nProblem
at Web server.\nTry after some time.");
} catch (Exception e) {
System.out.println("Exception while calling Servlet :"
+ e);
}
setVisible(true);
}
private void gotoCocoon(URL url) throws MalformedURLException {
URL nURL = null;
nURL = url;
getAppletContext().showDocument(nURL);
System.out.println("hallo " + nURL.getHost());
}
}
and my sitemape is like this one:
<?xml version="1.0" encoding="ISO-8859-1"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:generators>
<map:generator name="stream"
src="org.apache.cocoon.generation.StreamGenerator"/>
</map:generators>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="index.html/">
<map:generate type="stream"/>
<map:transform src="stylesheets/objection04.xslt"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
-------- Original-Nachricht --------
Datum: Thu, 24 Aug 2006 11:14:10 +0200
Von: "Ard Schrijvers" <[EMAIL PROTECTED]>
An: [email protected]
Betreff: RE: a Servelt call a Cocoon
>
> >
> >
> > how can i proviede a Sitemape,which receives data by HTTP
> > and represents by means of transformer in HTML?.
>
> Think you are reinventing the wheel in flow. You can just use something
> like:
>
> <map:generate src="http://cocoon.apache.org" type="html"/>
> <map:transform src=.....
> <map:serialize
>
>
> then, in your sitemap components, declare HTMLGenerator.java. look at
> cocoon's html block.
>
> Or do I miss your point?
>
> Ard
>
>
>
> >
> > my TestApplet
> >
> > StringBuffer uri = new
> > StringBuffer("http://localhost:8080/cocoon/ameli/index.html");
> > BufferedReader br = null;
> > //
> > "http://localhost:8080/Acocoon/servlet/TestServlet"
> > try {
> > URL url=new URL(uri.toString());
> > // URL url=new
> > URL("http://localhost:8080/cocoon/ameli/");
> > URLConnection con = url.openConnection();
> >
> > // Prepare for both input and output
> > con.setDoInput(true);
> > con.setDoOutput(true);
> >
> > // Turn off caching
> > con.setUseCaches(false);
> >
> > // Set the content type to be java-internal/classname
> >
> > con.setRequestProperty("Content-type","application/x-www-form-
> > urlencoded ;charset=ISO-8859-1");
> >
> > // Write the serialized object as post data
> > ObjectOutputStream out = new
> > ObjectOutputStream(con.getOutputStream());
> > out.writeObject(field_DescriptionsDoc);
> >
> > // InputStream in =con.getInputStream();
> > // ObjectInputStream ois = new ObjectInputStream(in);
> > // //
> > //// //Get reply from servlet
> > // String reply = ois.readObject().toString();
> > //
> > // //Show the corresponding message or redirect
> > the user to the
> > // //next page.
> > //
> > // System.out.println("the reply is: " + reply);
> > //
> > // oos.close();
> > // ois.close();
> > out.flush();
> > out.close();
> >
> >
> > my Sitemape is
> >
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> >
> > <!--map:components>
> > <map:generators>
> > <map:generator name="objectionHTML"
> > src="org.apache.cocoon.generation.StreamGenerator"/>
> > </map:generators>
> >
> > </map:components-->
> > <!--map:pipelines>
> >
> > <map:pipeline match="/index.html">
> >
> > <map:act type="request">
> > <map:parameter name="parameters" value="true"/>
> > <map:generate
> > src="http://my.server.com/path/to/my/servlet{requestQuery}"/>
> > </map:act>
> > </map:pipeline>
> > </map:pipelines-->
> > <map:pipelines>
> > <map:pipeline>
> > <map:match pattern="index.html/">
> > <map:generate type="stream"/>
> > <map:transform
> > src="stylesheets/objection04.xslt"/>
> > <map:serialize type="html"/>
> > </map:match>
> > <!--map:pipeline match="">
> > <map:generate
> > src="http://localhost:8080/Acocoon/servlet/TestServlet"/>
> >
> > <map:transform
> > src="stylesheets/objection04.xslt"/>
> > <map:serialize type="html"/-->
> > </map:pipeline>
> > </map:pipelines>
> > </map:sitemap>
> >
> > I would like to be shown HTML representation : automatic
> > --
> >
> >
> > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
"Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]