Bonjour,
dans mon fichier xml web.xml, je définie une sécurité :
Avec :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <security-constraint> <web-resource-collection> <web-resource-name>All resources</web-resource-name> <url-pattern>*.jsp</url-pattern> <url-pattern>*.action</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> ...
Et donc dans mon fichier jsp "i.login.jsp", j'ai ce code la :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/i.login.jsp</form-login-page> <form-error-page>/i.badlogin.jsp</form-error-page> </form-login-config> </login-config>
Pour ma part, je n'arrive pas à intercaler une action struts lorsque l'utilisateur est loggué.
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
31
32
33
34 <% String userName = request.getParameter("j_username"); if(userName==null) userName = request.getParameter("userid"); if(userName==null) userName = ""; HashMap loginAttributes = new HashMap(2); loginAttributes.put("j_username", userName); loginAttributes.put("j_password", ""); pageContext.setAttribute("loginAttributes", loginAttributes); String charset = LocaleSupport.getCharset(request); if (charset==null || charset.length()==0) { charset="ISO-8859-1"; } %> <ui:html locale="true"> <head> </head> <body bgcolor="white" onLoad="document.loginForm.j_username.focus();"> <jsp:include page="irisReporting.header.jsp" flush="true"/> <br/> <ui:panel width="<%=pageWidth%>"> <form name="loginForm" action="j_security_check" method="POST"> <ui:fieldpanel> <ui:text bundle="login" labelKey="label.login.user" maxlength="32" size="32" name="loginAttributes" property="j_username"/> <ui:password bundle="login" labelKey="label.login.password" maxlength="32" size="32" name="loginAttributes" property="j_password"/> </ui:fieldpanel> <ui:buttons> <ui:button type="submit" label="Login"/> </ui:buttons> </form> </ui:panel> <jsp:include page="i.footer.jsp" flush="true"/> </body> </ui:html>
Comment puis-je faire ?
PS : il faut que je garde la partie j_security_check.
Partager