Regarding fmt:formatDate
<input type="hidden" name="EnteredDate">
(<fmt:formatDate value="${fn:escapeXml(row.entereddatetime)}" type="both" pattern="yyyy.MM.dd.HH.mm:ss" />)
<fmt:parseDate value="${param.EnteredDate}" pattern="yyyy.MM.dd.HH.mm:ss" type="both" var="parseddatetime" />
When I try to access the Date from DateBase and I need to format it,
when i worked above coding , following Error has come
Attempt to convert String to type "java.util.Date", but there is no PropertyEditor for that type...
please help with sample code
Repost
Similar Messages
-
How to change month language in fmt:formatDate ?
That's it all.
I put the following:
<fmt:formatDate pattern="YYYY MMMM" value="${detCotiz.mesAnio}"/>And shows date like "2008 July", but i need show dates in Spanish, like: "Julio 2008".
I'm sorry if that question is basic and is answered, but i didn't find a topic search in the forum.
Thanks a lot!To change the language, change the locale. That specifices what language/version to use. One way to do that is to use the <fmt:setLocale> tag
Also your date pattern should be "yyyy MMMM" - lowercase y rather than upper case. Yes. It matters.
<fmt:setLocale value="es"/>
<fmt:formatDate pattern="yyyy MMMM" value="${detCotiz.mesAnio}"/> -
Fmt:formatDate from JSTL reveals bug in OC4J
If you use the tag fmt:formatDate in a loop like this
<c:forEach var="driver" items="${clientProxy.drivers}">
<fmt:formatDate value="${driver.vertragsende}" />
</c:forEach>
the fmt:formatDate tag will call the method setLocale from ServletResponse for every iteration step. The result is that you have as many Content-Language headers as steps of the iteration.
As you may have noticed I'm using a german locale and therefore if you have ten drivers you've got 10 response headers "Content-Language" with the value "de".
For me a serious bug in OC4J. Is this bug known and/or is there a solution?
I'm using JDeveloper 10g Version 9.0.5.2 build 1618 and JSTL 1.0.6.Repost
-
Trouble with fmt:formatDate tag
Hi, I'm using JSTL 1.2 with Tomcat 6.0.26. I have
<jsp:useBean id="today" class="java.util.Date" scope="request" />
<fmt:formatDate var="fmtToday" value="${today}" pattern="MM/dd/yyyy"/>but when I try and get the value of ${fmtToday}, I get an empty string. In other words, this produces output ...
today: ${today}but this does not
today: ${fmtToday}Any ideas why? - DaveNope. Looks good to me. Tried it out and had no issues.
So then the questions become
- have you imported the fmt tag library? <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
- what server are you using?
- what version of JSTL? -
Fmt:formatDate with incoming parameter
I have a bean that has a set method that takes in a java.sql.Date object.
public void setStartDate(java.sql.Date newValue){
startDate= newValue;
}This is used in a PreparedStatement to retrieve data from the database.
I am pulling the value from the URL. For example, the url would be:
http://localhost:8080/test/somePage.jsp?startDate=01-APR-2008Now, in the JSP I am trying to use the fmt:formatDate tag.
<fmt:formatDate value="${param.startDate}" var="startDate" pattern="yyyy-mm-dd"/>However, I just cannot get it to work. It keeps throwing errors like:
Attempt to convert String "01-Apr-2008" to type "java.util.Date", but there is no PropertyEditor for that type
So after some reading, I decided to try fmt:parseDate. So I then did:
<fmt:parseDate var="startDate" value="${param.startDate}" pattern="yyyy-mm-dd" />Then I get the error:
In <parseDate>, value attribute can not be parsed: "01-Apr-2008"
All I am trying to do is call:
<jsp:setProperty property="startDate" name="HomeBean" value="${startDate}"/>Ascalonian wrote:
Now, in the JSP I am trying to use the fmt:formatDate tag.
<fmt:formatDate value="${param.startDate}" var="startDate" pattern="yyyy-mm-dd"/>However, I just cannot get it to work. It keeps throwing errors like:
Attempt to convert String "01-Apr-2008" to type "java.util.Date", but there is no PropertyEditor for that type
The fmt:formatDate is there to format a java.util.Date object into a human readable String using the given pattern. The 'value' must be backed by a getter which returns java.util.Date and the 'var' must be backed by a variable which is declared as java.util.Date (and thus not java.sql.Date).
So after some reading, I decided to try fmt:parseDate. So I then did:
<fmt:parseDate var="startDate" value="${param.startDate}" pattern="yyyy-mm-dd" />Then I get the error:
In <parseDate>, value attribute can not be parsed: "01-Apr-2008"
The fmt:parseDate is there to parse a String into a java.util.Date object using the given pattern. The actual String value of ${param.startDate} apparently doesn't match "yyyy-mm-dd", but "dd-MMM-yyyy". Read on the SimpleDateFormat API documentation for more details about patterns: [http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html]. Also note that you should be using 'M' instead of 'm' to denote months. -
Fmt:formatDate not formatting to the set Locale
I have the following code in my jsp:
<fmt:setLocale scope="page" value="fr_CA" />
<fmt:formatDate dateStyle="long" value="${Params.fullBirthDate}" />where fullBirthDate is a Date object.
The date should be formatted in the french pattern however it always come up in english (e.g. January 2, 1977 instead of 2 janvier,1977). Anyone know why?
ThanksBTW... fmt doesn't support Struts, that I'm aware of... it's a JSTL tag library. So it probably does what I said because I'm not sure that java.util.ResourceBundle will load the default bundle for it... or maybe it does (I forget) but it could be just looking for properties files on it's own. So I don't think that setting message-resources in the Struts config file is going to make a difference if you aren't using the bean taglib.
-
Fmt:formatDate just prints out default Datetime String
Hi,
i am getting crazy here, because one can hardly do anything wrong here. This is my testcode:
<jsp:useBean id="current" class="java.util.Date"/>
<fmt:formatDate value="${current}" pattern="MMM"/>
Pretty straightforward, but whatever i put in the pattern or even when using one of the predefined formats, i am allways getting the default String like:
Wed Feb 23 21:16:31 CET 2005
And no, its not a cache issue, the seconds were updated on every reload and i stopped tomcat a hundred times. Thanks for any info on this.
Marcproblems ? No
Will you get the expected result ? Maybe , depends on what you expect to see.
When using c:out then the var will be displayed as String so you will see the full length toString of a Date.
If you want your own formatting you will need to use the fmt:FormatDate tag -
Time value error with JSTL in fmt:formatDate
Hi all,
I try to display a date field from my Oracle 10g DB which contains date and time value. In the DB everything is stored correctly. When I use a
<fmt:formatDate value="${row.BEGIN_DATE}" pattern="dd.MM.yyyy HH:mm" />the date is displayed correctly but the time value is always 00:00. How can the time value be displayed correctly. Is this a matter of database or a JSTL configuration?
TIA,
AxelThe value of the pattern attribute should be a
pattern string following the conventions of the
java.text.SimpleDateFormat class.I know this. But the pattern "dd.MM.yyyy HH:mm" should be ok, or what's wrong with this pattern in your opinion? -
Language setting changed by fmt:formatDate
I found out, that JSTL tag <fmt:formatDate> changes language settings of jsp page
<%@ page contentType="text/html;charset=windows-1250"%>
<%
out.println(response.getCharacterEncoding()); // windows-1250
%>
<fmt:formatDate ...
<%
out.println(response.getCharacterEncoding()); // ISO-8859-2
%>
</body>
</html>
I did some attempts. I had partial success by using
<fmt:setLocale value="cs_CZ"> (czech), but
response.getCharacterEncoding()
still returns ISO-8859-2 and that causes another trouble
(in TopLink/ADF data controls, which we use).
I found out, that in Tomcat it can be solved by editing CharsetMapperDefault.properties in
catalina.jar. But we are using OC4J in JDeveloper (10.1.2) and finally our application will be deployed
on OracleAS 10g. Does somebody know solution ? Thanks.I want to change into Korean, but I don't know if it support Korean as language option
It should support Korean and should also change to Korean if your OS changes to Korean. Have you perhaps removed any language support? Some people do this to save space.
You can try this app:
http://www.tj-hd.co.uk/en-gb/languageswitcher/ -
Here is a sample JSP code
<h4>US</h4>
<fmt:setLocale value="us_US"/>
<fmt:formatDate value="${now}" pattern="yyyyMMdd"/>
<h4>RU</h4>
<fmt:setLocale value="ru_RU"/>
<fmt:formatDate value="${now}" pattern="yyyyMMdd"/>And on the output I got:
US
Fri Jan 19 14:38:21 MSK 2007
RU
20070119
I expected to see two identical rows but why they are not? Doesn't the "pattern" attribute rules the output format? If not how does one can manipulate with the format?The problem is caused because "us_US" is not a valid locale.
Try "en_US" for the desired effect, or even just "en"
<fmt:setLocale value="junkValue"/>
<fmt:formatDate value="${now}" pattern="yyyyMMdd"/>Output: Fri Jan 19 14:38:21 MSK 2007
It seems when the locale is not set correctly, the formatDate tag cannot use the pattern. -
Jstl fmt:formatDate problem
Hi everyone,
I have been spending a lot of time on this "simple" issue and i hope someone is able to help. All i want to do is simple format a date and display it correctly.
This is jsp page:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<body>
<jsp:useBean id="now" class="java.util.Date" />
<fmt:formatDate pattern="yyyy-MM-dd" value="${now}" />
</body>
</html>This is the error i get when running this in the newest tomcat:
org.apache.jasper.JasperException: Unable to convert string "${now}" to class "java.util.Date" for attribute "value": Property Editor not registered with the PropertyEditorManager
org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:887)
org.apache.jsp.index_jsp._jspx_meth_fmt_005fformatDate_005f0(index_jsp.java:135)
org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)I lib folder (version 1.1.2):
- jstl.jar
- standard.jar
In WEB-INF/tld folder:
- fmt.tld
- c.tld
Web.xml looks like this:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
</web-app>I really hope someone is able to help - let me know if you need more information!
Thanks!
/KasperOK.
1) Declare web.xml as Servlet 2.5. Tomcat supports it. Servlet 2.3 is legacy. Replace your DOCTYPE thing by:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
<!-- Configuration here. -->
</web-app>2) Remove all loose JSTL tld files from your classpath. Those are already included in the JSTL JAR file.
3) Remove the TLD declarations from your web.xml. Those are already declared in the JSTL JAR's web.xml.
4) I recommend to remove the JSTL and Standard JAR's and use JSTL 1.2 instead: [jstl-1.2.jar|https://maven-repository.dev.java.net/repository/jstl/jars/]. Just place it in the classpath (YourWebApp/WEB-INF/lib or Tomcat/lib) and declare the @taglib in your JSP to use it. Nothing more, nothing less. Do not extract the JAR and duplicate the stuff everywhere. -
Fmt:formatDate 10.1.2 Server Error
Within the application that I have developed the first JSP page that is called after the user successfully logs in has the following code within it.
//top of the jsp page has this
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<body>
<% java.util.Date now = new java.util.Date();
request.setAttribute("now",now); %>
<fmt:formatDate value="${now}" type="both" dateStyle="short" timeStyle="short"/>
...The application with this code in it worked fine both when running it through JDeveloper 10.1.2 and on the OC4J 10.1.2.0 server.
I have then added Log4J 1.2.12 into the project so that I can use it to email our system administrators should an error occur.
The application still works fine when I run it through JDeveloper 10.1.2 that I developed it within, but when I deploy it to the OC4J 10.1.2.0 server the following error occurs after the user successfully logs into the application and the page with the above code is displayed.
java.lang.IllegalStateException: Response is already committed!
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.EvermindHttpServletResponse.setLocale(EvermindHttpServletResponse.java:1809)
at org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport.setResponseLocale(SetLocaleSupport.java:234)
at org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport.getFormattingLocale(SetLocaleSupport.java:314)
at org.apache.taglibs.standard.tag.common.fmt.FormatDateSupport.doEndTag(FormatDateSupport.java:148)
at _main._jspService(_main.java:177) [SRC:/main.jsp:189]
at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:567)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at uk.police.syp.lynx.LoginFilter.doFilter(LoginFilter.java:38) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:645)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:595)I have developed other projects that use the same concept of this using the same concept as this and the same version of JDeveloper, OC4J server and Log4J and these all work both within JDeveloper and when deployed to the server.
I'd appreciate it if anyone could help me rectify this problem as soon as possible.
Thanks in advance for your help
David
Message was edited by:
David FergusonDavid,
I found
http://www.mail-archive.com/[email protected]/msg02918.html
where it appears to be a problem within the tag library. This would explain why it works in one OC4J and doesn't in the other (my assumption is that the libraries are different, though I cannot prove this)
I also found Oracle bug 3950667 that explained a similar observation for 10.1.2.01. However, this problem is supposed to be fixed in 10.1.2. The difference between JDeveloper 10.1.2 and OracleAS 10.1.2 is that OracleAs has a later version of OC4J.
Unfortunately I cannot find more from here and you may need to involve customer support. Have you tested to deploy the jstl library with your application so that it is not using the one contained in OC4J?
Frank -
Question regarding fmt:setBundle ?
Hi I have defined <fmt:setBundle> on a jsp page with scope as application. So when i call this jsp for the first time the resource bundle is created but does it create resource bundle every time i call it or only for the first time i call it. I mean from the second time does it check whether resource bundle already exist in the application scope or it creates a fresh resource bundle every time i call this jsp page?
It can't. There is no accessible constructor. What you mean is that it calls ResourceBundle.loadBundle(). But that returns a cached copy if the bundle has already been loaded, as I already told you.
-
FormatDate doesn't work for Googlebot
Whenever I visit a cached page on google.com of my site, I find that the date is not formatted correctly.
It shows up fine when viewing on the site, but when Googlebot visits the page, the formatting is incorrect.
I wasn't too concerned with it until I started using it in my sitemap file.
I'm just using the http://java.sun.com/jsp/jstl/fmt taglib and formatDate pattern="yyyy-MM-dd" but when google crawls it, it sees the full date and time format.
When using SimpleDateFormat in a scriplet, it doesn't seem to have a problem.
I've been searching for a while about this but it hasn't been a priority until now that it's screwing up my sitemap.
Anyone ever seen this before and know how to fix it? I'm running on tomcat 6 if it makes a difference.
Edited by: njjavadev on Feb 6, 2009 3:25 PM Added info on scriptletThis is really odd.
I created a small testcase:
JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!doctype html>
<html>
<head>
<title>Test</title>
</head>
<body>
<jsp:useBean id="now" class="java.util.Date" />
Date: <fmt:formatDate value="${now}" pattern="yyyy-MM-dd" />
</body>
</html>This displays fine in a decent webbrowser. Date: 2009-02-06.
Then I did a quick test with Java without any supplemental request headers:
package test;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
public class Test {
public static void main(String[] args) throws Throwable {
URLConnection connection = new URL("http://localhost:8080/playground/test.jsp").openConnection();
InputStream input = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
for (String line = null; (line = reader.readLine()) != null;) {
System.out.println(line);
}output was:
<!doctype html>
<html>
<head>
<title>Test</title>
</head>
<body>
Date: Fri Feb 06 22:33:59 BOT 2009
</body>
</html>Then I added the language header:
URLConnection connection = new URL("http://localhost:8080/playground/test.jsp").openConnection();
connection.addRequestProperty("accept-language", "en-us"); // Added this.
InputStream input = connection.getInputStream();
...and the output was as it should be:
<!doctype html>
<html>
<head>
<title>Test</title>
</head>
<body>
Date: 2009-02-06
</body>
</html>Also adding the fmt:setLocale fixed the problem:
<fmt:setLocale value="en-us" />I was using JSTL 1.2. I am still not sure if I would consider it as a bug in JSTL. -
Hi every body,
I'm a newbie with taglibs. I'm trying to format a numeric value that a got fom the databse into a date. i get the following eror message:
javax.servlet.jsp.el.ELException: Attempt to convert String "20060802" to type "java.util.Date", but there is no PropertyEditor for that type
here is my code to format the date:
<fmt:formatDate value="${PODetails.objPOValueObject.poDate}" pattern="dd.MM.yyyy" />and here is the code in my bean:
public class POValueObject {
private String m_strPODate;
* @return Renvoie m_objPODate.
public String getPoDate() {
return m_strPODate;
* @param date m_objPODate � d�finir.
public void setPoDate(String strPODate) {
m_strPODate = strPODate;
}by the way is there a tuotorial for the core library
any input would be appriciated.To do this conversion/format you need to parse the string into a date, and then format the date as you want.
// convert from string to date
<fmt:parseDate var="poDate" value="${PODetails.objPOValueObject.poDate}" pattern="yyyyMMdd"/>
// convert from date to string
<fmt:formatDate value="${poDate}" pattern="dd.MM.yyyy" />
Maybe you are looking for
-
Really sick of the T400 - I miss my T61! Shame on Lenovo for leting this Beta laptop out!
From day 1 since I got this expesive brick, there have been problems. 1. Fingerprint reader on almost everybody's T400 malfunctions. 2. Litterally 50% of the time that I try to shut down, hibernate, or standby, the system gets stuck in the proccess,
-
How to export the source from a Jdeveloper to another Jdeveloper?
Help me. In my company I have begun to write a Java Web Application with Struts using Jdeveloper. I have the necessity to move all the project in my laptop, work on it and after move another time the project into the PC of my firm and so on. How i ca
-
my ipod classic 160 gb keeps showing error code 1439 and says it is corrupted and i have done everything the article on it says to do and still reads the same thing. has anyone else had the same problem if so what can i do to fix it. the ipod is only
-
Why I don't have a sync tab on my preference menu?
I'm trying to sync my iphone to my mac but the instructions keep telling me to use the "sync" tab under my preference menu, which I don't have. I've tried reinstalling firefox and restarting my computer but I still don't get a sync tab. I tried to sy
-
How to disable password complexity
Ok, I have XE 10g installed with Apex 4.1 ... The windows 2008 R2 server has Password Complexity Policy Disabled.... How do I disable Password Complexity in the Oracle Apex 4.1 it asking me to change the admin password on initial loggin after I just