Answer the question
In order to leave comments, you need to log in
How to get fragment (everything after #) from URI on apache http server?
There is a simple http server that receives a GET request.
public class Server {
public static void start() {
HttpServer server = ServerBootstrap.bootstrap()
.setListenerPort(80)
.registerHandler("/listener", new Handler())
.create();
try {
server.start();
} catch (IOException e) {
e.printStackTrace();
}
}
private static class Handler implements HttpRequestHandler {
@Override
public void handle(HttpRequest request, HttpResponse response, HttpContext context) throws IOException {
}
}
}
http://localhost/listener?arg_first=1&arg_second=2
http://localhost/listener#arg_first=1&arg_second=2
Answer the question
In order to leave comments, you need to log in
Anything after # is not sent to the server.
You can try using js on the client side for processing.
request.uri().getFragment()
To split into parts, you can use the split() method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question