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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:38:00+00:00 2026-06-02T20:38:00+00:00

I am new to struts and as far as i know that .do extension

  • 0

I am new to struts and as far as i know that .do extension causes the tomcat to call the action servlet and action servlet has resource process object that invokes a particular action class

But lets suppose we have a jsp page

first.jsp

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="s" %>
 <s:form action="myform">... 

when we submit this form

action-mapping in struts.config.xml is called and it picks from there as:

<action input="/first.jsp" name="actionformbean" path="/myform" scope="session"
   type="actionclass"/>

whenever http://&#8230;.myform.do is encountered, tell the resource process object of the action servlet to invoke actionclass

BUT how is action mapping related to servlet mapping(as url pattern .do is given in here ?)

I am confused with this .do, that how is it appended to the url 🙁

HELP plz
thanks !!

  • 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-02T20:38:02+00:00Added an answer on June 2, 2026 at 8:38 pm

    The standard Action Servlet mapping for Struts is defined in your web.xml, the deployment descriptor. It goes like this:

    <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    

    The servlet-name is defined earlier in the deployment descriptor:

    <servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
      <init-param>
         ...
      </init-param>
      <load-on-startup>2</load-on-startup>
      ...
    </servlet>
    

    The url-pattern binds all urls ending with .do to the Action Servlet. The Action Servlet in turn delegates all calls to the responsible action.

    Now, there are action mappings like the one you mention:

    <action input="/first.jsp" name="actionformbean" path="/myform" scope="session"
       type="actionclass"/>
    

    Action mappings have a path that specifies their URL. The URL doesn’t need a .do suffix because Struts already “knows” it was called, otherwise the action mapping itself couldn’t be executed. Once the specified action is executed, it silently appends a .do suffix since only URL with those suffixes will be matched – otherwise the next request would be lost.

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

Sidebar

Related Questions

I have a Struts based web application that has a structure similar to the
Our manager today has informed us that our group will now handle a new
I am new to Struts 2. While configuring Struts 2 with Tomcat 5, I
I know that TimeSpan's are immutable. I have a object which contains a TimeSpan
I'm trying to start a new struts 2 project using maven (struts2 blank archetype)
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
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
I am fairly new to jquery and I am working with jsp and struts
In struts2 version 2.1.x there is a new UnknownHandler that kicks in when a

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.