cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saskia Heesen" <saskia.hee...@gmx.de>
Subject Cookies in Javaflow
Date Thu, 31 Aug 2006 19:16:11 GMT
Hello all

I would like to read cookies in Java. However, I get a type mismatch or a cast exception.
Here is my code:

import org.apache.cocoon.components.flow.java.AbstractContinuable;
import org.apache.cocoon.components.flow.java.VarMap;
import org.apache.cocoon.forms.flow.java.FormInstance;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Cookie;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.forms.formmodel.Field;
import org.apache.cocoon.environment.Response;

public class Cookie extends AbstractContinuable {

 public void doCookie() {
  FormInstance form = new FormInstance ("fields.xml");
  Request request = getRequest();
  Cookie[] cookies = request.getCookies();

In eclipse, I can't generate Java bytecode. I get the message: The import org.apache.cocoon.environment.Cookie
conflicts with a type defined in the same file. How can I avoid the conflict?

I tried to use HttpCookie instead of Cookie. Then, there is a cast exception in this line:

  HttpCookie[] cookies = (HttpCookie[]) request.getCookies();

Do you have any hint?

Thanks in advance.

  Saskia

-- 



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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message