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
Similar Messages
-
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? -
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 -
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/ -
Problem using JSTL tag libraries with OC4J 9.0.3
Hi
I'm using the JSTL tag libraries with OC4J 9.0.3. I'm using JDeveloper10.1.2. I put the fmt.tld and c.tld in the WEB-INF directory and I'm adding the jstl.jar and standard.jar library to the EAR file. Both tlds have:
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
And OC4J 9.0.3 is compatible with tlib version 1.0 and jsp version 1.2. When I run the web app I get:
OracleJSP: oracle.jsp.parse.JspParseException: Line # 1, <%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
Error: oracle.xml.parser.v2.XMLParseException ( /dataSource.jsp ):
line #:1 column #:48 : FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'.
line #:2 column #:18 : Attribute 'xmlns:xsi' used but not declared.
line #:3 column #:19 : Attribute 'xmlns:acme' used but not declared.
line #:4 column #:27 : Attribute 'xsi:schemaLocation' used but not declared.
line #:7 column #:16 : Attribute 'version' used but not declared.
line #:14 column #:15 : Invalid element 'tag-class' in content of 'tag', expected elements '[tagclass]'.
line #:14 column #:15 : Element 'tag-class' used but not declared.
line #:15 column #:18 : Invalid element 'body-content' in content of 'tag', expected elements '[tagclass]'.
line #:15 column #:18 : Element 'body-content' used but not declared.
line #:16 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:18 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
line #:18 column #:12 : Element 'type' used but not declared.
line #:22 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:24 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
line #:24 column #:12 : Element 'type' used but not declared.
line #:28 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:30 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
line #:30 column #:12 : Element 'type' used but not declared.
line #:34 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:36 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
Any ideas?Hi
Thanks for the reply.
I tried it and I get the same error:
OracleJSP: oracle.jsp.parse.JspParseException: Line # 1, <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
Error: oracle.xml.parser.v2.XMLParseException ( /dataSource.jsp ):
line #:1 column #:48 : FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'.
line #:2 column #:18 : Attribute 'xmlns:xsi' used but not declared.
line #:3 column #:19 : Attribute 'xmlns:acme' used but not declared.
line #:4 column #:27 : Attribute 'xsi:schemaLocation' used but not declared.
line #:7 column #:16 : Attribute 'version' used but not declared.
line #:14 column #:15 : Invalid element 'tag-class' in content of 'tag', expected elements '[tagclass]'.
line #:14 column #:15 : Element 'tag-class' used but not declared.
line #:15 column #:18 : Invalid element 'body-content' in content of 'tag', expected elements '[tagclass]'.
line #:15 column #:18 : Element 'body-content' used but not declared.
line #:16 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:18 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
line #:18 column #:12 : Element 'type' used but not declared.
line #:22 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:24 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
line #:24 column #:12 : Element 'type' used but not declared.
line #:28 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:30 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
line #:30 column #:12 : Element 'type' used but not declared.
line #:34 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
line #:36 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'. -
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.
-
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 codeRepost
-
In the welcome page I have take user timezone and place it in the cookie (with JavaScript).
document.cookie = 'timezone=' + timeZoneString; On some other page(s) I need value of timeZoneString, and I tray something like that
<tr>
<td><om:message key="AbstractEntity.creation" /></td>
<td>
<c:set var="zone" value="${cookie.timezone.value}"/>
<fmt:formatDate value="${entity.creationTime}" type="both" timeZone="${zone}"/>
</td>
<td>(${entity.creationUser.id})</td>
</tr>Can anybody tell me where is my mistake?Problem resolved
<c:forEach var="cookieVal" items="${cookie}">
<c:if test='${cookieVal.key == "timezone"}'>
<table>
<tr>
<td><om:message key="AbstractEntity.creation" /></td>
<td>
<fmt:formatDate value="${entity.creationTime}" type="both" timeZone="${cookieVal.value.value}"/>
</td>
<td>(${entity.creationUser.id})</td>
</tr>
</table>
</c:if>
</c:forEach> -
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}"/> -
WARNING: workaround for critical clustering bug in OC4J
I found a workaround for the HTTP clustering bug described in my previous posting of August 16, 2001 "Urgent: serious HTTP clustering bug in OC4J?" (http://technet.oracle.com:89/ubb/Forum99/HTML/000261.html)
The workaround:
When adding the <cluster config/> tag in orion-web.xml specify and ID (numeric) with no more than 9 figures. The autogenerated ID is longer (14 figures on my test system)
and will cause the error.
Luciano
nullburricall wrote:
..Did you find a solution?See [this post|http://forums.sun.com/thread.jspa?threadID=5426321&messageID=11001580#11001580]. -
Invoke a WebLogic EJB from a BPEL hosted on OC4J
We are trying to invoke a simple Session EJB running on Weblogic 8.1.6 from a BPEL running on OC4J (10.1.3.4).
but we constantly get NullPointerException :-(
Could you please advise us (or point to a document) how to implement the invocation?
(we are following the instructions in
http://www.oracle.com/technology/pub/articles/bpel_cookbook/juric.html )
(the invokation succeeds from a simple standalone client, meaning that the jndi names, credentials etc. are correct)
thanx in advance
ydesmaybe if I post the exception someone could help
<2009-04-10 01:04:43,203> <DEBUG> <default.collaxa.cube.ws> <WSInvocationManager::invoke> def is file:/C:/projects/Cosmoline/technical/CosmoteApp/CosmoteEJBSample/src/TestSessionBeanService.wsdl
<2009-04-10 01:04:43,203> <DEBUG> <default.collaxa.cube.ws> <WSIFInvocationHandler::invoke> opName=sayHello, parnterLink=<partnerLink name="TestSessionBean" partnerLinkType="{urn:TestSessionBeanService}TestSessionBeanLT">
<myRole name="TestSessionBeanService">
<ServiceName>{urn:TestSessionBeanService}TestSessionBeanPT</ServiceName>
<PortType>{urn:TestSessionBeanService}TestSessionBeanPT</PortType>
<Address>http://myserver:7777/orabpel/default/MyEJBSample/1.0/TestSessionBean/TestSessionBeanService</Address>
</myRole>
<partnerRole name="TestSessionBeanService">
<ServiceName>{urn:TestSessionBeanService}TestSessionBeanPT</ServiceName>
<PortType>{urn:TestSessionBeanService}TestSessionBeanPT</PortType>
<Address>null</Address>
</partnerRole>
<conversationId>bpel://localhost/default/CosmoteEJBSample~1.0/140001-BpInv0-BpSeq0.3-3</conversationId>
<properties>{}</properties>
</partnerLink>
<2009-04-10 01:04:43,203> <DEBUG> <default.collaxa.cube.ws> <WSIFInvocationHandler::doShortCut> Parner Property optShortCut
<2009-04-10 01:04:43,218> <DEBUG> <default.collaxa.cube.engine.deployment> <LockManager::acquire> Acquired read lock for CosmoteEJBSample-1.0
<2009-04-10 01:04:43,218> <DEBUG> <default.collaxa.cube.engine.deployment> <LockManager::release> Released lock for CosmoteEJBSample-1.0
<2009-04-10 01:04:48,046> <DEBUG> <default.collaxa.cube.ws> <WSIFInvocationHandler::createOperation> Failed to createOperation for op sayHello
org.collaxa.thirdparty.apache.wsif.WSIFException: Failed to lookup EJB home using JNDI name 'ejb.TestSessionBeanRemoteHome'; nested exception is:
java.lang.NullPointerException
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFPort_EJB.getEjbHome(WSIFPort_EJB.java:285)
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFPort_EJB.getEjbObject(WSIFPort_EJB.java:298)
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFOperation_EJB.<init>(WSIFOperation_EJB.java:191)
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFPort_EJB.getDynamicWSIFOperation(WSIFPort_EJB.java:150)
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFPort_EJB.createOperation(WSIFPort_EJB.java:376)
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFPort_EJB.createOperation(WSIFPort_EJB.java:365)
at com.collaxa.cube.ws.WSIFInvocationHandler.createOperation(WSIFInvocationHandler.java:881)
at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:297)
at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:511)
at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:268)
at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:835)
at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:402)
at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:199)
at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3704)
at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1656)
at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:220)
at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:317)
at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5777)
at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1088)
at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.__createAndInvoke(CubeEngineBean.java:125)
at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:168)
at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvoke(CubeEngineBean.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
at com.evermind.server.ThreadState.runAs(ThreadState.java:693)
at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.TxRequiresNewInterceptor.invoke(TxRequiresNewInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
at CubeEngineBean_LocalProxy_4bin6i8.syncCreateAndInvoke(Unknown Source)
at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequestAnyType(DeliveryHandler.java:549)
at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequest(DeliveryHandler.java:465)
at com.collaxa.cube.engine.delivery.DeliveryHandler.request(DeliveryHandler.java:134)
at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
at com.evermind.server.ThreadState.runAs(ThreadState.java:693)
at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
at DeliveryBean_RemoteProxy_4bin6i8.request(Unknown Source)
at com.collaxa.cube.ws.soap.oc4j.SOAPRequestProvider.processNormalOperation(SOAPRequestProvider.java:451)
at com.collaxa.cube.ws.soap.oc4j.SOAPRequestProvider.processBPELMessage(SOAPRequestProvider.java:274)
at com.collaxa.cube.ws.soap.oc4j.SOAPRequestProvider.processMessage(SOAPRequestProvider.java:120)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:956)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:349)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:466)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:194)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:400)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:414)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at com.collaxa.cube.ws.wsif.providers.ejb.WSIFPort_EJB.getEjbHome(WSIFPort_EJB.java:267)
... 89 more
<2009-04-10 01:04:48,046> <DEBUG> <default.collaxa.cube.ws> <WSIFInvocationHandler::invoke> invoke failed
org.collaxa.thirdparty.apache.wsif.WSIFException: Failed to lookup EJB home using JNDI name 'ejb.TestSessionBeanRemoteHome'; nested exception is:
java.lang.NullPointerException
at com.collaxa.cube.ws.WSIFInvocationHandler.createOperation(WSIFInvocationHandler.java:906)
at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:297)
at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:511)
at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:268)
at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:835)
at com.coll -
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
Maybe you are looking for
-
I live in South Africa but i'm currently on holiday in the Uk. I'm trying to update my apps but it keeps telling me, "i'm not registered in the South African store" and i wont let me update apps - like my banking app which is necessary at the moment.
-
Reports for Low disk space alerts in scom 2007
Dear Experts, Is there any possible to get the Low disk Space alerts reports in SCOM 2007 R2. 1, I need reports for Last week SCOM sent alerts on Low Disk space for the servers list 2, Likewise I need SCOM Low disk space alerts reports for last month
-
How can I use the procedures and functions in my library
hello, all I have a pl/sql library MYLIB.pld, MYLIB.pll and MYLIB.plx. How can I invoke procedures and functions there in JDeveloper? Thanks. Damon
-
WIFI, Internet Connections
Okay i fill like such a fool, but i really need sum help. I am currentlt trying to set up my wifi from home, but could you tell me everything i need to have and how to set it up.. I am currently on dsl internet connection, but i dont have a wireless
-
Your system has not been modified err message
I just purchased an HP 15 notebook and I am trying to install a Nikon ViewNX2 photo editor app; however, I keep getting "Your system has not been modified. To install this program at a later time, run Setup Wizard again. Click the Finish button to ex