cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zamek <>
Subject xsp upload nightmare
Date Thu, 04 Mar 2004 13:32:31 GMT
Hello All,

I try to use upload with xsp.
Sample is working well, and I try to move uploaded file to my path.

here is my xsp (based upload.xsp):

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- CVS $Id: upload.xsp,v 1.1 2003/09/07 06:09:10 vgritsenko Exp $ -->

<xsp:page language="java"


version 1.
    String filename=request.getParameter("upload-file");  

here I am get an error: java.lang.NullPointerException 
It is ok, because there is no upload-file parameter, but I have to handle 
empty parameters.

and then I try to test it:

version 2.
    if (request.getParameter("upload-file") != null) {
       String filename=request.getParameter("upload-file");  

Once more error:
// end error String filename=request.getParameter("upload-file"); } File 
uploadDir = null; ... Line 76, column 0: Syntax error on keyword "if"; 
"boolean", "void", "byte", "short", "int", "long", "char", "float", 
"double", "Identifier", "interface", "class" expected
I don't know what is it, but another try:

version 3.
   String filename=<xsp:request-parameter name="upload-file"/>;

and another error:
. Line 77, column 0: Syntax error on token ";", "{", "+", "-", "--", "++", 
"boolean", "void", "byte", "short", "int", "long", "char", "float", 
"double", "(", "true", "false", "IntegerLiteral", "LongLiteral", 
"FloatingPointLiteral", "DoubleLiteral", "CharacterLiteral", 
"StringLiteral", "null", "~", "!", "super", "this", "new", "Identifier" 

    File uploadDir = null;
    /** Contextualize this class */
    public void contextualize(Context context) throws ContextException {
      uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);

So can anybody send me a working xsp which is move uploaded file to any 

Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message