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
Re: How to convert String to Date in EL?
Nope, its to convert a string to a date. I think BalusC is the answer (ranked 246 or something). While the initial question was not what you were looking for, the reason I suggested you have a read is because you can often learn a lot of other things (in particular what you are looking for), and I'm suspecting you didn't take that advice here. On Mon, Aug 19, 2019, 01:30 Kazuaki Miyauchi wrote: > 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 > >