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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:38:05+00:00 2026-06-07T21:38:05+00:00

When i click a submit button in my form (struts2), no action gets executed.

  • 0

When i click a submit button in my form (struts2), no action gets executed. What could be wrong with this files?

struts.xml:

        ...<action name="EditMessageAction"
            class="action.content.EditMessageAction">
            <result name="success">/WEB-INF/pages/messages/message.jsp</result>
    </action>
    <action name="SaveEditedMessageAction"
            class="action.content.SaveEditedMessageAction">
        <result name="input">/WEB-INF/pages/messages/message.jsp</result>
        <result name="success">/WEB-INF/pages/messages/messagesFirstPosition.jsp</result>       
    </action>...

message.jsp:

            <s:form id="saveEditedUserForm" action="SaveEditedUserAction" theme="simple">
            <h1>Edycja komunikatu</h1>
            <div>
                Id: <b><s:property value="id"/></b>
            </div>
            <div>
                <s:label for="dateFrom" value="Od:*"/>
                <s:textfield id="dateFrom" name="dateFrom" required="true"/>
            </div>
            <div>
                <s:label for="dateTo" value="Do:*"/>
                <s:textfield id="dateTo" name="dateTo" required="true"/>
            </div>
            <div>
                <s:label for="linkChecked" value="Link?"/>
                <s:checkbox id="linkChecked" name="linkChecked" value="true" cssClass="linkChecked"/>
            </div>
            <div class="linkDiv">
                <s:label for="link" value="Link:*"/>
                <s:textfield id="link" name="link"/>
            </div>
            <div class="redirectActionDiv">
                <s:label for="redirectAction" value="redirectAction:*"/>
                <s:textfield id="redirectAction" name="redirectAction"/>
            </div>
            <div>
                <s:label for="typeDth" value="DTH:"/>
                <s:checkbox id="typeDth" name="typeDth"/>
            </div>
            <div>

                <s:label for="typeMvno" value="MVNO:"/>
                <s:checkbox id="typeMvno" name="typeMvno" cssClass="typeMvno"/>
                <div class="typeMvnoDiv">
                    <s:label for="subTypeMvnoPostpaid" value="PostPaid:"/>
                    <s:checkbox id="subTypeMvnoPostpaid" name="subTypeMvnoPostpaid"/>
                    <s:label for="subTypeMvnoPrepaid" value="PrePaid:"/>
                    <s:checkbox id="subTypeMvnoPrepaid" name="subTypeMvnoPrepaid"/>
                </div>
            </div>
            <div>
                <s:label for="typeDvbt" value="DVBT:"/>
                <s:checkbox id="typeDvbt" name="typeDvbt"/>
            </div>
            <div>
                <s:label for="active" value="Aktywny:"/>
                <s:checkbox id="active" name="active"/>
            </div>
            <div>
<s:submit/>
            </div>
        </s:form>

and SaveEditedMessageAction.java:

package pl.cyfrowypolsat.ebok.bm.action.content;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import pl.cyfrowypolsat.ebok.bm.action.BaseAction;
import pl.cyfrowypolsat.ebok.bm.consts.SessionParameters;
import pl.cyfrowypolsat.ebok.bm.ejb.IMessages;
import pl.cyfrowypolsat.ebok.bm.ejb.bean.MessageBean;
import pl.cyfrowypolsat.ebok.bm.utils.EJBLocator;

public class SaveEditedMessageAction extends BaseAction{

    private static final long serialVersionUID = 1L;

    private static final Log LOG = LogFactory.getLog(SaveEditedMessageAction.class);

    private int id;

    private Date dateFrom;
    private Date dateTo;

    private String link;
    private String header;
    private String redirectAction;

    private boolean typeDth;
    private boolean typeMvno;
    private boolean typeDvbt;
    private boolean subTypeMvnoPostpaid;
    private boolean subTypeMvnoPrepaid;
    private boolean active;
    private boolean linkChecked;

    public String execute() {
        LOG.info("Enter: execute(). " + dateFrom + " " + link);
        MessageBean sessionMessageBean = (MessageBean) sessionParameters.get(SessionParameters.MESSAGE_EDIT);

        if(sessionMessageBean != null) {
            IMessages messagesEJB = EJBLocator.getMessages();

            sessionMessageBean.setDateFrom(getDateFrom());
            sessionMessageBean.setDateTo(getDateTo());
            sessionMessageBean.setLinkHref(getLink());
            if(linkChecked){
                sessionMessageBean.setHtml(generateMessageHtmlLink(getLink(), getHeader()));
                sessionMessageBean.setRedirectAction("NULL");
            } else {
                sessionMessageBean.setRedirectAction(getRedirectAction());
                sessionMessageBean.setHtml(generateMessageWithoutLink(getHeader()));
            }
            sessionMessageBean.setTypeDth(booleanToInt(isTypeDth()));
            sessionMessageBean.setTypeMvno(booleanToInt(isTypeMvno()));
            sessionMessageBean.setSubTypeMvnoPostpaid(booleanToInt(isSubTypeMvnoPostpaid()));
            sessionMessageBean.setSubTypeMvnoPrepaid(booleanToInt(isSubTypeMvnoPrepaid()));
            sessionMessageBean.setTypeDth(booleanToInt(isTypeDth()));
            sessionMessageBean.setAktywny(booleanToInt(isActive()));

            messagesEJB.updateMessage(sessionMessageBean);
        }
        LOG.info("Exit: execute()");
        return SUCCESS;
    }

    public int getId() {
        return id;
    }

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

    public Date getDateFrom() {
        return dateFrom;
    }

    public void setDateFrom(Date dateFrom) {
        this.dateFrom = dateFrom;
    }

    public Date getDateTo() {
        return dateTo;
    }

    public void setDateTo(Date dateTo) {
        this.dateTo = dateTo;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getRedirectAction() {
        return redirectAction;
    }

    public void setRedirectAction(String redirectAction) {
        this.redirectAction = redirectAction;
    }

    public boolean isTypeDth() {
        return typeDth;
    }

    public void setTypeDth(boolean typeDth) {
        this.typeDth = typeDth;
    }

    public boolean isTypeMvno() {
        return typeMvno;
    }

    public void setTypeMvno(boolean typeMvno) {
        this.typeMvno = typeMvno;
    }

    public boolean isTypeDvbt() {
        return typeDvbt;
    }

    public void setTypeDvbt(boolean typeDvbt) {
        this.typeDvbt = typeDvbt;
    }

    public boolean isSubTypeMvnoPostpaid() {
        return subTypeMvnoPostpaid;
    }

    public void setSubTypeMvnoPostpaid(boolean subTypeMvnoPostpaid) {
        this.subTypeMvnoPostpaid = subTypeMvnoPostpaid;
    }

    public boolean isSubTypeMvnoPrepaid() {
        return subTypeMvnoPrepaid;
    }

    public void setSubTypeMvnoPrepaid(boolean subTypeMvnoPrepaid) {
        this.subTypeMvnoPrepaid = subTypeMvnoPrepaid;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public boolean isLinkChecked() {
        return linkChecked;
    }

    public void setLinkChecked(boolean linkChecked) {
        this.linkChecked = linkChecked;
    }
}
  • 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-07T21:38:07+00:00Added an answer on June 7, 2026 at 9:38 pm

    Your form action is targeting SaveEditedUserAction, not SaveEditedMessageAction.

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

Sidebar

Related Questions

i have this form to serialize once i click the submit button, <form class=cashier_forms
I have a form which I want to submit upon button click which is
Is there ASP button that won't submit post form data. Whenever I click an
I am getting this error when I click my submit button Microsoft JScript runtime
I have a page like this: <form class=ajax method=post action=add_item.php> [text input] [submit button]
When I click the submit button on my form, I get a null reference
I have some post form. On click submit button, turn to another page. I
I have simple registration form. Once all information entered, user click submit button and
While i click the submit button the form will look like below with error
i have a form with few fileds and a submit button... when i click

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.