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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:48:07+00:00 2026-06-12T04:48:07+00:00

Developing a demo application. Error: Can not resolve properties under push tag. name and

  • 0

Developing a demo application.

Error: Can not resolve properties under push tag. name and age

FORM:

<s:form action="addStudentAction" method="POST">
    <s:push value="student">
        <s:textfield name="name" label="Name : " value="" />
        <s:textfield name="age" label="Age : " value=""/>
    </s:push>
    <s:submit/>
</s:form>

Action & model:

public class StudentAction extends ActionSupport implements ModelDriven {

    Student student = new Student();


    @Autowired
    StudentService studentService;

    public Object getModel() {
        return student;
    }

    public String execute(){
        return SUCCESS;
    }


    public String addStudent() throws Exception {
        student.setCreatedDate(new Date());
        studentService.add(student);
        return SUCCESS;
    }


    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }


}

package com.myapp.model;

import java.util.Date;

public class Student {

    private Long id;
    private String name;
    private Integer age;
    private Date createdDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }


}

EDITED

public class StudentAction extends ActionSupport implements ModelDriven<Student> {

    Student student = new Student();
    List<Student> studentList = new ArrayList<Student>();

    @Autowired
    StudentService studentService;

    public Student getModel() {
        return student;
    }

    public String execute(){
        return SUCCESS;
    }


    public String addStudent() throws Exception {
        student.setCreatedDate(new Date());
        studentService.add(student);
        return SUCCESS;
    }

}

Still properties are not resolved. See the options. model.name will resolve the property.

jsp

**struts.xml**



 <struts>
        <constant name="struts.devMode" value="true"/>

        <package name="default" namespace="/" extends="struts-default">

            <action name="addStudentAction" class="com.myapp.action.StudentAction" method="addStudent">
                <result name="success" type="redirectAction">listStudentAction</result>
            </action>

            <action name="listStudentAction" class="com.myapp.action.StudentAction" method="listAllStudents">
                <result name="success">/pages/student.jsp</result>
            </action>

        </package>

    </struts>
  • 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-12T04:48:09+00:00Added an answer on June 12, 2026 at 4:48 am

    Push is used when accessing variables during rendering. In your case you are setting the value in the textfield to empty, and since that is all you are doing inside the push it is clear that the push tag is not doing anything useful.

    What I think you might be intending is to “push” student in the view, what would be the equivalent of appending “student.” to all the variables. This is not what the push tag does, although I must admit such a tag would be useful and possibly save a lot of typing. We can see that the target of the action implements model driven (and the model is a Student), this effectively pushes the student to the top of the stack already, so simply remove the push tag and you should be good.

    The following is advice:

    Your action has a get/set Student… it should not if it implements ModelDriven.

    Your class StudentAction, should probably be called AddStudentAction.

    The addStudent method should be removed and the functionality moved into execute() ie:

    public String execute() throws Exception {
        student.setCreatedDate(new Date());
        studentService.add(student);
        return SUCCESS;
    }
    

    You should implement a validate method public void validate() (unless you’re doing that in xml or annotations).

    Finally, this is personal preference but when you implement ModelDriven it helps to supply the type ie: implements ModelDriven<Student> (Then the IDE hopefully knows to create the correct getter/setter).

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

Sidebar

Related Questions

I am developing Android Twitter application. I downloaded TwitterClient Demo deom net. But there
I am developing a page whereby users can login and demo some pieces of
I am developing a demo application using Last.FM API which will get list of
I am developing a small application where an admin can insert bulk discount voucher
I am developing demo application in which I am using view pager. Now I
I'm looking for developing an application which can plot clients activity on the map
Developing a C# .NET 2.0 WinForm Application. Need the application to close and restart
Iam developing one application.In that iam placing the radio buttons(uiimageview) on table view and
While developing an application using gwt in ecliplse crashed. Now the server is running
When developing an RCP application against a target platform, I ( and others )

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.