M
Moreno
Hi,
I'm trying to make my first struts application and I'm fighting with
authentication and roles.
I've only one jsp page (index.jsp) that prints authentication type ("BASIC")
and user roles.
<%
authentication+="Authentication " + request.getAuthType();
if (request.isUserInRole("ADMIN")) { role += "ADMIN; " ; }
if (request.isUserInRole("USER")) { role += "USER; " ; }
%>
<br>----------------------------------------------------
<br><%= authentication %>
<br><%= "ROLES : " + role %>
<br>----------------------------------------------------
<br>
Then there's an empty form with a "submit" button.
<html:form action="/index">
<html:submit value="SUBMIT" />
</html:form>
the execute method in action is the following :
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
String forward = "index";
return mapping.findForward(forward);
}
When I enter my application the first time it shows exactly authentication
BASIC and ROLES : ADMIN
but when I press "submit" it shows "authentication NULL" and "ROLES : "
I'm using tomcat 4.1.18 (I also tried .24 and .27 !) and struts 1.1
WHERE' S THE ERROR ??
Thanks
---
I'm trying to make my first struts application and I'm fighting with
authentication and roles.
I've only one jsp page (index.jsp) that prints authentication type ("BASIC")
and user roles.
<%
authentication+="Authentication " + request.getAuthType();
if (request.isUserInRole("ADMIN")) { role += "ADMIN; " ; }
if (request.isUserInRole("USER")) { role += "USER; " ; }
%>
<br>----------------------------------------------------
<br><%= authentication %>
<br><%= "ROLES : " + role %>
<br>----------------------------------------------------
<br>
Then there's an empty form with a "submit" button.
<html:form action="/index">
<html:submit value="SUBMIT" />
</html:form>
the execute method in action is the following :
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
String forward = "index";
return mapping.findForward(forward);
}
When I enter my application the first time it shows exactly authentication
BASIC and ROLES : ADMIN
but when I press "submit" it shows "authentication NULL" and "ROLES : "
I'm using tomcat 4.1.18 (I also tried .24 and .27 !) and struts 1.1
WHERE' S THE ERROR ??
Thanks
---