You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Agent B <ze...@yahoo.com> on 2003/10/07 14:10:35 UTC
Form Submission
Hi all,
I am presently working on a project which has a lot of
interaction with users through use for HTML forms. I
am faces with a problem already solved in Jakarta's
Struts where a form submission can be protected
against a rupture in the normal control flow sequence
ie. when the user clicks on the submit button more
than necessary and the date is duplicated. I have
search high and low, looked far and wide but my
searches has not produced anything.
Any help, pointers, the solution itself would be most
welcome.
Cheers
Zeus.
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Cocoon / Eclipse
Posted by Flavio Costa <li...@nibbana.org.br>.
Just to inform I found out that my problem reported on the message below
was due to the paths.
I've defined Cocoon distribution dir (where I unpacked it) as the project
path in Eclipse and "/build/webapp" as the web application root. However,
in order to work, the project path should be set directly to the "/build"
subdir and so web application root becomes "/webapp". Now I'm able to
debug Cocoon.
Flavio Costa
> I'm new to this list. I've been using Cocoon from 2.0.4 version as a
> .war file, and now I'm trying to debug Cocoon 2.1.1 using Eclipse 2.1.1
> and Tomcat 4.1.18, so I could learn more about Cocoon internals.
>
> Cocoon is running well if I type "cocoon servlet" and navigate to
> "http://localhost:8888/". Therefore, I followed LoadInEclipse wiki's
> instruction but whenever I go to "http://localhost:8080/cocoon/" Tomcat
> gives me a
>
> HTTP Status 404 - /cocoon/
> The requested resource (/cocoon/) is not available
>
> - I'm using JDK 1.4.0 (Windows 2000).
> - The project is *not* shared (CVS).
> - I did run Ant from the command prompt, not from Eclipse.
> - It's a Tomcat project (Sysdeo plugin), pointing to the "cocoon-2.1.1"
> directory generated by Ant.
> - DevLoader is deactivated.
> - My "context name" is "/cocoon".
> - "subdirectory to set as web application root" is "/build/webapp",
> under which WEB-INF can be found.
> - TOMCAT_HOME/logs files doesn't even mention the word "cocoon", but
> Eclipse console shows this context being loaded without any errors. -
> Every default option is enabled, included all those blocks that come
> with Cocoon, HSQLDB, QuartzSchedulerThread and so on.
> - access.log has only one line, "INFO (2003-10-07) 09:54.21:681
> [access] (Unknown-URI) Unknown-thread/CocoonServlet: Reloading from:
> jndi:/localhost/coocon/WEB-INF/cocoon.xconf".
> - Besides a few entries in cron.log, every other Cocoon log is empty (0
> bytes).
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Cocoon / Eclipse
Posted by Flavio Costa <li...@nibbana.org.br>.
Hello,
I'm new to this list. I've been using Cocoon from 2.0.4 version as a .war
file, and now I'm trying to debug Cocoon 2.1.1 using Eclipse 2.1.1 and
Tomcat 4.1.18, so I could learn more about Cocoon internals.
Cocoon is running well if I type "cocoon servlet" and navigate to
"http://localhost:8888/". Therefore, I followed LoadInEclipse wiki's
instruction but whenever I go to "http://localhost:8080/cocoon/" Tomcat
gives me a
HTTP Status 404 - /cocoon/
The requested resource (/cocoon/) is not available
- I'm using JDK 1.4.0 (Windows 2000).
- The project is *not* shared (CVS).
- I did run Ant from the command prompt, not from Eclipse.
- It's a Tomcat project (Sysdeo plugin), pointing to the "cocoon-2.1.1"
directory generated by Ant.
- DevLoader is deactivated.
- My "context name" is "/cocoon".
- "subdirectory to set as web application root" is "/build/webapp", under
which WEB-INF can be found.
- TOMCAT_HOME/logs files doesn't even mention the word "cocoon", but
Eclipse console shows this context being loaded without any errors.
- Every default option is enabled, included all those blocks that come
with Cocoon, HSQLDB, QuartzSchedulerThread and so on.
- access.log has only one line, "INFO (2003-10-07) 09:54.21:681
[access] (Unknown-URI) Unknown-thread/CocoonServlet: Reloading from:
jndi:/localhost/coocon/WEB-INF/cocoon.xconf".
- Besides a few entries in cron.log, every other Cocoon log is empty (0
bytes).
Help on solving this would be much appreciated. Thanks in advance,
Flavio Costa
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Flowscript problem using function in form.sendView()
Posted by Markus Heussen <he...@rheinland-online.com>.
Hi all!
I'm new to Flowscript (2.1.2) and I have some problems using the jxforms
functionality. I modified the jxforms samples delivered with Cocoon and get
NullPointerExceptions always after the second wrong value. I need to use a
custom function "keyIsValid" which does some decoding and checkings for me.
This function (see below) uses an Java class (import) to do it. The function
returns the decoded key or an empty string. Even if I do the function
functionality inline I have the same negative effect.
Only if I don't do the function call the validation does what I expect. If I
do the function call, the first validation does what I expect, but if I try
a second wrong value for my identCode I get a NullPointerException.
I don't excactly know how continuations are working. So maybe after the
second request I don't have access to a program state? Can anybody help me
please?
Thanx :-)
The first flowscript file defined in the sitemap contains the following form
handler function snippet:
form.sendView("views/UserIdentification.view",
function(form) {
var bean = form.getModel();
if (bean.age > 40) {
form.addViolation("/age", "Hey, you're too old");
}
// if i comment out the following it works fine
if (keyIsValid(bean.identCode) == "") {
form.addViolation("/identCode", "Try again");
}
}
);
The second flowscript file defined in the sitemap contains the following
code:
importPackage(Packages.com.rheinland.online.util);
function keyIsValid(key) {
var decodeKey = "";
try {
decodeKey = Encoder.decode(key);
} catch (Exception) {
cocoon.log.debug("Failed");
}
return decodeKey;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Form Submission
Posted by Flavio Costa <li...@nibbana.org.br>.
> I am presently working on a project which has a lot of
> interaction with users through use for HTML forms.
Hi Zeus,
the solution you're looking for is a design pattern called Synchronizer
Token. There is an article on the web explaining it, including a brief
code snippet:
http://www.javaworld.com/javaworld/javatips/jw-javatip136.html
I don't know how you Cocoon architecture is built, but maybe you can
implement Synchronizer Token as an action for reuse.
Regards,
Flavio Costa
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org