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?
I was told that this is really a design issue coming from Sun. The Java
Servlet Specification, v2.2 describes the contextPath as being at the start
of the URI (chapter 5), and that is what is used to distinguish which web
app should handle a particular URI. And because of that, the contextPath is
bound to get into the development code, and that's just the way it is.
It prevents us, for example, from putting the webapp out on our production
server in a different directory and with a different context path, doing the
final run-through to ensure that it is running correctly, and then copying
it over to the 'real' directories (and previous version) to turn it on in
production. Of course, we would have already fully tested it on a test
server, but this would be to make sure there aren't any environmental issues
on the production server before turning it on for real.
Has anyone found a better way?
===========================================================================
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