wondering if any of you have come across this problem!
I am testing a servlet whilst in development that has to serve several different sites from the one deployment area...
When the servlet gets to deployment, there is a unique branding for each of the sites that might be served... the branding is determined by the HttpServletRequest.getServerName()
Specifically when I call that method it always responds with "localhost" even though I am calling something like
WebRequest req = new GetMethodWebRequest("http://mydomain1/Index");
and another one would be
WebRequest req2 = new GetMethodWebRequest("http://mydomain2/Index");
These 2 sites in deployment have different branding!
When I do this in a live environment, it returns "mydomain1" (or 2 as required) - but running it in servletunit, it is returning "localhost" every time!
Would it be at all possible to have a method implanted into the simulator
WebRequest.setServerName(String)
or somewhere else? maybe pull the servername out of the URL that is passed in in the GetMethodWebRequest method?
that would be great! I am trying to test using servletunit that my branding functionality is working...
It's certainly possible that i've made a mistake somewhere... if that's the case, please point it out - thank you thank you ...
All the best
Sean
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
wondering if any of you have come across this problem!
I am testing a servlet whilst in development that has to serve several different sites from the one deployment area...
When the servlet gets to deployment, there is a unique branding for each of the sites that might be served... the branding is determined by the HttpServletRequest.getServerName()
Specifically when I call that method it always responds with "localhost" even though I am calling something like
WebRequest req = new GetMethodWebRequest("http://mydomain1/Index");
and another one would be
WebRequest req2 = new GetMethodWebRequest("http://mydomain2/Index");
These 2 sites in deployment have different branding!
When I do this in a live environment, it returns "mydomain1" (or 2 as required) - but running it in servletunit, it is returning "localhost" every time!
Would it be at all possible to have a method implanted into the simulator
WebRequest.setServerName(String)
or somewhere else? maybe pull the servername out of the URL that is passed in in the GetMethodWebRequest method?
that would be great! I am trying to test using servletunit that my branding functionality is working...
It's certainly possible that i've made a mistake somewhere... if that's the case, please point it out - thank you thank you ...
All the best
Sean