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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:16:33+00:00 2026-06-10T01:16:33+00:00

I have a problem in my web app with struts 2 and a date

  • 0

I have a problem in my web app with struts 2 and a date value. I’ve got a form and inside it an s:textfield that shows a date value. I read this value from request, and the problem is that the name of that value is in other variable.

The Action I’m calling does this:

...   
public String execute(){ return SUCCESS;}

public MyObject getObject1(){   
  MyObject result = new MyObject();  
  result.setDate(new java.util.Date());  
  return result;  
}  
...

On SUCCESS it goes to my form.

The code in my form (what I was wondering to write) is:

<s:form action="save">
  <s:set name="objName" value="object1"></s:set>  
  <jsp:include page="../includedform.jsp"></jsp:include>  
</s:form>

And in the “includedform.jsp” there is:

<s:textfield name="%{objName}.date" label="Date" >  
  <s:param name="value">  
    <s:date name="%{%{objName}.date}" format="dd/MM/yyyy" />  
  </s:param>  
</s:textfield>

The syntax:
%{%{objName}.anagrafica.dataNascita}
doesn’t work (it shows nothing, obviously). So i’ll need something like this but working 🙂

Other tags s:textfield inside “includedform.jsp” (ommited in the code bellow for simplicity) without date fields are working, because I am using only the name attribute and struts looks automatically for the value. This is the code I use for these textfields:

<s:textfield name="%{objName}.name" label="Name"/>
  • 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-10T01:16:35+00:00Added an answer on June 10, 2026 at 1:16 am

    your question is very confusing and you need to rephrase to make it more clear and readable.
    i am not sure why you are doing this

    <s:textfield name="%{objName}.date" label="Date" >
    

    while this can be done like

    <s:textfield name="objName.date" label="Date" > OR 
    <s:textfield name="%{objName.date}" label="Date" >
    

    when you write objName.date OGNL assume that you have a bean in your action class namely objName and this bean has property namely date, s ultimately this will get converted to

    getObjName().getDate() by ONGL

    On a similar fashion <s:date name="%{%{objName}.date}" format="dd/MM/yyyy" /> datee tag works
    For more details please refer to the official doc

    • Struts2 Date tag
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using javascript and jQuery. I have a problem that my web app has
Problem: We have a web app that calls some web services asynchronously (from the
I have this problem where I can't get my dynamic data web app to
Hello I am a Java web app developer I have a problem, I would
I am working on a store locator web app and I have a problem
We have encountered a very strange class not found problem in our web app
So, there is problem - I have the order to write web-app on Kohana
guys. I have a strange problem. I try to write unit-tests to web-app. I
I have a web app. I am using JSF2 framework. My problem started when
I have what seems like a simple problem. I have a Spring web app,

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.