-1

When do we use .do in JSP code. For example, How does the below code works

<a href="myUsedVouchers.do" >Used Vouchers</a> 
prakash
  • 121
  • 1
  • 15
  • there is a good answer to this in the following link http://stackoverflow.com/questions/3597582/why-do-java-webapps-use-do-extension-where-did-it-come-from – Swarne27 Jan 22 '13 at 06:22

3 Answers3

5

.do is the general extension of actions using Apache Struts

Quincy
  • 4,253
  • 3
  • 22
  • 39
2

.do is used for action forward mapping.

<action input="/" name="MyForm" path="/myFormHandler" scope="request" type="com.app.actions.MyFormHandler" validate="false"> <forward name="myform" path="/MyForm.do"/> </action>

Savan Koradia
  • 137
  • 3
  • 14
  • As I am using springs, does the below code act as the action. @RequestMapping(value = "/myVouchers", method = RequestMethod.GET) public ModelAndView getMyVouchers(HttpSession session) throws ServletException, IOException, Exception { String userName = UserSession.getUserNameFromSession(); return getMerchantVoucherCount(userName, null, session); } – prakash Jan 22 '13 at 06:38
  • I've not used spring. But, [this might be useful for you](http://www.mkyong.com/spring-mvc/spring-mvc-form-handling-annotation-example/) & [this one also](http://www.springbyexample.org/examples/simple-spring-mvc-form-annotation-config-webapp-code-example.html). – Savan Koradia Jan 22 '13 at 06:51
0

this is a struts extension , which is mapped in web.xml

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/do/*</url-pattern>
</servlet-mapping>
Satya
  • 8,182
  • 5
  • 30
  • 49