Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 999133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:18:10+00:00 2026-05-16T07:18:10+00:00

I’m developing a simple servlet/JSP, data-driven web site on Google App Engine. I’ve started

  • 0

I’m developing a simple servlet/JSP, data-driven web site on Google App Engine. I’ve started to use the JSTL fmt library on some of my data entry forms and get the following session-related error when using tags <fmt:dateFormat> and <fmt:numberFormat>:

[java] java.lang.RuntimeException: Session support is not enabled in appengine-web.xml. To enable sessions, put true in that file. Without it, getSession() is allowed, but manipulation of sessionattributes is not.

The code in my JSP is, for example:

<c:forEach var="item" items="${dayList}" >
 <option><fmt:formatNumber value="${item}" pattern="00"/></option>
</c:forEach>

or

<jsp:useBean id="now" scope="page" class="java.util.Date" />
Now: ${now}<br/>
Year: <fmt:formatDate value="${now}" pattern="yyyy" />

When I comment these lines out, the page renders, when turned back on, the error results.

I don’t have sessions enabled because I don’t need them for this web application and read that it is better not to if you don’t have to. I have confirmed that no attributes are session-scoped, the only occurrence of “session” in my NetBeans project is in web.xml:

<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>

Once I enable sessions on the appengine-web.xml everything works.

My research has pointed to some locale-related context parameters that you may set in the web.xml, namely:

<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
    <param-value>en-US</param-value>
</context-param>
<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name>
    <param-value>en-US</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.timeZone</param-name>
    <param-value>EDT</param-value>
</context-param>

I have redeployed with these parameters set (and with sessions off) and get the same error.

The JSTL fmt library seems that it would be very conveniet to use for dates and numbers and such on web forms, though at the end of the day it may be that I just need to enable sessions and move on — but am I missing something here with regard to locale settings that causes the session to be referenced by default? Is this something particular to App Engine perhaps?

Thanks

P.S.
This is the stack trace I get when sessions are disabled:

 [java] Aug 17, 2010 2:41:26 AM com.google.apphosting.utils.jetty.JettyLogger warn
 [java] WARNING: /manage/events/new
 [java] java.lang.RuntimeException: Session support is not enabled in appengine-web.xml.  To enable sessions, put <sessions-enabled>true</sessions-enabled> in that file.  Without it, getSession() is allowed, but manipulation of sessionattributes is not.
 [java]         at com.google.apphosting.utils.jetty.StubSessionManager$StubSession.throwException(StubSessionManager.java:67)
 [java]         at com.google.apphosting.utils.jetty.StubSessionManager$StubSession.setAttribute(StubSessionManager.java:63)
 [java]         at org.apache.jasper.runtime.PageContextImpl.doSetAttribute(PageContextImpl.java:340)
 [java]         at org.apache.jasper.runtime.PageContextImpl.access$300(PageContextImpl.java:64)
 [java]         at org.apache.jasper.runtime.PageContextImpl$4.run(PageContextImpl.java:314)
 [java]         at java.security.AccessController.doPrivileged(Native Method)
 [java]         at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:312)
 [java]         at org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport.setResponseLocale(SetLocaleSupport.java:209)
 [java]         at org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport.doEndTag(SetLocaleSupport.java:108)
 [java]         at org.apache.jsp.WEB_002dINF.update_005fevent_jsp._jspx_meth_fmt_setLocale_0(update_005fevent_jsp.java:362)
 [java]         at org.apache.jsp.WEB_002dINF.update_005fevent_jsp._jspService(update_005fevent_jsp.java:117)
 [java]         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
 [java]         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
 [java]         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
 [java]         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
 [java]         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
 [java]         at com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet.java:23)
 [java]         at com.google.appengine.tools.development.PrivilegedJspServlet$2.run(PrivilegedJspServlet.java:59)
 [java]         at java.security.AccessController.doPrivileged(Native Method)
 [java]         at com.google.appengine.tools.development.PrivilegedJspServlet.service(PrivilegedJspServlet.java:57)
 [java]         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
 [java]         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
 [java]         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
 [java]         at com.cj.trim.trimFilter.doFilter(Unknown Source)
 [java]         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 [java]         at com.queerartfilm.web.JSTLConfigFilter.doFilter(JSTLConfigFilter.java:114)
 [java]         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 [java]         at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51)
 [java]         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 [java]         at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
 [java]         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 [java]         at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
 [java]         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
 [java]         at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
 [java]         at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 [java]         at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
 [java]         at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
 [java]         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
 [java]         at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
 [java]         at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 [java]         at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
 [java]         at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 [java]         at org.mortbay.jetty.Server.handle(Server.java:326)
 [java]         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 [java]         at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
 [java]         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
 [java]         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
 [java]         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
 [java]         at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
 [java]         at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:18:10+00:00Added an answer on May 16, 2026 at 7:18 am

    That’s very unfortunate. It look like you can’t go around this. Your best bet is then to create custom EL functions which does the same. Here’s an example how you could replace fmt:formatDate.

    First create an EL functions class (just a simple static class):

    package com.example;
    
    import java.text.SimpleDateFormat;
    import java.util.Date;
    
    public final class Functions {
    
        private Functions() {
            //
        }
    
        public static String formatDate(Date date, String pattern) {
            return new SimpleDateFormat(pattern).format(date);
        }
    
    }
    

    Then create a /WEB-INF/functions.tld (note: JSP 2.1 targeted, not sure what your GAE supports, it’s maybe Servlet 2.4, if so then you need to redeclare it as JSP 2.0 taglib):

    <?xml version="1.0" encoding="UTF-8" ?>
    
    <taglib 
        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-jsptaglibrary_2_1.xsd"
        version="2.1">
    
        <display-name>Custom Functions</display-name>    
        <tlib-version>1.0</tlib-version>
        <uri>http://example.com/functions</uri>
    
        <function>
            <name>formatDate</name>
            <function-class>com.example.Functions</function-class>
            <function-signature>java.lang.String formatDate(java.util.Date, java.lang.String)</function-signature>
        </function>
    </taglib>
    

    Then you can use it as follows in your JSP:

    <%@taglib uri="http://example.com/functions" prefix="f" %>
    <jsp:useBean id="date" class="java.util.Date" />
    ...
    <p>Current year: ${f:formatDate(date, 'yyyy')}</p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.