Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Hi, i am bit confused related to .do and .faces. what my question is that when my application is in purely struts or Struts-jsf i got confused when i found this. what i did was in my web.xml i did entry for faces and do like this. <servlet> <servlet-name>faces</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
now in my Struts-config file if i write like <action path="/InstructorLogin" type="InstructorLoginAction" validate="true" input="/jsp/instructorLogin.faces" name="InstructorLoginBean" scope="request" > <forward name="student" path="/jsp/studentInformation.faces" /> <forward name="success" path="/jsp/testListing.faces" /> <forward name="failure" path="/jsp/instructorLogin.faces" /> </action>
this will execute perfectly. remember i use faces everywher though my page is .jsp. then why this thing is running fine. if instead of faces i write .do then it will give error because it tries to find action related to that. This same thing is why not happening when i write .faces
A servlet container typically services the requests by matching the url-pattern with which the request was received to the best mapped servlet/JSP(If the JSP is also specified in the web.xml) in the web.xml.
hello, thnaks for replying but i really couldnt understand what u wrote. if it finds the mapping and goes to faces servlet then in my mapping i dont have any action like testListing.faces .so what faces servlet wil do here? will it just pass nothing and then then it matches to jsp page. waiting for response.
1.The FacesServlet receives the request and gets an instance of the FacesContext from the FacesContextFactory. 2. Delegate life cycle processing 3. Lifecycle executes each phase 4. Component tree created now here i dont have any jsf component as my page is in struts so dont know how this phase executed . it may not execute. ... 9. Rendering the response now this is the main pahse where the lookup in the faces configuration file wil be done that is faces.config file. and in my web.xml i dont have this file. and no entry for jsp also. so now my question is what wil happen now.why this thing still shows me the right page.
And just now i found 1 strange thing. i tried i thing and i wrote <forward name="success" path="/jsp/testListing" /> instead of <forward name="success" path="/jsp/testListing.jsp" />
and it defaultly takes .jsp . i am really not getting what is happening over here.
When you have configured this way, the struts action class when doing an actionMapping.findForward("student") is simply doing a [ RequestDispatcher.forward("/WEBAPP-CONTEXT/jsp/studentInformation.faces") ] So, what will happen now is that the servlet-container will hand over the processing to the "Faces Servlet" because of the extension ".faces"
ya i got that. but my question comes after servlet-container will hand over the processing to the "Faces Servlet".. and that is why in my last reply i wrote about jsf lifecycle and got confused in 9 th pahse which says
<b>9. Rendering the response</b> now this is the main pahse where the lookup in the faces configuration file wil be done that is faces.config file. and in my project i dont have this file. and no entry for faces.config file also. so now my question is what wil happen now because there it can not find any response or like that.why this thing still shows me the right page.