struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elyes sallem <elyes.sal...@gmail.com>
Subject Re: how remain in the same page
Date Tue, 21 Apr 2009 14:51:35 GMT
ah , no , if you wanna make a test of user privilige , u can use in this
case realm
u defines roles
and u can protect same page by
security-constraint tag , u defines differents roles   , here is an example

<security-constraint>
	<display-name>Test d'authentification tomcat</display-name>
	<!-- Liste des pages protégées -->
	<web-resource-collection>
		<web-resource-name>Page sécurisée</web-resource-name>
		<url-pattern>/admin/*</url-pattern>
	</web-resource-collection>
	<!-- Rôles des utilisateurs ayant le droit d'y accéder -->
	<auth-constraint>
		<role-name>admin</role-name>
	</auth-constraint>
</security-constraint>
<login-config>
 <!-- Type d'authentification -->
 <auth-method>BASIC</auth-method>
 <realm-name>Espace Membres</realm-name>
</login-config>
<!-- Rôles utilisés dans l'application -->
<security-role>
	<description>Administrateur</description>
	<role-name>admin</role-name>
</security-role>

Regards
Sallemel





2009/4/21 Jim Kiley <jhkiley@summa-tech.com>

> Are you recommending testing a user's privileges in the untrusted,
> untrustworthy, totally hackable client code?  Really?
>
> On Tue, Apr 21, 2009 at 10:43 AM, elyes sallem <elyes.sallem@gmail.com
> >wrote:
>
> > of course u make  the test , in a javascript function, in your jsp
> >
> > Elyes
> >
> > 2009/4/21 elyes sallem <elyes.sallem@gmail.com>
> >
> > > hi Stefano ,
> > > in fact , i choosed to back to one page in every case, that's  ok for
> me
> > > if u wanna remain in the same page
> > > u can declare a getter for a member in the form
> > > let's say test1
> > > so in getTest1(){
> > > you make the treatment u want
> > > and return a boolean resultat  for example
> > > if true, u submit to an action else u don't submit
> > > and u declare test1 in the jsp page as a hidden field <htm:hidden
> > > property="test1":>
> > > like this u can remain in the same page and invoke only your action
> when
> > > the returned result is ok
> > >
> > > wish i was clear
> > >
> > > Regards
> > > Elyes
> > >
> > > }
> > >
> > >
> > >
> > > 2009/4/21 Stefano <elstefen@gmail.com>
> > >
> > > have u solved?
> > >>
> > >> i've the same issues to do.
> > >>
> > >>
> > >> On Mon, Apr 20, 2009 at 16:29, elyes sallem <elyes.sallem@gmail.com>
> > >> wrote:
> > >>
> > >> > Hello,
> > >> > i have a struts application, which can be used by different user
> > profile
> > >> > among the profile, there is  one who can access some pages
> > >> > so if he try to access to one page , i will diplay a warning message
> > in
> > >> the
> > >> > depart page
> > >> > so, i wanna know , after checking the user profile in the action,
> how
> > >> can i
> > >> > forward him to the source page, i.e he remains in the same page, and
> i
> > >> will
> > >> > display a warning message to inform him that this page is
> inaccessible
> > >> >
> > >> >
> > >> > Thanks
> > >> > Regards
> > >> > Elyes
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Stefano
> > >>
> > >
> > >
> > >
> > > --
> > > Elyes.
> > >
> >
> >
> >
> > --
> > Elyes.
> >
>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>



-- 
Elyes.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message