parent
f28784fe0d
commit
d4708d96c2
|
@ -259,6 +259,12 @@ public class Dispatcher implements RequestDispatcher
|
|||
return _uri == null ? super.getRequestURI() : _uri.getPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuffer getRequestURL()
|
||||
{
|
||||
return _uri == null ? super.getRequestURL() : new StringBuffer(HttpURI.build(_uri).query(null).scheme(super.getScheme()).host(super.getServerName()).port(super.getServerPort()).asString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
|
|
|
@ -1238,6 +1238,7 @@ public class DispatcherTest
|
|||
assertEquals("/context/AssertForwardServlet", request.getRequestURI());
|
||||
assertEquals("/context", request.getContextPath());
|
||||
assertEquals("/AssertForwardServlet", request.getServletPath());
|
||||
assertEquals("http://local:80/context/AssertForwardServlet", request.getRequestURL().toString());
|
||||
|
||||
response.setContentType("text/html");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
|
|
Loading…
Reference in New Issue