嗨,我按照我在这里看到的一个例子,但我的结果很糟糕,我有这个ShowImageAction
:
public static void execute() throws RemoteException {
HttpServletResponse response = ServletActionContext.getResponse();
response.reset();
response.setContentType("multipart/form-data");
session = ActionContext.getContext().getSession();
PublicApiService_PortType puerto=(PublicApiService_PortType) session.get("puerto");
((BasicHttpBinding_PublicApiServiceStub)puerto).setMaintainSession(true);
MessageContext ctx=(MessageContext) session.get("contexto");
PapiUserInfo[] users;
users = puerto.getUsers();
Long accountID=users[0].getID();
PapiAccountInfo info=puerto.getAccountInfo(accountID);
itemImage=info.getWhiteLabelingLogo();
System.out.println(itemImage);
OutputStream out;
try {
out = response.getOutputStream();
out.write(itemImage);
out.flush();
out.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
哪里getWhiteLabelingLogo()
; 将blob返回给我byte[]
,然后在我的jsp上我有这个:
<img src="<s:url value="ShowImageAction" />" border="0" width="100" height="100">
为什么它不起作用?这样对吗?。非常感谢