Hi Will
<%-- The context path returns the web application context path --%>
<% String contextPath = request.getContextPath() %>
...
<form action="<%= contextPath+"/servlet/com.myco.DataEntry" %>" >
<%-- A bit UGLY but it works --%>
Would a custom tag make it clearer? Probably would too.
<form action="<peterp:contextPath>/servlet/com.myco.DataEntry" >
Yep definitely something on my TODO and LEARNTO lists
--
Peter Pilgrim
G.O.A.T
"the Greatest Of All Time"
---------------------------------------- Message History
----------------------------------------
From: "Hines, Bill" <[EMAIL PROTECTED]>@java.sun.com> on 18/01/2001 08:12 EST
Please respond to A mailing list about Java Server Pages specification and reference
<[EMAIL PROTECTED]>
We would like to have our web applications run on different servers with
perhaps different web application paths. For example, if I set up the web
app in WAS 3.5 with the web application web path set to /myapp, I have to
have that name 'myapp' in the webapp descriptor files as well as in any URIs
in JSP or servlets prefixed to that, even though they are relative. For
example, in the descriptor file:
<default-page>
<uri>/myapp/EntryTableResults.jsp</uri>
</default-page>
in the JSP:
<FORM method="POST" action="/myapp/servlet/com.myco.DataEntry"
and in any forward/redirect in the servlet, same thing.
Can't the application be coded or the admin set up so that these things
don't have to be hard-coded into the application source files, so for
example I could put it on the same server as 'myapp2' easily without having
to change all of that?
--<CUT>--
Has anyone found a better way?
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
===========================================================================
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