Parag Patwa wrote:
>
> What I have is as follows:
>
> /admin/jsp1
> /web-inf/classes/servlet
>
> now using jsp1, how can i use <jsp:forward=".........."/>
<jsp:forward page="/servlet/servletClassName" />
assuming that your web container provides a default mapping for
"/servlet". Since such a default mapping is not required by the
spec (and may be a security risk if available), a more portable
approach is to define a name for the servlet and a URL mapping for
the name in the web.xml file:
<web-app>
<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>myServletClassName</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/myServletPath/*</url-pattern>
</servlet-mapping>
</web-app>
With this definition in web.xml, you can use forward like this:
<jsp:forward page="/myServletPath" />
For more about how to use the web.xml file, I recommend
that you read the Servlet 2.2 specification and/or a book
about JSP/Servlets such as my JSP book:
<http://TheJSPBook.com/>
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets