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 8312199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:05:08+00:00 2026-06-08T20:05:08+00:00

I use Struts 1. And have next bean import java.util.Date; public class Event {

  • 0

I use Struts 1.

And have next bean

import java.util.Date;

public class Event {
     private String name;
     private Date date;
     // getters & setters
}

And form

public class Holiday {
    private Event event;
    // getters & setters
}

I have jsp for adding new holiday

<html:text name="holidayForm" property="event.date" altKey="date.pattern" maxlength="10" size="10" /></label>

And I cant get date or put default date as Date date = new Date(); in particular format on jsp.

How can I do this?

  • 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-06-08T20:05:10+00:00Added an answer on June 8, 2026 at 8:05 pm

    Rather than making your field a Date, make it a String that represents the date in the correct format. You can use the SimpleDateFormatter class to convert between the two. You could also take a look at the jQuery UI Datepicker module (Javascript, so it will run client-side) to allow your users to select a date (in the correct format), rather than typing it in themselves.

    Struts 1 form bean properties are almost always Strings because the built-in type conversion is quite limited. If you map a text input directly to a Date field in your form bean class, the value is expected to be in the format YYYY-MM-DD and you’ll get an Error 500: beanUtils.populate error if it doesn’t match.

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

Sidebar

Related Questions

How to Use <bean:write> tag in Struts 1.2. In name attribute, what value have
I have an object like this public class Employee { public String getName() {
Setup : I have a Struts web application where I use displaytag elements to
In the struts.xml I use: <result name=error>error</result> Then in my action I use: addActionError(ERROR
I´m developing a Java EE application and I'm using Struts. When I use html
I am learning to use tiles plug in in Struts 1.3 . I have
A very bad news: I have to use struts 1.x in my projects. There
If a struts 2 action class have a property of List<User> userList . And
I have always wondered why so many Java developers use .do as the extension
I have a form in simple HTML and does not use strut tags. When

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.