you could use the <forward contextRelative="true" attribute -----Original Message----- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 7:33 AM To: Struts Users Mailing List Subject: Re: How to map the jsp files in different folder with the ActionServlet!!
Hi, I have a same question , regarding relative path of action mapping, say i have a jsp called signout.jsp, which has a submit button, the jsp is in folder pages, so my action mapping will be like below <action path="/pages/signout" type="com.myapp.action.SignoutAction" scope="request"> <forward name="success" path="/pages/signout.jsp" redirect="false" /> </action> and my signout.jsp will have a form defined like below <html:form action="signout.do" > the problem i am having is, if i include this signout.jsp in all the jsp's in folder pages, it works fine, but if i include it in jsp's which are in folder mypages , which is a subfolder of pages, it does not work, so how do i work around it Ashish --- "C. Struts" <[EMAIL PROTECTED]> wrote: > I can't see as far back as the begining of this > thread but just in case... > > Make sure your web.xml contains the following: > > ---------------- begin ------------------------ > <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE > web-app PUBLIC "-//Sun > Microsystems, Inc.//DTD Web Application 2.2//EN" > "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"><web-app> > > <!-- Standard Action Servlet Configuration (with > debugging) --> > <servlet> > <servlet-name>action</servlet-name> > > <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> > <init-param> > <param-name>config</param-name> > > <param-value>/WEB-INF/struts-config.xml</param-value> > </init-param> > <init-param> > <param-name>debug</param-name> > <param-value>0</param-value> > </init-param> > <init-param> > <param-name>detail</param-name> > <param-value>0</param-value> > </init-param> > <init-param> > <param-name>validate</param-name> > <param-value>true</param-value> > </init-param> > <init-param> > <param-name>application</param-name> > > <param-value>ApplicationResources</param-value> > </init-param> > <load-on-startup>2</load-on-startup> > </servlet> > > <!-- Standard Action Servlet Mapping --> > <servlet-mapping> > <servlet-name>action</servlet-name> > <url-pattern>/do/*</url-pattern><!-- here is > where you map your > action --> > </servlet-mapping> > > <!-- Welcome File List --> > <welcome-file-list> > <welcome-file>/jsp/index.jsp</welcome-file> > </welcome-file-list> > > <!-- Struts Tag Library Descriptors --> > <!-- your tag libs here --> > ----------------- end ------------------------- > > > > 10 lines from the bottom is where I map my actions > as /do/something, so my > url looks like > http://localhost:8080/appName/do/someAction -- you > can alter > it to work for you. > > Also, when you link (as in "a href") to an action, > do not use the /do, > instead just point to "someAction" -- i.e. <a > href="makePayment">Click here > to pay by credit card</a> > > > > > ----- Original Message ----- > From: "Naveen Gaurav" <[EMAIL PROTECTED]> > To: "'Struts Users Mailing List'" > <[EMAIL PROTECTED]> > Sent: Wednesday, October 02, 2002 4:46 AM > Subject: RE: How to map the jsp files in different > folder with the > ActionServlet!! > > > > i even tried doing like that but its not coming!!! > > > > Regards, > > naveen > > > > -----Original Message----- > > From: Miguel Angel Mulero Martinez > > [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, October 02, 2002 1:52 PM > > To: Struts Users Mailing List; Naveen Gaurav > > Subject: RE: How to map the jsp files in different > folder with the > > ActionServlet!! > > > > > > The action is allway mapped to /XXXXXXX.do, so you > must call it like this, > > not like /JSP/XXXXXXXX.do. > > > > If you want the second way, you can do: > > > > <action path="/JSP/searchContacts" > > > > > type="org.apache.struts.webapp.example.SearchContactsAction" > > name="SearchContactsForm" > > scope="request" > > validate="false" > > input="/searchContacts.jsp"> > > <forward name="List" > > path="/ListContacts.jsp"/> > > </action> > > > > Regards, > > Miguel > > > > -----Mensaje original----- > > De: Naveen Gaurav > [mailto:[EMAIL PROTECTED]] > > Enviado el: miércoles, 02 de octubre de 2002 10:19 > > Para: [EMAIL PROTECTED] > > Asunto: How to map the jsp files in different > folder with the > > ActionServlet!! > > > > > > On Wed, 02 Oct 2002 Naveen Gaurav wrote : > > > > > >Hi everyone, > > > > > >When i am putting my .jsp file in the root > directory and setting > > >the struts-config.xml file for the same... > everything seems to be > > >fine..(the root directory is as > > >C:\jakarta-tomcat-3.2.3\webapps\struts) and the > server.xml shows > > >the entry as > > > > > > <Context path="/struts" > > > docBase="webapps/struts" > > > crossContext="false" > > > debug="0" > > > reloadable="true" > > > > </Context> > > > > > >So far so good. > > > > > >But this is not the way i will manage my files.. > so i created > > >another folder in the root directory (JSP) as > > >C:\jakarta-tomcat-3.2.3\webapps\struts\JSP and > placed all my jsp > > >files there. > > > > > >The first page is being shown perfectly but the > forward is not > > >working.. actually it is not able to find the .do > mapping.. > > >Error message is The page cannot be displayed. " > > > >http://localhost:8080/struts/JSP/searchContacts.do > " > > > > > >The various settings are as under. > > >The server.xml is as above. > > >The struts-config.xml is as under.... > > > > > > <action path="/searchContacts" > > > > > > >type="org.apache.struts.webapp.example.SearchContactsAction" > > > name="SearchContactsForm" > > > scope="request" > > > validate="false" > > > input="/searchContacts.jsp"> > > > <forward name="List" > > >path="/ListContacts.jsp"/> > > > </action > > > > > > <form-bean name="SearchContactsForm" > > > > > > >type="org.apache.struts.webapp.example.SearchContactsForm"/> > > > > > >And in the First Jsp from where i am calling > another jsp this is > > >the desc. > > > > > > <form name = "foMessagePage" > action="searchContacts.do" > > >focus="companyName" METHOD="post"> > > > > > >Please help me. > > > > > >Thanks in advance. > > > > > >regards, > > >Naveen > > > > > > > > > > > > > > > > -- > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > ===== A$HI$H __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>