| Author |
question regarding the /*.do in STRUTS
|
kay lin
Ranch Hand
Joined: May 20, 2004
Posts: 132
|
|
Hi ALL: I am just wondering if i type the following http://localhost:7001/DXPaymentInquiryWeb/login.do in a browser, how does the browser know to go to a login.jsp page? is it because in the struts-config file i defined please let me know.. many thanks
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4695
|
|
1) login.do of your request maps to the /login path of the ActionMapping. 2) The ActionMapping's action is apparently returning the forward of "login" and not "success" 3) The forward "login" is set to go to login.jsp
|
A good workman is known by his tools.
|
 |
kay lin
Ranch Hand
Joined: May 20, 2004
Posts: 132
|
|
Originally posted by Marc Peabody: 1) login.do of your request maps to the /login path of the ActionMapping. 2) The ActionMapping's action is apparently returning the forward of "login" and not "success" 3) The forward "login" is set to go to login.jsp
I see. So basically you are saying that the LoginAction( the action class that processes the log in info) would be called first to handle the login.do request, and when it has found out user hasn't logged in, it will return the user to the login.jsp page. So in this place, the LoginAction class actually takes place before the login.jsp page, Am I correct? If I am correct, May we then assume that the Action class always takes place before the JSP page given you have a /*.do mapped to it? please let me know. Again, I really appreciate all your help Many thanks
|
 |
Charles Hasegawa
Ranch Hand
Joined: May 22, 2003
Posts: 117
|
|
You have it correct. Anything that ends with .do (typically, although you can remap that if you really wanted) is handled by the struts servlet. The struts servlet takes the previous piece and finds the appropriate mapping from the struts-config.xml file. You had: So, the com.paymentinquiry.struts.login.LoginAction class' execute(...) method is called (see documentation for the full order of execution if it matters to you). When the action does its work, it returns an ActionForward. The forward maps to one defined in the struts-config.xml file - either one for the particular action or a global forward.
|
 |
 |
|
|
subject: question regarding the /*.do in STRUTS
|
|
|