<base href="<%
String rurl = request.getRequestURL().toString();
String context = request.getContextPath();
int pathstart = 8;
if (context != null && context.length() > 1)
{
pathstart = rurl.indexOf("/", rurl.indexOf(context) + 1);
}
else
{
pathstart = rurl.indexOf("/", pathstart);
}
out.print(rurl.substring(0, pathstart + 1)); %>" >This allows me to deploy my .war in various contexts within the same server.
-M Williamson
Kjellaug Johansen wrote:
Maybe I didn't explain my problem good enough...
The name of my application is WebApp. This name is similar for both the production server and the test server. The servername (if you understand what I mean by that term) on the testserver is www.mycomp.com/test, and the servername on the productionserver is www.mycomp.com.
You suggested to deploy the test-application under a different name (i.e. test-WebApp), but the problem is that I can't have the same servername for the test- and production server. See? It's ok to have different application-names, but the servername have to be different, because there are in fact two different servers on two different machines.
It seems like Struts thinks the servername is www.mycomp.com even if I'm working on the testserver with the servername www.mycomp.com/test. Why is this a problem in Struts?
I hope this explanation was clear to you... I appreciate any response on this problem :-)
Kjellaug
----- Original Message ----- From: "James Mitchell" <[EMAIL PROTECTED]> To: "Kjellaug Johansen" <[EMAIL PROTECTED]> Cc: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, March 14, 2003 4:14 PM Subject: Re: Strutsaction on different WebApps
Sorry that no one helped you, but let's take this back to the list.you
How are you planning to do this? What is the name of your application? "test" or "WebApp"
Are you familiar with Request Path Elements?
You should read the servlet spec (section 4.4). That will give you a good
understanding of why the approach you've described is giving the results
didn't expect.if
My only suggestion to you is to deploy your WebApp under a different name rather that trying to nest it under some directory.
I wouldn't recommend running your test server as your production box, but
atyou have no choice, try naming your test application as "test-WebApp" and deploy it right beside "WebApp".
That would give you this: www.mycomp.com/WebApp www.mycomp.com/test-WebApp
...I think you'll start seeing the behavior you expect.
-- James Mitchell Software Developer/Struts Evangelist http://struts.sourceforge.net/struts-atlanta/
----- Original Message ----- From: "Kjellaug Johansen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 14, 2003 5:39 AM Subject: Strutsaction on different WebApps
I've posted this on struts-user mail archive, but there haven't been any
response, so I hope you could help me! I hope you have some time to look
my problem. Thanks! :-)work
I have two servers running webapps, one for production: www.mycomp.com/WebApp and one for testing: www.mycomp.com/test/WebApp
When I work on the production server there are no problems, but when I
on the test-server and try to call a Struts-action (i.e.the
www.mycomp.com/test/WebApp/user/saveUser.do), I'm getting redirected to
production-server. The 'test' part in the URL for the test-server isignored
and I'm getting redirected to www.mycomp.com/WebApp/user/saveUser.do.config-settings
The struts-config on the testserver looks like this: <action path="/user/saveUser" type="com.mycomp.web.user.SaveUserAction" name="user" scope="request" input="/jsp/user/editUser.jsp"> </action>
The action call in the jsp file on the testserver looks like this: ... action = "/user/saveUser.do"
My questions are:
Doesn't Struts manage an extra "level" (test) between the serverroot
(www.mycomp.com) and the webapp name (WebApp)? Are there any
I can do to solve this?
Kjellaug.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

