cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@apache-korea.org>
Subject RE: [BUG] very weird NPE in JXTemplateTransformer
Date Fri, 02 May 2003 03:36:34 GMT
I solved this problem by modifying news2edit.xslt to

     <form name="data" action="#{string('{$continuation/id}')}.kont"
method="POST" enctype="multipart/form-data">

(The value of the action attribute was intially
"{string('{$continuation/id}')}.kont".)

Now my Linotype application works very fine. 

In addition, I made some change to flow.js for Linotype to be
context-independent.

/*
 * The edit action performs the editing subflow.
 */
function edit(id,type,subpage) {

   	var repository = home + "repository/" + type + "/";
	var contextPath = cocoon.request.getContextPath();

	if (id == "template") {
		id = repo.getID(repository);
		repo.copy(repository + "template", repository + id);
		redirect(contextPath + "/private/edit/" + type + "/" + id +
"/");
	} else if ((subpage != undefined) && (subpage != "")) {
   		sendPage("/edit/" + type + "/" + id + "/" + subpage);
	} else {
		var document = repository + id;

		while (true) {
	    	sendPageAndWait("/edit/" + type + "/" + id + "/", {
username: username });
	        var action = cocoon.request.getParameter("action");
	       	if (action == "delete") {
	        	repo.remove(document);
	        	break;
	       	} else {
		        var output = new java.io.FileOutputStream(document +
"/document.xml");
		        process("action/save-" + type,{},output);
		        repo.save(cocoon.request, document);
		    	if (action == "finish") break;
			}	   	
		}

		redirect(contextPath + "/private/" + type);
	}
}

Thank all of you very much.

Ias.

> -----Original Message-----
> From: Tony Collen [mailto:tcollen@neuagency.com] 
> Sent: Friday, May 02, 2003 12:11 PM
> To: cocoon-dev@xml.apache.org
> Subject: RE: [BUG] very weird NPE in JXTemplateTransformer
> 
> 
> On Fri, 2 May 2003 iasandcb@apache-korea.org wrote:
> 
> > I figured out this NPE problem by updating the jars 
> WEB-INF/lib from 
> > cocoon-2.1-M2 latest build. However, after opening some 
> editing window 
> > at http://localhost:8080/linotype/private/edit/news/1/, you 
> meet the 
> > following error message in case of any action i.e. delete, save, or 
> > finish.
> 
> <snip/>
> 
> 
> > Request URI
> >
> > private/edit/news/1/{$continuation/id}.kont
> >
> > cause
> >
> > The continuation ID id} is invalid.
> >
> > request-uri
> >
> > /linotype/private/edit/news/1/%7B$continuation/id%7D.kont
> >
> > Apache Cocoon 2.1-M2-dev
> > -----
> >
> 
> 
> > I found that the action attribute of the form in the edit 
> window was 
> > not valid like this:
> >
> > <form enctype="multipart/form-data" method="POST" 
> > action="{$continuation/id}.kont" name="data"> ...
> 
> 
> Try using action="{$continuation.id}.kont".  I ran into this 
> problem and it ended up being a syntax error in the jxtemplate.
> 
> 
> tony
> 
> 
> --
> Tony Collen
> ICQ: 12410567
> --
> Cocoon: Internet Glue (A Cocoon Weblog) http://manero.org/weblog/
> --
> 
> 


Mime
View raw message