You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Geoff Howard <co...@leverageweb.com> on 2003/05/16 18:14:42 UTC

RE: File upload in cocoon: org.apache.cocoon.components.request.m ultipart.FilePart is missing.

Yes, I know what's wrong:
1) Your action returns null under every condition.  The action contract 
requires that successful actions return a Map (even if empty) and 
unsuccessful actions return null.
2) Your pipeline only contains a generator in the condition that the action 
succeeds (which because of the problem above it never will).

You need to fix both of these.

Geoff

At 11:58 AM 5/16/2003, you wrote:
>Thank you very much for your answer!
>
>I have written the file UploadTest.jar (for now doing pretty much nothing)
>and put the class UploadTest into the package upload.test:
>
>package upload.test;

...

>public class UploadTest
>   extends AbstractLogEnabled
>   implements Action, ThreadSafe
>{
>     public Map act(Redirector redirector, SourceResolver resolver,
>                    Map objectModel, String source, Parameters par)
>         throws Exception
>     {

...

>         return null;
>     }
>}

...

><map:match pattern="*.html">
>     <map:read src="{1}.html"/>
></map:match>
>
><map:match pattern="file">
>      <map:act type="upload" src="optional src">
>            <map:generate type="html" src="success.html"/>
>      </map:act>
>      <map:serialize/>
></map:match>
>
>When I go to the page http://localhost:8080/cocoon/samples/test/upload.html,
>I get the following error message:
>
>Internal Server Error


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Newbie: Escaping markup in XSP

Posted by Joe Williams <jo...@mindspring.com>.
I'm working through the example apps in Lajos Moczar and Jeremy Aston's
book. The "Trouble Tickets" app asks users to log in, the provides no way to
go straight to view their tickets from the authentication page.

What's the recommended way to solve this? Links in the content below the
code? Or is there a way to escape a hyperlink in the "msg" output?

The java from the top of the XSP follows

Thanks.

Joe

=======================
if (user.equals("MegaBancShares") &amp;&amp; pwd.equals("secret")) {

msg = "User '" + user + "' has been authenticated" +

" - you can now proceed to the support page.";

<xsp-session:set-attribute
name="user"><xsp:expr>user</xsp:expr></xsp-session:set-attribute>;

} else if (user.equals("Jollyville National Bank") &amp;&amp;
pwd.equals("secret")) {

msg = "User '" + user + "' has been authenticated" +

" - you can now proceed to the support page.";

<xsp-session:set-attribute
name="user"><xsp:expr>user</xsp:expr></xsp-session:set-attribute>;

} else {

msg = "Login failed";

}



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org