> 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 { ^^^^^^
Rename your class or use org.apache.cocoon.environment.Cookie[]. But changing your class name seems much more logical to me Ard > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]