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

  • Home
  • SEARCH
  • 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 6818037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:07:39+00:00 2026-05-26T21:07:39+00:00

I have a transfer object being returned to the JSP after a search. It

  • 0

I have a transfer object being returned to the JSP after a search. It is having a java.util.Date field (e.g. private Date issueDate;)

I am accessing the data in TO using usebean tag and displaying the date as:

<INPUT TYPE="text" readonly="readonly" NAME="issueDt" ID="issueDt" 
       SIZE="45" value="<%=mySearchTO.getIssueDt()%>">

However, this is printing the date in the format say for e.g. MON JAN 31 00:08:00 IST 2011

I want the date to be printed simply as MM/DD/YYYY and in the cases where time is also important, in the MM/DD/YYYY HH:MM format.

How to achieve this inside JSP? I don’t know if I need to go for Javascript function or some static Java method.

Please excuse the usage of scriptlet. It’s a legacy application and so I can not use EL.
Please provide solution through scriptlet only. So solutions like:

<fmt:formatDate value="${new Date(c.dateInIntegerValue)}" 
                pattern="dd.MM.yyyy hh:mm"/> 

available in other questions, will not work for me.

Is the following code valid?

<fmt:formatDate value="<%=mySearchTO.getIssueDt()%>" 
                pattern="dd.MM.yyyy hh:mm"/> 

If yes, how to use it in the JSP? I mean label and all!

Also as far as possible, I want to avoid usage of jquery and such libraries.

  • 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-26T21:07:40+00:00Added an answer on May 26, 2026 at 9:07 pm
    <%@ page import="java.text.SimpleDateFormat" %>    
    <% SimpleDateFormat dateFormatWithTime = new SimpleDateFormat("MM/dd/yyyy hh:mm");%>
    <INPUT TYPE="text" readonly="readonly" NAME="issueDt" ID="issueDt" SIZE="45" value="<%=dateFormatWithTime.format(mySearchTO.getIssueDt())%>">
    

    Ideally you should just use formatDate from JSTL or factor out this code into a
    custom taglib.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method to transfer files using a FTP Server: private void TransferNeededFiles(IEnumerable<string>
I have an data transfer object called Report . These report objects are held
i have a query that, how can i transfer an object from php file
I want to implement a sort of transfer object pattern. So, i have a
I have to transfer some values to be used as commands over the network,
I often have to transfer large files >50GBs sometimes >100GBs between drives both internal
I have implemented a file transfer rate calculator to display kB/sec for an upload
i have a task to transfer text files from one pc to another using
I have always included clauses to transfer to my clients full author, ownership and
I have a class that uses XStream and is used as a transfer format

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.