AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
Hello again, I have shorten the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.).parse(request.getParameter(date)); String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprmyDate /xsp:expr /test /dataset /xsp:page error (cocoon): description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 289, column 66: ')' expected Line 286, column -1: incompatible types Line 0, column 0: 2 errors IDC2_info_int_xsp.java: snip/ this.characters(\n\t\t); string myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.).parse(request.getParameter(date)); }catch(Exception e){ getLogger().error(XSP date error: , e); } The Line 289, column 66 is (*): parse(request.getParameter(date)(*)) The sitemap.log and error.log don't have the XSP date error. -Ursprüngliche Nachricht- Von: Andrew Timberlake [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 31. Januar 2003 17:08 An: [EMAIL PROTECTED] Betreff: Re: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? On Fri, 2003-01-31 at 17:59, Scherler, Thorsten wrote: Yes, I am doing that right now. But the people using the app that I am writing don't want type 01/30/2003 to get the reports. The main reason is that the company that I am working for is in Germany. So the user wants to put 30.01.2003 in the form. If I parse that into the esql I can't get any data out of db. I thought about client-side JavaScript to transform the date and then parse it, but I hoped that I could transform it on the server side with xsp. You said something about: simply invert the process on the SimpleDateFormat object. How would I do that? I think what you are trying to do is the following: Date myDate = (new SimpleDateFormat(dd.MM.).parse(request.getParameter(date)); String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); That will receive the date in format 30.01.2003 and convert it to 01/30/2003 I'm not sure if you've understood the esql:parameter concept fully. Using the esql parameter will result in java code that looks something like the following: ... PreparedStatement statement = conn.prepareStatement(select * from table where datecolumn = ?); statement.setDate(1, myDate); ... When using code like this, you don't have to worry about the format the database engine uses, you only have to worry about the format the user uses and parse that into a Date object. I do realise that I may not always understand exactly what you are asking so please keep asking until we fully understand each other. -- Andrew Timberlake [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
On Fri, 2003-01-31 at 18:37, Scherler, Thorsten wrote: Hello again, I have shorten the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); ---^ You had a missing ')' String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprmyDate /xsp:expr /test /dataset /xsp:page -- Andrew Timberlake [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
I correct it and now: description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 309, column 48: variable dateParam not found in class org.apache.cocoon.www.logic.IDC2_info_int_xsp Line 0, column 0: 2 errors the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page the request: ?date=31.01.2003 -Ursprüngliche Nachricht- Von: Andrew Timberlake [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 31. Januar 2003 17:49 An: [EMAIL PROTECTED] Betreff: Re: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? On Fri, 2003-01-31 at 18:37, Scherler, Thorsten wrote: Hello again, I have shorten the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); ---^ You had a missing ')' String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprmyDate /xsp:expr /test /dataset /xsp:page -- Andrew Timberlake [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
Hi Thorsten, you define the variable dateParam inside a try/catch-block. When you reference to it outside of this block you're out of scope. try: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; String dateParam = null; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); } catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page Bye Judith -Ursprüngliche Nachricht- Von: Scherler, Thorsten [SMTP:[EMAIL PROTECTED]] Gesendet am: Freitag, 31. Januar 2003 18:01 An: [EMAIL PROTECTED] Betreff: AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? I correct it and now: description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 309, column 48: variable dateParam not found in class org.apache.cocoon.www.logic.IDC2_info_int_xsp Line 0, column 0: 2 errors the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page the request: ?date=31.01.2003 -Ursprüngliche Nachricht- Von: Andrew Timberlake [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 31. Januar 2003 17:49 An: [EMAIL PROTECTED] Betreff: Re: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? On Fri, 2003-01-31 at 18:37, Scherler, Thorsten wrote: Hello again, I have shorten the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); ---^ You had a missing ')' String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprmyDate /xsp:expr /test /dataset /xsp:page -- Andrew Timberlake [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
I tried: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; String dateParam = null; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); } catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page error: description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 0, column 0: 1 error IDC2_info_int_xsp.java: this.characters(\n\t\t\t); Date myDate = ; String dateParam = null; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); } catch(Exception e){ getLogger().error(XSP date error: , e); } this.characters(\n\t\t\t); Bye Judith -Ursprüngliche Nachricht- Von: Scherler, Thorsten [SMTP:[EMAIL PROTECTED]] Gesendet am: Freitag, 31. Januar 2003 18:01 An: [EMAIL PROTECTED] Betreff: AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? I correct it and now: description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 309, column 48: variable dateParam not found in class org.apache.cocoon.www.logic.IDC2_info_int_xsp Line 0, column 0: 2 errors the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page the request: ?date=31.01.2003 -Ursprüngliche Nachricht- Von: Andrew Timberlake [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 31. Januar 2003 17:49 An: [EMAIL PROTECTED] Betreff: Re: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? On Fri, 2003-01-31 at 18:37, Scherler, Thorsten wrote: Hello again, I have shorten the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); ---^ You had a missing ')' String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprmyDate /xsp:expr /test /dataset /xsp:page -- Andrew Timberlake [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
Last Mail before I stop work: If I modify the code of Judith like that: ... Date myDate = null; ... instead of Date myDate = ; I do not get an error now, but neither the date. So thanks everybody for your help. I will finish up after 14hours without solving the problem. King regards -Ursprüngliche Nachricht- Von: Scherler, Thorsten Gesendet: Freitag, 31. Januar 2003 18:11 An: [EMAIL PROTECTED] Betreff: AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? I tried: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; String dateParam = null; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); } catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page error: description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 0, column 0: 1 error IDC2_info_int_xsp.java: this.characters(\n\t\t\t); Date myDate = ; String dateParam = null; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); } catch(Exception e){ getLogger().error(XSP date error: , e); } this.characters(\n\t\t\t); Bye Judith -Ursprüngliche Nachricht- Von: Scherler, Thorsten [SMTP:[EMAIL PROTECTED]] Gesendet am: Freitag, 31. Januar 2003 18:01 An: [EMAIL PROTECTED] Betreff: AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? I correct it and now: description org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 309, column 48: variable dateParam not found in class org.apache.cocoon.www.logic.IDC2_info_int_xsp Line 0, column 0: 2 errors the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprdateParam/xsp:expr /test /dataset /xsp:page the request: ?date=31.01.2003 -Ursprüngliche Nachricht- Von: Andrew Timberlake [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 31. Januar 2003 17:49 An: [EMAIL PROTECTED] Betreff: Re: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param? On Fri, 2003-01-31 at 18:37, Scherler, Thorsten wrote: Hello again, I have shorten the xsp: xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:esql=http://apache.org/cocoon/SQL/v2; xmlns:xsp-request=http://apache.org/xsp/request/2.0; dataset xsp:logic Date myDate = ; try{ myDate = (new SimpleDateFormat(dd.MM.)).parse(request.getParameter(date)); ---^ You had a missing ')' String dateParam = (new SimpleDateFormat(MM/dd/)).format(myDate); }catch(Exception e){ getLogger().error(XSP date error: , e); } /xsp:logic test xsp:exprmyDate /xsp:expr /test /dataset /xsp:page -- Andrew Timberlake [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been