我有一个字节数组,它是一个消息摘要。我想通过 url 将它发送到同一服务器中的另一个应用程序。我不想将它转换为字符串并拉回另一端的数组。
任何人都可以帮助我使用 servlet 做到这一点吗?
我的代码如下
发送requauset.java
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
byte[] encryptedUserName;
String username = request.getParameter("username");
RsaEncryption encrypt = new RsaEncryption();
encryptedUserName = encrypt.encryptClientMassage(username.getBytes(),pk,md);
String url = "domain/server/GetRequset?username="+encryptedUserName+"";
response.sendRedirect(url);
}
}
GetRequset.java
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//i want to get username to byte array from here.I try with request.getParameter("username") but i returns string
}