Bonjour,
Je voudrais renvoyer un fichier zip depuis une action struts.
Si je mets pas d'authentification JAAS, tout se passe bien. Si je mets mon authentification JAAS de type formulaire, j'ai une erreur "Internet explorer n'a pas pu ouvrir ce site Internet ...".
Voici mon action :
J'ai bien vérifié que mon fichier zip était correctement formé
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 File f = new File("C://reports.zip"); ZipUtils.createArchive(f, new File[]{visitor.getSuscribedServicesFile()}); response.setContentType("application/zip"); response.setHeader("Content-Disposition","attachment;filename=reports.zip"); try { ServletOutputStream out = response.getOutputStream(); FileInputStream fis = new FileInputStream(f); int size=fis.available(); response.setContentLength(size); byte[] outputBytes = new byte[size]; while(fis.read(outputBytes, 0, size) != -1) { out.write(outputBytes, 0, size); } fis.close(); out.flush(); out.close(); f.delete(); } catch(Exception e) { f.deleteOnExit(); } return null;
voici mon web.xml
Est ce que quelqu'un a deja eu ce type de pb et comment le résoudre?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26... <login-config> <auth-method>FORM</auth-method> <realm-name>IOSW authentification</realm-name> <form-login-config> <form-login-page>/login.jsp</form-login-page> <form-error-page>/login.jsp?login_error=1</form-error-page> </form-login-config> </login-config> ... <security-constraint> <display-name>SecurityConstraint</display-name> <web-resource-collection> <web-resource-name>Report Access</web-resource-name> <url-pattern>/report.do</url-pattern> <http-method>POST</http-method> <http-method>GET</http-method> </web-resource-collection> <auth-constraint> <role-name>iosw_administrator</role-name> <role-name>iosw_report</role-name> <role-name>iosw_operator</role-name> </auth-constraint> </security-constraint>
Merci d'avance.
Partager