tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris Schneider" <k...@directthought.com>
Subject Re: I18n and formatting numbers
Date Sat, 19 Apr 2008 21:21:12 GMT
On Sat, Apr 19, 2008 at 1:32 AM, majid kalkatechi <kalkatehchi@gmail.com> wrote:
> I used jstl-1.1.2.jar that was downloaded from a maven repository.
>  Then I downloaded another version of jstl manually which was
>  jstl-1.2.jar .

JSTL 1.2 requires a JSP 2.1 container, so I wouldn't recommend using
it with Tomcat 5.5, which is a JSP 2.0 container. So, you should
either use JSTL 1.1 or switch to Tomcat 6 if you want to use JSTL 1.2.
In either case, make sure you have the proper versions of both
jstl.jar and standard.jar installed in WEB-INF/lib. If you're using
TC5.5, make sure you are using a Servlet 2.4 web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
               version="2.4">

If you're using TC6, make sure you are using a Servlet 2.5 web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
               version="2.5">

So, get your configuration set properly, test again and post back your results.

> On 4/18/08, Kris Schneider <kris@directthought.com> wrote:
>  > Which version of the Standard taglib are you using?
>  >
>  >
>  >  On Thu, Apr 17, 2008 at 7:38 AM, majid kalkatechi <kalkatehchi@gmail.com>
wrote:
>  >  > hi,
>  >  >
>  >  >  I wanted to format parameters of message. I did as follow
>  >  >  in my jsp  I wrote:
>  >  >  <fmt:message key="something">
>  >  >  <fmt:param value="${123456}" />
>  >  >  </fmt:message>
>  >  >   and in the properties file :
>  >  >  ...
>  >  >  something= hi {0,number,integer}
>  >  >  ...
>  >  >  Then I get IllegalArgumentException. I think fmt:param tag sends my
>  >  >  parameter as String to DecimalFormat.format() and had not tried to
>  >  >  cast it to integer before passing it to DecimalFormat.format() method.
>  >  >  The exception stack trace  in tomcat5.5 :
>  >  >  2008-04-17 10:34:37,292 ERROR
>  >  >  org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/jspui].[jsp]
>  >  >  @ Servlet.service() for servlet jsp threw exception
>  >  >  java.lang.IllegalArgumentException: Cannot format given Object as a Number
>  >  >       at java.text.DecimalFormat.format(DecimalFormat.java:480)
>  >  >       at java.text.Format.format(Format.java:133)
>  >  >       at java.text.MessageFormat.subformat(MessageFormat.java:1279)
>  >  >       at java.text.MessageFormat.format(MessageFormat.java:828)
>  >  >       at java.text.Format.format(Format.java:133)
>  >  >       at org.apache.taglibs.standard.tag.common.fmt.MessageSupport.doEndTag(MessageSupport.java:200)
>  >  >       at org.apache.jsp.browse.full_jsp._jspService(full_jsp.java:917)
>  >  >       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
>  >  >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >  >       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
>  >  >       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
>  >  >       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>  >  >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >  >       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>  >  >       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>  >  >       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
>  >  >       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
>  >  >       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
>  >  >       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
>  >  >       at org.dspace.app.webui.util.JSPManager.showJSP(JSPManager.java:91)
>  >  >       at org.dspace.app.webui.servlet.BrowserServlet.showFullPage(BrowserServlet.java:174)
>  >  >       at org.dspace.app.webui.servlet.AbstractBrowserServlet.processBrowse(AbstractBrowserServlet.java:368)
>  >  >       at org.dspace.app.webui.servlet.BrowserServlet.doDSGet(BrowserServlet.java:96)
>  >  >       at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:151)
>  >  >       at org.dspace.app.webui.servlet.DSpaceServlet.doGet(DSpaceServlet.java:99)
>  >  >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>  >  >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>  >  >       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>  >  >       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>  >  >       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
>  >  >       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
>  >  >       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>  >  >       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>  >  >       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>  >  >       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
>  >  >       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
>  >  >       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
>  >  >       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
>  >  >       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
>  >  >       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
>  >  >       at java.lang.Thread.run(Thread.java:595)
>  >  >
>  >
>  > >  ---------------------------------------------------------------------
>  >  >  To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>  >  >  For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>  >  >
>  >  >
>  >
>  >
>  >
>  >
>  >  --
>  >  Kris Schneider <mailto:kris@directThought.com>
>  >  directThought <http://www.directThought.com/>

-- 
Kris Schneider <mailto:kris@directThought.com>
directThought <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message