Re: How to cast String to int in EL?
This is also is ideal interface for me. Of course, default of type is String. Regards,Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to convert String to Date in EL?
2019年8月20日(火) 17:44 Stuart Thiel : > Because formats for dates are so ambiguous, there's no reliable way to > interpret. isn't so ambiguous. Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to cast String to int in EL?
This is only amusing. I tried at first as following. If EL supports nested description, this is graceful solution. Of course, it caused javax.el.ELException: Failed to parse the expression [${${member_id}}] Regards,Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to convert String to Date in EL?
Excuse me. PC sent my under-writing mail. 2019年8月20日(火) 18:14 Kazuaki Miyauchi : > I think many people use JavaBeans or like that using Date data. > But, in Web site, year, month, day are mostly requested parameters. > It was very convenient I can use ${param.year} and s It was very convenient I can use ${param.year} and so on for DB access data. Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to convert String to Date in EL?
2019年8月20日(火) 17:55 Stuart Thiel : > I suspect you can skip the set tag and wrap the parseDate in the sqlParam > tag as well, but I've never mucked with sql in JSPs (I'm pretty strict > about using them exclusively as Template Views) I think many people use JavaBeans or like that using Date data. But, in Web site, year, month, day are mostly requested parameters. It was very convenient I can use ${param.year} and s - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to convert String to Date in EL?
2019-08-20 16:39 GMT+09:00, Stuart Thiel : > That's what parseDate does, and why I pointed you at it. I also want to do like int case as following. insert into test values(?,?) But, of course, this makes javax.el.ELException: Cannot convert [2019-8-20] of type [class java.lang.String] to [class java.util.Date] So, I'd like to know how to convert Date type using EL writing. Is there simple method to convert like 0 + for int case? Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to cast String to int in EL?
Thank you, Stuart! This is what I want to know. 2019-08-20 16:48 GMT+09:00, Stuart Thiel : > Ah, it is parameter casting you're after. That was unclear from your > initial request. What does: > > yield? Following correctly works!! insert into test values(?,?) Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to convert String to Date in EL?
This also works using Java description as following. <% SimpleDateFormat sdFormat = new SimpleDateFormat("/MM/dd"); Date date = sdFormat.parse(session.getAttribute("date").toString()); session.setAttribute("date_o", date); %> insert into test values(?,?) We need such complicated way to Web-DB access? We need simple way using EL description. Regards,Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to cast String to int in EL?
Hi, Stuart 2019-08-19 20:32 GMT+09:00, Stuart Thiel : > I can't speak to Tomcat 5, that's been years. However, the code you're > using is not passing an integer. If you take a look at the generated > Java source (which is a mess with taglibs) you may see why. Once more, > a quick google suggests some solutions, in particular, the trivial > one: Following source works correctly, of course. <% int member_id = (int)session.getAttribute("member_id"); session.setAttribute("member_id_num", member_id); %> insert into test values(?,?) Ordinary we get HTTP request parameter via EL using ${param.hogehoge}. So, It's troublesome to write following. int member_id = Integer.valueOf(request.getAttribute("member_id"); session.setAttribute("member_id_num", member_id); Instead of Isn't there more convenient way? Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
How to cast String to int in EL?
To simple following table. create table test (member_id int, member_name text); In JSP, I accessed as following. insert into test values(?,?) I've gotten following error.(using Tomcat-9.0.22 and Postgres-11.5) javax.servlet.jsp.JspException: insert into test values(?,?) : ERROR: column "member_id" is of type integer but expression is of type character varying Hint: You will need to rewrite or cast the expression. Position: 27 This JSP works under Tomcat-5.5.3 and Postgres-9.0.8. And, I've gotten the same result using following JSP. insert into test values(?,?) 1 How to cast String to int? Of course, following JSP works correctly. insert into test values(1,?) Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to convert String to Date in EL?
Hi, Stuart, Thanks for your quick reply. 2019年8月19日(月) 13:01 Stuart Thiel : > The solution with fmt:parseDate is likely what you want, but read what > they say and perhaps change what you're doing a bit. That is to convert Date type to String. I'd like to know reverse way. Google doesn't hit this error message. Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
How to convert String to Date in EL?
I made following JSP. <%@ page contentType="text/html;charset=UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"; %> Insert Date insert into test values(?,?) Table was simply made as following. create table test (when_cause date, how text); Then, I got following error in tomcat-9.0.22. org.apache.jasper.JasperException: Unable to convert string [2019-8-19] to class [java.util.Date] for attribute [value]: [Property Editor not registered with the PropertyEditorManager] How to convert String date data to Date type? After changing as following, it works. But, it's not easily readable when making complicated sql. insert into test values('2019-8-19',?) Regards, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re:DBtags works on Tomcat9?
> It must be my JSP file problem. This should be changed as following. Very Sorry. Kazuaki Miyauchi P.S. <%@ taglib prefix="sql" uri="http://jakarta.apache.org/taglibs/dbtags"; %> problem remains. - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re:DBtags works on Tomcat9?
>This error also caused using Tomcat7.0.94. Excuse me. This also caused using Tomcat5.5.33. It must be my JSP file problem. Thanks, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
DBtags works on Tomcat9?
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach> This error also caused using Tomcat7.0.94. That may be caused from new compiling JSP problem. I wonder why this wasn't discussed. There may be few DBtag user? Thanks, Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
DBtags works on Tomcat9?
DBtags posted by me is type of following definition. <%@ taglib prefix="sql" uri="http://jakarta.apache.org/taglibs/dbtags"; %> (I prefer this old dbtags to standard-taglibs' one.) I tried to use standard-taglibs' dbtags(ver1.2.5) using following jsp test file on Tomcat9. <%@ page contentType="text/html;charset=UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"; %> All of Producer select ProducerName from Producer But, I got error as following. org.apache.jasper.JasperException: An exception occurred processing [/test.jsp] at line [15] 12: 13: select ProducerName from Producer 14: 15: 16: 17: 18: javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:666) org.apache.jsp.test_jsp._jspService(test_jsp.java:168) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) What's wrong? Regards. Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
DBtags works on Tomcat9?
Hi, I'm DBtags user on Tomcat5. DBtags is greate tool for simple DB access. After importing *.war file to Tomcat9, there caused "taglib definition not consistent with specification version" error. Someone uses DBtags on Tomcat9? Regards. Kazuaki Miyauchi, Japan - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to use index in EL expression?
2014-10-06 15:39 GMT+09:00 Peter Wagner : > Also, I would recommend to avoid using sql:update under any circumstances. That causes some problems? I think dbtags are the most powerful tools for developing Web-DB programs. Why did developers stop creating this powerful functions? Regards, K.Miyauchi - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to use index in EL expression?
Hi. Peter. It works well. Thank you very much! EL is fantastic! And now I have one more question. var parameter doesn't seem to accept EL description as following. Is there a smart way to resolve above description? Regards, K.Miyauchi - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to use index in EL expression?
Thanks a lot! I'll check its correctly working. Regards, K. Miyauchi 2014-09-25 19:00 GMT+09:00 Peter Wagner : > Hello, > > > use a temporary variable as an “index”: > > > > > > <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > > > > > > EL Test > > > > > > > > > > > ${param[paramName]} > > > > > > > > > > > Regards, Peter - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to use index in EL expression?
Hello Stuart, > Can you not use i directly as you're already within el? I'm not sure >why you want to embed the el. > >< sql:param value="${paramValues.name[i]}" /> Because we need to specify i concretely for getting data in above case. 2014-09-25 18:08 GMT+09:00 Stuart Thiel : > Hello Kazuaki, > Can you not use i directly as you're already within el? I'm not sure > why you want to embed the el. > > > > On Thu, Sep 25, 2014 at 5:03 AM, Kazuaki Miyauchi wrote: >> 2014-09-24 22:53 GMT+09:00 Stuart Thiel : >>> I really think something in your domain layer should be parsing your >>> params and cleanly taking care of this all. You can still provide the >>> cleaned up POJOS via attributes, and that makes more sense. If you're >>> entirely skipping regular servlets and allowing direct access to JSP >>> you can probably use something like >>> >>> ${paramValues.key[i]} >> >> Using paramValues, it causes the same problem. >> EL cannot be nested, so >> >> cannot be compiled. >> >> I think we need pre-taglibs-taglibs or EL can be nested for resolving this. >> >> Regards. >> >> - >> To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org >> > > > > -- > Stuart Thiel, P. Eng. > > - > To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org > For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org > - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to use index in EL expression?
2014-09-24 22:53 GMT+09:00 Stuart Thiel : > I really think something in your domain layer should be parsing your > params and cleanly taking care of this all. You can still provide the > cleaned up POJOS via attributes, and that makes more sense. If you're > entirely skipping regular servlets and allowing direct access to JSP > you can probably use something like > > ${paramValues.key[i]} Using paramValues, it causes the same problem. EL cannot be nested, so cannot be compiled. I think we need pre-taglibs-taglibs or EL can be nested for resolving this. Regards. - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: Easy get method of record number
2014-09-24 22:46 GMT+09:00 Stuart Thiel : > However, taglibs aside, I understand your concern. The main reason is > that the ResultSet can start getting processed immediately under some > conditions, thus it makes sense not to know the final number of > records because the database might not have counted the final number > of records. Thanks for your immediate reply, but, Using Apache Commons DbUtils, there is length function which show the final number of records as following. Object[] pi = (Object[])qr.query( for (int i=0; i
How to use index in EL expression?
Hi, it is also convenient to use the iteration of ELs such as . Of course, it doesn't work. But, I'd like to do the following iteration. insert into member values (1,?::integer,${i},?,?,?) Is there some idea for this without whole description expanding i? Regards, - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Easy get method of record number
Hi, it seems there is no way to get the numbers of records without issuing count sql . It is convenient to get the number as following. ... Why is there no function to get record number? Regards, - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
Re: How to get short description of interval data by EL?
2014-09-04 17:04 GMT+09:00 Stuart Thiel : > This is more a date-formatting question and less to do with taglibs or el. Thank you!! select to_char(interval,'HH24:MI:SS') resolved my problem. Best Regards, - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org
How to get short description of interval data by EL?
Hi, I'm making Web-DB program using JSTL on Tomcat and Postgres. In there, I'd like to show interval data using EL. But, ${rowSelect.interval} shows following long data. 0 years 0 mons 0 days 0 hours 13 mins 15.114 secs interval is data of interval type of Postgres. How can I get normal expression such as "0:13:15" using EL? Regards, Kazuaki Miyauchi - To unsubscribe, e-mail: taglibs-user-unsubscr...@tomcat.apache.org For additional commands, e-mail: taglibs-user-h...@tomcat.apache.org