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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:47:54+00:00 2026-06-13T18:47:54+00:00

New to struts & trying to go through a basic tutorial and am getting

  • 0

New to struts & trying to go through a basic tutorial and am getting the error InvalidPathException: No action config found for the specified url

My url that’s blowing up is: http://localhost:8080/UserAction.do?method=add

Here is part of my struts-config.xml

<struts-config>
    <form-beans>
        <form-bean name="UserForm" type="Form.UserForm" />
    </form-beans>
    <action-mappings>
        <action path="/user" type="Action.UserAction"  input="/pages/user.jsp"  parameter="method"  name="UserForm" scope="session">
   <forward name="success" path="pages/user.jsp">
    </action-mappings>
</struts-config>

My UserAction.Java

public class UserAction extends DispatchAction {

   public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

    //Do some stuff
    UserForm userForm = (UserForm)form;
    userForm.setMessage("Added user");
    return mapping.findForward("success");
}

}

Here is the UserForm

public class UserForm extends ActionForm {

   private String message;

   public UserForm() {
       super(); 
   }

   public String getMessage() { return this.message; }

   public void setMessage(String inMessage) { this.message = inMessage; }

}

Finally my user.jsp

<html>
....
<html:form action="user">
   <table>  
     <tr> 
       <td>
         <html:submit value="add"  onClick="submitForm()"  />
       </td> </tr></table></html:form>
</html>

submitForm is simple

function submitForm(){
   document.forms[0].action = "UserAction.do?method=add"
   document.forms[0].submit();
  • 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-13T18:47:55+00:00Added an answer on June 13, 2026 at 6:47 pm

    You configured a single action, mapped to the path /user. So the URL to invoke this action is http://host:port/contextPathOfTheWebApp/user.do. In your case, since it seems you deployed the app as the root application, it should be http://localhost:8080/user.do.

    I don’t see the point in submitting the form with JavaScript. Especially if the only thing it does is changing the correct path to an incorrect one. BTW, if the form is submitted by just pressing enter in one of its inputs, the JavaScript code will be bypassed.

    You should also prefer request-scoped form beans, and respect the Java naming conventions (packages in lower-case)

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

Sidebar

Related Questions

I am new to use session management & I am using struts with MySQL
I'm trying to start a new struts 2 project using maven (struts2 blank archetype)
I am new to struts java application & i want to store database connections
I am new to struts 2.I am designing a page in struts 2.I want
I am new to struts. I want to load a list of data in
I am new to struts 2. I am facing problem in filling Select tag
I am new to Struts . I downloaded Struts2 from its website. Now I
I am fairly new to jquery and I am working with jsp and struts
i want to integrate Struts with Hibernate. I am new to these technologies. Infortunately
I'm new to Spring MVC, so I'm confused. I've used MVC in Struts, so

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.